[klibc] Query regarding initramfs
miltonm at bga.com
Mon Apr 4 10:55:30 PDT 2005
On Apr 1, 2005, at 3:27 PM, Jeff Bailey wrote:
> Le mardi 29 mars 2005 à 11:44 -0600, Milton Miller a écrit :
>> I hope this answered your questions. I've been using initramfs and
>> rootfs as my root file system in one applicatioin for 2 full years,
>> when one had to patch out the call to prepare_namespace, and have a
>> "bootloader" for my environment that allows me to choose each boot
>> pieces are loaded. The separate pieces feature has allowed
>> time savings both in time spent building file systems, and in time
>> not loading pieces that are not required for the specific test run.
>> Loading with the initrd mechanism has saved many links of the kernel
>> since it went in.
> Can you talk more about this part? I'm planing on doing initramfs
> work for Ubuntu shortly, and also do some light hacking and testing of
> grub2. Prebuilding all of the pieces into the kernel seems a bit
> impractical, and it would be nice to be able to pick and choose
> Jeff Bailey
With the current code there is no reason initramfs pieces have to
be linked into the kernel. Instead the pieces can be loaded into
memory by the bootloader and passed to the kernel as an initrd. As
of early January, the pieces can have empty (zeroed) space between
them. The linking mentioned above is a historical reference.
Using initramfs means that one does not have to rebuild a filesystem
and replace the old image on the boot media to add a driver or similar.
I can see this as a feature for installers.
However, as I mentioned one needs to be aware of the limitations
of rootfs. It is a ramfs, not tmpfs that could fall out into swap.
Each symlink takes a page. It can't be unmounted to free space,
instead the files must be removed. Also, the unpatched kernel
returns the max size as the current size, which may cause package
installers to abort.
Regarding the "bootloader", it is a perl script that calculates
the address to load each file and spits out a list of commands
to invoke the actuall file loader given a list of file names
and a starting address. Only one page of code, it would have
limited use and not assist most users who load the boot image
under control of the system processor.
More information about the klibc