On Wed, Jan 25, 2012 at 4:49 PM, Bryan Kadzban <[email protected]> wrote: > Zachary Kotlarek wrote: >> On Jan 23, 2012, at 7:56 PM, Bryan Kadzban wrote: >> >>> UGH. FWIW I really don't like this "feature". >>> >>> It causes the booted-with-initramfs case to require different >>> handling from the booted-without-initramfs case, once the >>> bootscripts are running, and therefore requires changes to the >>> bootscripts if you use an initramfs. >> >> >> Why? Can't you mount the devtmpfs both with and without the >> initramfs? > > Not if it's already mounted, unless you want to undo the modifications > that udev has made (by putting a new mount on top), or make changes to > the bootscripts (which is exactly what we're trying to avoid with this > setup). :-) >
switch_root does exactly this already NOTE: somewhat untested, based on reading of documentation udev is not run in the initramfs - devtmpfs is used alone. Mounting devtmpfs causes the kernel to popoulate /dev with known devices when mounted. You don't have the complexity available with udev for rules, permissions, naming, firmware loading, etc, but (except for the last case) that's not normally needed for an initramfs to identify the root device. The steps are (pseudocode) mount devtmpfs /dev identify rootdev mount $rootdev /mnt/root mount --rebind /dev /mnt/root/dev (atomic move of dev to real root mount point) exec switch_root $rootdev /mnt/root /sbin/init (atomic move of real root to / and exec /sbin/init as pid 1) No changes should be needed to bootscripts -- -- - Steve Crosby -- http://linuxfromscratch.org/mailman/listinfo/lfs-dev FAQ: http://www.linuxfromscratch.org/faq/ Unsubscribe: See the above information page
