On Jan 12, 2012, at 10:50 PM, Nathan Coulson wrote:

> initrd/initramfs always felt more useful for systems that need to
> setup an environment before mounting root.  Fun to learn, but not
> something I would want for my own system.  I know we were saying that
> udev is expecting the environment setup before we run events (and that
> retry is going to be phased out), but I would rather not have to
> resort to a initrd/initramfs to set it up.


If you run really vanilla disk configuration, and don't have exotic 
hardware/software required to mount root (or make your keyboard/display/etc. 
work) you probably will never need an initramfs. But that seems like a big 
limitation to me, and I'm not sure what the downside to an initramfs is, other 
than you'd have to install cpio and run a script from time to time if you 
changed your early boot scripts.

Just looking at the disk issues, if you have any sort of non-trivial disk 
arrangement -- RAID, LVM, encryption, etc. -- or any sort of disk that your 
hardware pre-boot environment can't read natively (> 2.1 TB disks, for example, 
or on older machines, USB disks, etc.) you're going to need someplace to stash 
the early boot tools to get root mounted. Heck, these days even bootloaders are 
getting in on the action, requiring their own non-RAID, non-LVM, non-encrypted 
partition so that they can load the tools to do all those things; whether you 
do it GRUB or with an initramfs, there is going to be more pre-boot environment 
required than we had 10 years ago.

Also note that, while it's not the method employed by popular distros, it's 
entirely possible to create an initramfs that doesn't need to be rebuilt every 
time you change your udev config or other such things, because it doesn't load 
any permanent config from the initramfs -- even with fairly complex disk 
arrangements you can often auto-detect everything relevant to get root mounted 
without any configuration at all, and in complicated setups you can pass the 
one or two required parameters from the bootloader. Once you get to the main, 
non-initramfs boot sequence you throw out everything the initramfs did (other 
than mount the root) and do a normal boot with all of the normal configuration 
options, so even if the initramfs did something wrong or misses steps you don't 
care. Given such an initramfs you only need to rebuild it when you change the 
early boot scripts, which doesn't seem like much of a burden; if you store the 
initramfs externally you don't even need to rebuild it to install a new kernel.

A well-designed initramfs is also an always-available rescue boot system, which 
is handy for the sort of people that write the own boot scripts.

        Zach

Attachment: smime.p7s
Description: S/MIME cryptographic signature

-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to