LWN.net Logo

What's initramfs do now?

What's initramfs do now?

Posted Dec 5, 2012 17:03 UTC (Wed) by dlang (✭ supporter ✭, #313)
In reply to: What's initramfs do now? by nix
Parent article: Gentoo's udev fork

> initramfses are really powerful. I don't know why people have such a resistance to them.

you answer this question in the next sentence

> Sure, they're tricky

They are powerful, but if you don't need that power, why pay with the complexity?

This 'extra' copy of things gives you one more place that software can get out of sync (a different version of software on the initramfs than on your main system for example

simple is better, if you don't need a layer of complexity for your systems, it's good to not have it


(Log in to post comments)

What's initramfs do now?

Posted Dec 5, 2012 17:11 UTC (Wed) by alex (subscriber, #1355) [Link]

Exactly, currently my kernel install is:

make modules_install
cp arch/x86/boot/bzImage /boot/kernel-2.6-linus

Why would I want more complexity to test new kernels?

What's initramfs do now?

Posted Dec 5, 2012 20:53 UTC (Wed) by nix (subscriber, #2304) [Link]

Currently my kernel install is

make install modules_install

which I think beats yours by one line. :)

(Yet again: initramfses *do not* need to be installed in separate files -- distros just do that because it makes it easier to ship prepackaged kernels. If you link them into the kernel image, they don't make it harder to test kernels at all: the installed kernel is exactly one file, just as before. A bloody good thing too given the amount of bisection I seem to have been doing recently...)

What's initramfs do now?

Posted Dec 5, 2012 21:14 UTC (Wed) by dlang (✭ supporter ✭, #313) [Link]

but his approach is trivial to put the kernel on a different machine, yours is not.

What's initramfs do now?

Posted Dec 5, 2012 22:17 UTC (Wed) by nix (subscriber, #2304) [Link]

Uh? You put the kernel on a different machine by... copying one file (and copying the modules tree if need be). How is that hard?

What's initramfs do now?

Posted Dec 5, 2012 23:02 UTC (Wed) by dlang (✭ supporter ✭, #313) [Link]

plus the system specific initramfs config (raid config, etc)....

What's initramfs do now?

Posted Dec 8, 2012 19:10 UTC (Sat) by nix (subscriber, #2304) [Link]

If you need that sort of system-specific config baked into the initramfs, you are doing something wrong. Both mdadm and LVM can scan for things to mount: you should be relying on that, and using config files at most as defaults overrideable on the kernel command line. (A few lines of shell while loop to parse the command line and bingo.)

What's initramfs do now?

Posted Dec 5, 2012 20:51 UTC (Wed) by nix (subscriber, #2304) [Link]

Err... the software can't get out of sync because initramfses are built at kernel build time from the software *already on* your system. (Normally. Obviously you can choose to do something else, but that would be strange.)

It lets you customize things that are otherwise uncustomizable -- personally I consider this a good thing. Obviously it's not essential, but it's not some monstrous terrible hugely complex destabilizing thing either. The smallest possible /init is probably less than ten lines of shell script, and most of that is getting a useful /dev to do a mount from.

What's initramfs do now?

Posted Dec 5, 2012 22:01 UTC (Wed) by jimparis (subscriber, #38647) [Link]

> Err... the software can't get out of sync because initramfses are built at kernel build time from the software *already on* your system.

How does that keep things in sync? When you update the software on your system, you need to remember to rebuild the initramfs too. Likewise with changing any configuration files that are found in both, like /etc/mdadm/mdadm.conf. I've been bitten by forgetting to run "update-initramfs -u" after changing that file.

What's initramfs do now?

Posted Dec 5, 2012 22:19 UTC (Wed) by nix (subscriber, #2304) [Link]

Oh, yeah, sure, if you have config files in an initramfs linked into the kernel, and they change, you're stuffed. I just never ever do that: the only config files in my initramfs are /etc/fstab and /etc/mdadm.conf, and they're just there to default values for the array to activate and root filesystem to mount: a few lines of shell and bingo they're overrideable from the kernel command line. That sort of thing changes much less often than the kernel itself, though, so I consider a linked-in initramfs still preferable because it lets you bisect, test kernels and the like, which is one thing a standalone initramfs or initrd *does* make harder.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds