Re: Better handle systemd-boot and installkernel changes in HB
Immolo <[email protected]> Sat, 8 Nov 2025 16:48:51 +0000
| Newsgroups | gmane.linux.gentoo.documentation |
|---|---|
| Message-ID | <CAHfWF5mZEqio7KHFTb_UfD-o0f1kdaFeFKgFbpoV_rOPdxjc0Q@mail.gmail.com> |
--000000000000b36cef0643181685 Content-Type: text/plain; charset="UTF-8" Thanks for the feedback. On Fri, 7 Nov 2025 at 23:51, Sam James <[email protected]> wrote: > Nowa Ammerlaan <[email protected]> writes: > > > Hi all, > > [I've replied to immolo below as well. Let's please try not top-post as > it's hard to follow then.] > > > > > With regards to EFISTUB, I double checked that before and found that it > actually does not use /proc during configuration. > > Uefi-mkconfig used to do that, but it no longer does precisely because > folks were running into this problem. > > > > With regards to the Handbook, I'd just instruct users to configure the > desired cmdline in /etc/kernel/cmdline instead of > > touching the file. Sd-boot features auto detection but that does not > work for every setup and users will likely want to > > configure other options anyway. There should also really be no need to > clean that file up afterwards since users will > > very likely want to make adjustments to the kernel cmdline after > installation. > > > > I guess it depends on how floppym feels about the usefulness of the grub > autodetection. I don't know either way. > I'm really not up to speed on EFSTUB so thanks for clarifying. With regards to the HB change, it's really hard to see with medawiki quirks, however I've kept the old method that explains how to set up a cmdline and added this change as a, this is what most people will just need. I'm happy to change this if you prefer, but we generally like trying to simplify where we can in the Handbook. From my research we already did a good job at explaining all this. The issue was in practice the users were struggling with it. > > > In general users should configure some cmdline (regardless of the used > bootloader) before installing the kernel and > > rebooting. So perhaps there should be a whole separate section dedicated > to configuring the cmdline for grub, sd-boot, > > kernel built-in, or via dracut. > > > > That might be a good solution in the end, yeah. > > > Best regards, > > Nowa > > > > On 7 November 2025 15:44:49 CET, Immolo <[email protected]> > wrote: > > > > H, > > > > In my previous email I made some errors in my summary and the fix > didn't not fully solve the issue for Gentoo. Thanks > > to Nowa for being patient and explaining the parts I did not fully > grasp. > > > > The summary is now https://bugs.gentoo.org/965211 highlighted users > were not understanding the current steps in the > > Handbook to correctly setup systemd-boot and EFISTUB systems. In turn > this caused a support queue issue for the same > > task happening over and over. Gentoo has now added a chroot detection > feature to sys-kernel/installkernel, which > > helps identify when a user has fallen into this trap. > > > > The HB needs an update that solves the issue for current stable users > and how to deal with the chroot detection for ~ > > ARCH users. > > > > My solution to this is as follows. > > > > Part 1: > > > > Add the following text and steps to > https://wiki.gentoo.org/wiki/Handbook:Parts/Installation/Kernel > > > > Add to both systemd-boot and EFSSTUB: > > > > By default systemd-boot/EFISTUB will take the kernel cmdline from the > system, which is less than ideal for an > > install from live media. > > To workaround this the following changes must be made: > > > > touch /etc/kernel/cmdline > > OK. > > > touch /etc/kernel/install.d/05-check-chroot.install > > > > Why is this bit needed? Should we tell people to touch /etc/cmdline > instead/as well? > > Note I can live with us mentioning this suppression file but I just want > to be clear on why we're doing it. > As above for reasoning > > > This gives systemd-boot a blank kernel cmdliine to use rather than > using the installcd's cmdine and gets around the > > chroot check if the user > > decides to use ~ARCH. > > > > For GRUB: > > > > Create the following to pass chroot checks for > {{Package|sys-kernel/installkernel}}: > > touch /etc/kernel/install.d/05-check-chroot.install > > I'm not following this bit.. can't we just disable the check for grub > instead somehow? > > Does it make sense to tell users to always be doing this for grub? > > I could have explained this a lot better, so this one is on me. My thought process was to get something out that completely works for now. Then afterwards I would go back and raise a bug to add a disable on GRUB. The amount of user reports I've seen in the same day just raised my concerned to us needing a fix that buys us time to get it perfect. > > > > GRUB does not require any other tweaks which aren't already well > explained in the HB so this is all that is needed. > > > > A copy/paste can be found at > https://wiki.gentoo.org/wiki/User:Immolo/Sandbox/Kernel-systemd-boot > > > > Part 2 (Optional): > > > > Clean up the changes made so the blank /etc/kernel/cmdline is removed > and make Nowa's previous attempt easy to follow > > at > > https://wiki.gentoo.org/wiki/Handbook:AMD64/Blocks/Bootloader > > I don't like the idea of keeping /etc/kernel/cmdline for any longer than > > is required for the install. This resolves that issue, however I would > like someone > > else to check if it's the correct call. > > > > I think I could go either way on this. > > * Removing it: this means that once they are booted, we follow upstream > behaviour. > > * Keeping the empty file: when users reenter a chroot later on for > recovery or something, they may well completely forget about this > problem if we've deleted the file. The problem we're solving here > isn't just about new installs but also recovery... > Agreed, I don't like it on my system, but you highlighted perfectly why it could be useful too. > > > This can be both viewed and copied from > https://wiki.gentoo.org/wiki/User:Immolo/Sandbox/Bootlloader-systemd-boot > > > > These steps have now been confirmed as the fix by a user on Reddit, so > all that is > > required now is for Nowa to please give a quick once over and if she is > happy > > then this should be taken as the confirmed solution into the HB ASAP. > > > > NOTE: Alpha and HPPA might need a second edit due to some wikicode > quirks > > I can only spot those when we make these changes though. (I'm 70% sure > they will > > be OK though.) > > > > Kind regards, > > > > immolo > > [...] > thanks for working on this, > sam You are very much welcome, it's weirdly fun :) Kind regards. immolo --000000000000b36cef0643181685 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div>Thanks for the feedback.</div><br><div class=3D"gmail= _quote gmail_quote_container"><div dir=3D"ltr" class=3D"gmail_attr">On Fri,= 7 Nov 2025 at 23:51, Sam James <<a href=3D"mailto:[email protected]">sam@g= entoo.org</a>> wrote:<br></div><blockquote class=3D"gmail_quote" style= =3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding= -left:1ex">Nowa Ammerlaan <<a href=3D"mailto:[email protected]" target=3D"= _blank">[email protected]</a>> writes:<br> <br> > Hi all,<br> <br> [I've replied to immolo below as well. Let's please try not top-pos= t as<br> it's hard to follow then.]<br> <br> ><br> > With regards to EFISTUB, I double checked that before and found that i= t actually does not use /proc during configuration.<br> > Uefi-mkconfig used to do that, but it no longer does precisely because= folks were running into this problem.<br> ><br> > With regards to the Handbook, I'd just instruct users to configure= the desired cmdline in /etc/kernel/cmdline instead of<br> > touching the file. Sd-boot features auto detection but that does not w= ork for every setup and users will likely want to<br> > configure other options anyway. There should also really be no need to= clean that file up afterwards since users will<br> > very likely want to make adjustments to the kernel cmdline after insta= llation.<br> ><br> <br> I guess it depends on how floppym feels about the usefulness of the grub<br= > autodetection. I don't know either way.<br></blockquote><div><br></div>= <div>I'm really not up to speed on EFSTUB=C2=A0so thanks for clarifying= .</div><div><br></div><div>With regards to the HB change, it's really h= ard to see with medawiki=C2=A0quirks, however I've kept</div><div>the o= ld method that explains how to set up a cmdline and added this change as a,= this is what</div><div>most people will just need.</div><div><br></div><di= v>I'm happy to change this if you prefer, but we generally like trying = to simplify=C2=A0where we can</div><div>in the Handbook. From my research w= e already did a good job at explaining all this.</div><div>The issue was in= practice the users were struggling with it.=C2=A0=C2=A0</div><div>=C2=A0</= div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;bor= der-left:1px solid rgb(204,204,204);padding-left:1ex"> <br> > In general users should configure some cmdline (regardless of the used= bootloader) before installing the kernel and<br> > rebooting. So perhaps there should be a whole separate section dedicat= ed to configuring the cmdline for grub, sd-boot,<br> > kernel built-in, or via dracut.<br> ><br> <br> That might be a good solution in the end, yeah.<br> <br> > Best regards,<br> > Nowa<br> ><br> > On 7 November 2025 15:44:49 CET, Immolo <<a href=3D"mailto:immolois= [email protected]" target=3D"_blank">[email protected]</a>> wrote:= <br> ><br> >=C2=A0 H,<br> ><br> >=C2=A0 In my previous email I made some errors in my summary and the fi= x didn't not fully solve the issue for Gentoo. Thanks<br> >=C2=A0 to Nowa for being patient and explaining the parts I did not ful= ly grasp.<br> ><br> >=C2=A0 The summary is now <a href=3D"https://bugs.gentoo.org/965211" re= l=3D"noreferrer" target=3D"_blank">https://bugs.gentoo.org/965211</a> highl= ighted users were not understanding the current steps in the<br> >=C2=A0 Handbook to correctly setup systemd-boot and EFISTUB systems. In= turn this caused a support queue issue for the same<br> >=C2=A0 task happening over and over. Gentoo has now added a chroot dete= ction feature to sys-kernel/installkernel, which<br> >=C2=A0 helps identify when a user has fallen into this trap.<br> ><br> >=C2=A0 The HB needs an update that solves the issue for current stable = users and how to deal with the chroot detection for ~<br> >=C2=A0 ARCH users.<br> ><br> >=C2=A0 My solution to this is as follows.<br> >=C2=A0 =C2=A0 <br> >=C2=A0 Part 1:<br> ><br> >=C2=A0 Add the following text and steps to <a href=3D"https://wiki.gent= oo.org/wiki/Handbook:Parts/Installation/Kernel" rel=3D"noreferrer" target= =3D"_blank">https://wiki.gentoo.org/wiki/Handbook:Parts/Installation/Kernel= </a><br> ><br> >=C2=A0 Add to both systemd-boot and EFSSTUB:<br> ><br> >=C2=A0 =C2=A0 By default systemd-boot/EFISTUB will take the kernel cmdl= ine from the system, which is less than ideal for an<br> >=C2=A0 install from live media.<br> >=C2=A0 =C2=A0 To workaround this the following changes must be made:<br= > ><br> >=C2=A0 =C2=A0 =C2=A0 touch /etc/kernel/cmdline<br> <br> OK.<br> <br> >=C2=A0 =C2=A0 =C2=A0 touch /etc/kernel/install.d/05-check-chroot.instal= l<br> ><br> <br> Why is this bit needed? Should we tell people to touch /etc/cmdline<br> instead/as well?<br> <br> Note I can live with us mentioning this suppression file but I just want<br= > to be clear on why we're doing it.<br></blockquote><div><br></div><div>= As above=C2=A0 for reasoning</div><blockquote class=3D"gmail_quote" style= =3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding= -left:1ex"> <br> >=C2=A0 This gives systemd-boot a blank kernel cmdliine to use rather th= an using the installcd's cmdine and gets around the<br> >=C2=A0 chroot check if the user<br> >=C2=A0 decides to use ~ARCH.<br> ><br> >=C2=A0 For GRUB:<br> ><br> >=C2=A0 =C2=A0 Create the following to pass chroot checks for {{Package|= sys-kernel/installkernel}}:<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0touch /etc/kernel/install.d/05-check-chroot.= install<br> <br> I'm not following this bit.. can't we just disable the check for gr= ub<br> instead somehow?<br> <br> Does it make sense to tell users to always be doing this for grub?<br> <br></blockquote><div>I could have explained this a lot better, so this one= is on me.</div><div><br></div><div>My thought process was to get something= out that completely works for now.</div><div>Then afterwards I would go ba= ck and raise a bug to add a disable on GRUB.</div><div>The amount of user r= eports I've seen in the same day just raised my concerned</div><div>to = us needing a fix that buys us time to get it perfect.</div><div><br></div><= div>=C2=A0</div><div>=C2=A0</div><blockquote class=3D"gmail_quote" style=3D= "margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-le= ft:1ex"> ><br> >=C2=A0 GRUB does not require any other tweaks which aren't already = well explained in the HB so this is all that is needed.<br> ><br> >=C2=A0 A copy/paste can be found at <a href=3D"https://wiki.gentoo.org/= wiki/User:Immolo/Sandbox/Kernel-systemd-boot" rel=3D"noreferrer" target=3D"= _blank">https://wiki.gentoo.org/wiki/User:Immolo/Sandbox/Kernel-systemd-boo= t</a><br> ><br> >=C2=A0 Part 2 (Optional):<br> ><br> >=C2=A0 Clean up the changes made so the blank /etc/kernel/cmdline is re= moved and make Nowa's previous attempt easy to follow<br> >=C2=A0 at <br> >=C2=A0 <a href=3D"https://wiki.gentoo.org/wiki/Handbook:AMD64/Blocks/Bo= otloader" rel=3D"noreferrer" target=3D"_blank">https://wiki.gentoo.org/wiki= /Handbook:AMD64/Blocks/Bootloader</a><br> >=C2=A0 I don't like the idea of keeping /etc/kernel/cmdline for any= longer than<br> >=C2=A0 is required for the install. This resolves that issue, however I= would like someone<br> >=C2=A0 else to check if it's the correct call.<br> ><br> <br> I think I could go either way on this.<br> <br> * Removing it: this means that once they are booted, we follow upstream<br> =C2=A0 behaviour.<br> <br> * Keeping the empty file: when users reenter a chroot later on for<br> =C2=A0 recovery or something, they may well completely forget about this<br= > =C2=A0 problem if we've deleted the file. The problem we're solving= here<br> =C2=A0 isn't just about new installs but also recovery...<br></blockquo= te><div><br></div><div>Agreed,=C2=A0 I don't like it on my system, but = you highlighted perfectly why it could=C2=A0</div><div>be useful too.=C2=A0= </div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;b= order-left:1px solid rgb(204,204,204);padding-left:1ex"> <br> >=C2=A0 This can be both viewed and copied from <a href=3D"https://wiki.= gentoo.org/wiki/User:Immolo/Sandbox/Bootlloader-systemd-boot" rel=3D"norefe= rrer" target=3D"_blank">https://wiki.gentoo.org/wiki/User:Immolo/Sandbox/Bo= otlloader-systemd-boot</a><br> ><br> >=C2=A0 These steps have now been confirmed as the fix by a user on Redd= it, so all that is<br> >=C2=A0 required now is for Nowa to please give a quick once over and if= she is happy <br> >=C2=A0 then this should be taken as the confirmed solution into the HB = ASAP.<br> ><br> >=C2=A0 NOTE: Alpha and HPPA might need a second edit due to some wikico= de quirks<br> >=C2=A0 I can only spot those when we make these changes though. (I'= m 70% sure they will <br> >=C2=A0 be OK though.)<br> ><br> >=C2=A0 Kind regards,<br> ><br> >=C2=A0 immolo<br> > [...]<br> thanks for working on this,</blockquote><div>=C2=A0</div><blockquote class= =3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rg= b(204,204,204);padding-left:1ex">sam</blockquote><div><br></div><div>You ar= e very much welcome, it's weirdly fun :)=C2=A0</div><div><br></div><div= >Kind regards.</div><div><br></div><div>immolo=C2=A0</div></div></div> --000000000000b36cef0643181685--