LWN: Comments on "initramfs and where user space truly begins" https://lwn.net/Articles/191004/ This is a special feed containing comments posted to the individual LWN article titled "initramfs and where user space truly begins". en-us Sun, 05 Oct 2025 02:28:20 +0000 Sun, 05 Oct 2025 02:28:20 +0000 https://www.rssboard.org/rss-specification lwn@lwn.net initramfs and where user space truly begins https://lwn.net/Articles/191364/ https://lwn.net/Articles/191364/ nix 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.<br> Fri, 14 Jul 2006 11:55:28 +0000 initramfs and where user space truly begins https://lwn.net/Articles/191344/ https://lwn.net/Articles/191344/ dlang not all the work needs to be done by Rob or the busybox developers<br> <p> remember that maintaining a large patch out-of-kernel is a significant drain on a projects resources, once it can move into the kernel that drain is stopped and the time can be spent on other things, including (in this case) plugging the holes tha prevent it from working with more apps (to a large degree anyway, they don't want to have to support every function call forever)<br> Fri, 14 Jul 2006 05:09:52 +0000 initramfs and where user space truly begins https://lwn.net/Articles/191247/ https://lwn.net/Articles/191247/ dlang any portions that the kernel requires (kinit for example) need to be pulled in automagicly.<br> <p> 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)<br> <p> or any other method of makeing a default initramfs that provides hooks so that the distros can add their own stuff in.<br> <p> the point I'm looking for is that today you can make a monolithic kernel by make *config &amp;&amp; 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.<br> Thu, 13 Jul 2006 16:40:36 +0000 initramfs and where user space truly begins https://lwn.net/Articles/191245/ https://lwn.net/Articles/191245/ nix Indeed this seems ideal :) it could be done easily by simply allowing the kinit toolchain to differ from that used for everything else (so you could put your uClibc toolchain in there instead).<br> <p> (I can't recall if this is already done.)<br> Thu, 13 Jul 2006 16:27:28 +0000 initramfs and where user space truly begins https://lwn.net/Articles/191244/ https://lwn.net/Articles/191244/ nix IIRC Rob Landley was using words like 'no chance' regarding getting large parts of busybox to work (please correct me if I'm talking nonsense, Rob, my memory is hazy right now due to insomnia).<br> Thu, 13 Jul 2006 16:26:16 +0000 initramfs and where user space truly begins https://lwn.net/Articles/191242/ https://lwn.net/Articles/191242/ nix 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).<br> Thu, 13 Jul 2006 16:25:13 +0000 initramfs and where user space truly begins https://lwn.net/Articles/191234/ https://lwn.net/Articles/191234/ cventers Well, unless klibc implements things uClibc doesn't, why couldn't a user <br> using busybox and uClibc with initramfs not continue to use uClibc and <br> build the kinit stuff against it?<br> <p> I agree that it's a tough call but I think it's an exciting, neat and <br> clean idea to move more of that boot policy out of the kernel. There's <br> nothing more irritating to me than watching the kernel panic because the <br> VFS can't mount root, and then having to juggle boot CDs to go in and fix <br> it. Having dash available right then to step in would be convenient :)<br> Thu, 13 Jul 2006 15:51:38 +0000 initramfs and where user space truly begins https://lwn.net/Articles/191233/ https://lwn.net/Articles/191233/ dlang nothing says that your initramfs can't have some programs with klibc and some whilt glibc (although that does waste some space)<br> <p> they are working on getting the programs that you mention to run with klibc so it's a temporary problem (and one that will be easier to fix once klibc is included with the kernel, which will ease the maintinance burden that's involved with tracking kernel changes, allowing for more time to be spent on any changes to klibc that need to be done)<br> Thu, 13 Jul 2006 15:49:12 +0000 initramfs and where user space truly begins https://lwn.net/Articles/191232/ https://lwn.net/Articles/191232/ dlang however there's still the need (currently) to prepare the initramfs manually before building the kernel. <br> <p> 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.<br> <p> Thu, 13 Jul 2006 15:44:41 +0000 initramfs and where user space truly begins https://lwn.net/Articles/191189/ https://lwn.net/Articles/191189/ nix 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.<br> <p> 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.<br> <p> 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. :)<br> Thu, 13 Jul 2006 10:53:40 +0000 initramfs and where user space truly begins https://lwn.net/Articles/191187/ https://lwn.net/Articles/191187/ nix Yes. The kernel devs are in a bit of a bind.<br> <p> If they leave initramfs as it is now, completely replaceable by the builder, then the builder's existing initramfs setup will continue to work: but nothing new can be moved out of the kernel into early userspace without requiring the builder to update that setup.<br> <p> If they switch over initramfs so that the user can add things to an existing klibc-based system, they allow migration of extra init work from the kernel, and shoot a lot of existing users in the foot (e.g. those of us with busybox+uClibc-based initramfses are in trouble, because busybox won't build with klibc; there are a lot of other programs that won't either; will e2fsprogs's fsck work when linked against klibc? What about mdadm?)<br> <p> (And use of initramfs is common not just by distro kernels but also by those of us who keep our root filesystems in LVM on MD, so as to get a combination of LVM expandability and RAID robustness, let alone anyone who uses an encrypted root filesystem on a network block device or anything elaborate like that, as you said. I know I had my root filesystem on a network block device for a few weeks solely to let me keep running while I recovered from a major disk failure: that's what pushed me to RAID in the first place).<br> <p> Thu, 13 Jul 2006 10:49:54 +0000 initramfs and where user space truly begins https://lwn.net/Articles/191152/ https://lwn.net/Articles/191152/ drag As far as I am concerned initramfs kicks-ass.<br> <p> It's finally a initrd thing I can understand. I can add my own scripts and do my own thing and it's not a huge deal. <br> <p> For instance I wanted to have my flash drive show up as /dev/flashdrive and it's partitions as /dev/flashdrive1 and /dev/flashdrive2.<br> <p> This is because on different machines it would show up differently. Some machines had it as /dev/sda1 and /dev/sda2 and others with SATA drives would have it show up as /dev/sdb or c or d. This was very important problem becuase I installed Debian on flashdrive for booting machines up so I could carry around a linux system with me for surfing the web or doing rescue stuff or whatever.<br> <p> I tried initially to reference the thing using it's volume label, but that was not a total solution. It didn't work always as the /dev/disk stuff just was a symbolic link to /dev/sd*. Also I didn't want it to change the order of how the drives was detected. If the harddrives showed up as /dev/sda I wanted to make sure that they stayed that way.<br> <p> editing the initramfs scripts in my own inept way made it simple for me to work around the various small issues that cropped up when trying to have a single root file system and initrd image boot up every computer that I happenned to come across.<br> <p> So next thing I am going to do is use squashfs and UnionFS and some custom scripts to make it so that I can compress the majority of the root file system to reclaim disk space and increase speed and yet keep it read-write.<br> <p> Thu, 13 Jul 2006 05:07:22 +0000 initramfs and where user space truly begins https://lwn.net/Articles/191148/ https://lwn.net/Articles/191148/ dlang I started playing with linux around the 0.99 days and have been makeing my living with it since the 2.0 days, when I started you _had_ to compile your own kernels. I still do for ease of maintinance and performance reasons (and yes, I also drive a stick-shift, I like having control :-)<br> <p> during the last 10 years of makeing my living with Linux the only time I have used initrd or initramfs is when booting a new distro (useually only long enough to download the kernel source and recompile) I don't like the extra step of updateing the boot filesystem and matching the right one to the right kernel. As such I am among those who have been nervous at the claims that everything that can move out of the kernel must do so.<br> <p> however with initrd and klibc/kinit it can be possible to have the straightforward make menuconfig &amp;&amp; make &amp;&amp; make install process produce a single object that is enough to boot the system (satisfying my desires) while still splitting functions out of the kernel itself into userspace. as long as this is available it really doesn't matter much to me what moves where.<br> <p> I would say that the line of what should be part of the kernel tree and what shouldn't needs to be based on what is needed to function and drive the hardware. As such udev and alsalib should probably be included. software suspend code may belong there as well (there are only a small number of ways to do the job, and they tie in fairly tightly with the kernel itself, besides the debate over if it should be kernelspace or userspace to begin with), but cluster membership works quite well seperatly (and you have quite a few different options to choose from) with the other things being even further out.<br> <p> alsa is a particularly good item to look at, it's half in the kernel and have in a userspace library, but the API that everyone is supposed to use is the library, not the kernel. As such it could be argued that the kernel API's really aren't relevant and the library should be packaged with the kernel (it's not today becouse of the kernelspace and userspace dividing line, but maby it should be)<br> <p> David Lang<br> Thu, 13 Jul 2006 04:55:36 +0000 How much API should the kernel export? https://lwn.net/Articles/191147/ https://lwn.net/Articles/191147/ dlang nobody is suggesting that the interface would be stable with kinit and klibc.<br> <p> in fact that's one of the reasons they say they should be included with the kernel, specificly so that they adapt immediatly to API changes. this is not a ABI proposal by any means.<br> Thu, 13 Jul 2006 04:40:32 +0000 How much API should the kernel export? https://lwn.net/Articles/191133/ https://lwn.net/Articles/191133/ felixfix That's what it comes down to. It has always exported a system call interface. Way back when, kernels didn't have these new fangled /proc and /sys interfaces, but they always had /dev.<br> <p> An extreme case of exportitis is a micro kernel which exports everything and has almost no internal code.<br> <p> Somewhere in between is the holy grail (to some) and mark of the beast (to others) of an interface stable enough to allow binary modules whose lifetimes span an entire kernel major series.<br> <p> I wouldn't mind these kind of stable interfaces IFF they came with the understanding that anything using them would run several times slower and have fewer features than a native driver. But my experience has been that those who would agree with that today would complain tomorrow of being second class kernel outsiders. They would point fingers at every subsequent minor release which increased the incompatibility and made the universal drivers ever more distant and klugey, and be a real drag on development, trying to hold back good changes for their own selfish interests.<br> <p> I wonder how long before this particular development, and others to follow, take that same path.<br> Thu, 13 Jul 2006 03:18:33 +0000