Gentoo Archives: gentoo-dev

From: Rich Freeman <rich0@g.o>
To: gentoo-dev <gentoo-dev@l.g.o>
Subject: Re: [gentoo-dev] Re: rfc: Does OpenRC really need mount-ro
Date: Thu, 18 Feb 2016 11:39:30
Message-Id: CAGfcS_kVxERibKNxwtmYwWY7S6yH7AP2+ENxS2mPxLDQWeytQQ@mail.gmail.com
In Reply to: Re: [gentoo-dev] Re: rfc: Does OpenRC really need mount-ro by Richard Yao
1 On Wed, Feb 17, 2016 at 10:11 PM, Richard Yao <ryao@g.o> wrote:
2 >
3 > dracut does not assist those who do not want generic kernel
4 > configurations. Unfortunately, the handbook does not do a good job in
5 > saying that the initramfs generation and generic kernel configurations
6 > are optional.
7 >
8
9 No argument that this section of the handbook couldn't be improved.
10 Generic kernel configs are actually not a bad starting point, though
11 the reality is that you don't really need a fancy tool to have them.
12 Just stick some config files on a webpage and tell users to download
13 them to .config and run make oldconfig.
14
15 Heck, you can just zcat /proc/config.gz from the install CD most
16 likely, though you'll want to edit out the initramfs filename in the
17 config if you do this or it won't build.
18
19 Dracut works fine with just about any kernel configuration. It
20 doesn't really have anything to do with configuring the kernel. You
21 run it after you've built and installed your kernel. I didn't want to
22 split this reply up too much but I'm not sure what you meant in your
23 other email about it not configuring the bootloader - with grub2 the
24 bootloader generally configures itself.
25
26 >
27 > There is no default and system boot without an initramfs not only works,
28 > but is advisable for faster boot unless something fancy is being done
29 > that needs it.
30 >
31
32 Booting without an initramfs is supported on Gentoo as long as you
33 don't have /usr on a separate partition. If you do have /usr on a
34 separate partition this is considered an unsupported configuration
35 (unless you're using some other mechanism to get /usr mounted early in
36 boot).
37
38 However, even if it is optional I'd still recommend it. I'll grant
39 that it will add a few seconds to the boot process in many cases, but
40 it is far more robust than booting without one. In general the kernel
41 developers have been moving more towards depending more on userspace
42 for initialization where in the past the kernel did more to autodetect
43 and configure userspace. I think there is recognition that putting
44 this functionality in userspace gives everybody more flexibility in
45 initializing the system.
46
47 One big benefit of using an initramfs is more robust root detection.
48 They typically support labels and uuids for identifying a root
49 filesystem, while the kernel itself only supports device names.
50 Before I was using an initramfs I can't tell you how many times I'd
51 add a hard drive and have the kernel detect them in a different order,
52 causing my boot to break. With just one drive this is of course a
53 lower risk.
54
55 Of course once you start making your environment more complex (RAID,
56 LUKS, LVM, zfs/btrfs with multiple disks, network filesystems, etc) an
57 initramfs can easily become required. I tend to just use them
58 routinely - it is trivial to do and they rarely cause problems. I'll
59 admit that on a VM with one partition they're probably overkill.
60
61 I guess one area where they add a bit of complexity is if you're using
62 UEFI without some kind of intermediate bootloader, since a kernel can
63 be directly booted with EFI and using an initramfs in this
64 configuration is a bit of a pain in the rear. It certainly can be
65 done but it becomes a bit of a chicken/egg putting it all together
66 (you want the modules in the initramfs, but the initramfs has to be
67 built before the final kernel itself).
68
69 > Claiming to pick a default between genkernel and dracut when both are
70 > optional makes no sense, especially since dracut's capabilities
71 > (initramfs generation) are a subset of genkernel's (initramfs generation
72 > and kernel builds). dracut could replace genkernel's initramfs
73 > generation capabilities, but it simply cannot replace genkernel for
74 > building a generic kernel. It was never intended to do that.
75
76 So, again the page could probably be cleaned up in how it presents all
77 of this. I'll agree that both should stay optional, but I'd suggest
78 listing dracut first for initramfs generation. That is the only sense
79 that I'd make it a "default."
80
81 > By the way, pver the course of time, there have been things genkernel
82 > did better and things dracut did better.
83
84 That doesn't surprise me - dracut is newew, and as something new I'm
85 sure there was a point in time where it didn't do everything more
86 established solutions already did.
87
88 > It is unlikely one will ever be superior to the other.
89
90 This is pretty speculative, and any opinion I offer is only going to
91 be more speculation. However, I'm not aware of anything a genkernel
92 initramfs does that dracut doesn't already handle. It has the
93 advantage of being a more generic tool, and thus likely to have a
94 broader development community.
95
96 I guess I'm a fan of cross-distro solutions in general, but it would
97 be fair to say that the fact that something is broadly used doesn't
98 automatically make it better. The reality is that Gentoo's approach
99 to package management is completely different from how almost
100 everybody does things but we wouldn't be here if we didn't like it.
101
102 > However, some feedback on what genkernel does
103 > poorly versus dracut and could therefore improve would be helpful.
104
105 Honestly, I've never really used genkernel for initramfs generation,
106 and haven't used it to build kernels in ages. I started using an
107 initramfs when dracut was already usable. This isn't really intended
108 as a knock on genkernel. I wasn't actually aware it was still under
109 active development. Certainly if I do hear of specific things it
110 isn't doing well I'll file a bug and encourage others to do the same.
111
112 --
113 Rich