initramfs and where user space truly begins
initramfs and where user space truly begins
Posted Jul 13, 2006 10:53 UTC (Thu) by nix (subscriber, #2304)In reply to: initramfs and where user space truly begins by dlang
Parent article: initramfs and where user space truly begins
With initramfs you can do all of that too: in fact the initramfs build process is much *easier* for the builder than the initrd ever was, because the build system can put together the cpio archive for you and compress it.
Plus, there's *no* danger of finding that you've managed to lose the initrd that corresponds to some kernel, and now you can't boot it anymore, or finding that your initrd has changed but your kernel hasn't (perhaps you had one initrd in use by several kernel images) and now you can't boot it either.
And anything that zaps pivot_root(2) and the other mass of wildly variable and variously bizarre historic horrors that initrd has accumulated to switch to the real root *has* to be good. A tiny C program to close all fds, rm -rf /-on-one-filesystem, chroot(), and execve() is all you need to use to switch from initramfs. :)
Posted Jul 13, 2006 15:44 UTC (Thu)
by dlang (guest, #313)
[Link] (3 responses)
while it's optional this isn't a problem (I just ignore the option entirely), but if/when it's made mandatory this seperate manual step should be automated.
Posted Jul 13, 2006 16:25 UTC (Thu)
by nix (subscriber, #2304)
[Link] (2 responses)
Posted Jul 13, 2006 16:40 UTC (Thu)
by dlang (guest, #313)
[Link] (1 responses)
this could be as simple as having a directory under the source three /initramfs such that anything that's in there gets used to create the initramfs (and the kernel compiles kinit and any other required pieces and puts them in there)
or any other method of makeing a default initramfs that provides hooks so that the distros can add their own stuff in.
the point I'm looking for is that today you can make a monolithic kernel by make *config && make and then use the resulting file on any compatable machine and it's sufficiant to boot the machine. if initramfs is made mandatory then it needs to be equally simple to manage.
Posted Jul 14, 2006 11:55 UTC (Fri)
by nix (subscriber, #2304)
[Link]
however there's still the need (currently) to prepare the initramfs manually before building the kernel. initramfs and where user space truly begins
There's no need to do that, unless by 'prepare' you mean 'tell the kernel build infrastructure which files should go into initramfs'. I can see no way to automate *that* without eliminating all the configurability (of course there should be a default that uses kinit if kinit becomes mandatory, and the kinit patches do indeed provide such a default).initramfs and where user space truly begins
any portions that the kernel requires (kinit for example) need to be pulled in automagicly.initramfs and where user space truly begins
It already is: there is a default initramfs source file which contains everything needed for kinit; you can add stuff to it as you wish.initramfs and where user space truly begins