Gentoo Archives: gentoo-user

From: Alan McKinnon <alan.mckinnon@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Re: Optional /usr merge in Gentoo
Date: Tue, 20 Aug 2013 14:31:18
Message-Id: 52137CE3.6060708@gmail.com
In Reply to: Re: [gentoo-user] Re: Optional /usr merge in Gentoo by Tanstaafl
1 On 20/08/2013 16:08, Tanstaafl wrote:
2 > On 2013-08-20 8:22 AM, Neil Bothwick <neil@××××××××××.uk> wrote:
3 >> On Tue, 20 Aug 2013 14:10:21 +0200, J. Roeleveld wrote:
4 >>
5 >>>> Not really, because make is intelligent enough to no bother
6 >>>> recompiling anything for which the source has not changed.
7 >>>
8 >>> True, but why recompile the kernel just to redo the initramfs?
9 >>> As mentioned, I don't update/recompile the kernel as often.
10 >>> "genkernel" puts the initramfs where it needs to be, kernel-make
11 >>> doesn't.
12 >>
13 >> That depends on your needs. The reason I do it this way is so that the
14 >> initramfs is locked to the kernel. Once that kernel boots, it will always
15 >> boot because the initramfs cannot be changed. If I make a change to the
16 >> initramfs, that's a new kernel and however broken it may be, the old one
17 >> will still work.
18 >
19 > So, you're saying that whoever it was that said that some userland files
20 > (that the initramfs 'refers to') could get updated, causing it to get
21 > out of sync - and presumably causing it to fail to boot if/when you
22 > rebooted - was wrong?
23 >
24 > The main thing about this whole initramfs thing is, like Dale, I just
25 > don't understand it. I understand grub and grub.conf. I understand
26 > enough about compiling a kernel to be able to get it done and be
27 > reasonably sure it is done right.
28
29
30 What part don't you understand? How to use it, how it works, how to
31 build it?
32
33 The full correct way to test such a thing is to configure and build the
34 new kernel, build the initramfs, install the whole lot, add new stanza
35 to grub.conf and reboot. If it fails, reboot with the old kernel, then
36 investigate.
37
38 You have servers and the only time you would really be building a new
39 kernel is to do an update you plan to use, correct? Presumably you have
40 a defined maintenance window for that, so make full use of the time. You
41 can copy debian's scheme in grub.conf to configure a known good fallback
42 that will be used if the boot fails.
43
44
45
46 >
47 > But if my system ever failed to boot because of a problem with the
48 > initramfs, I basically would be hosed.
49
50 You can't fix them (well, not easily), you just rebuild them.
51 If it helps, think of an initramfs as a minimal system image that is
52 compressed and stored in a file. The kernels mounts it at /, uses it
53 briefly to looad some drivers and do kernel-space setups then invokes
54 some internal magic to toss it and mount the real (and now accessible) /
55 correctly. It's magic because you cannot do this anymore once init has
56 started
57
58
59 >
60 >> The kernel and initramfs are so closely coupled, it just seems sensible
61 >> to keep them in the same file, since neitherof them is any use without
62 >> the other.
63 >
64 > See above...
65 >
66
67
68 --
69 Alan McKinnon
70 alan.mckinnon@×××××.com