Re: Better handle systemd-boot and installkernel changes in HB

Immolo <[email protected]> Fri, 7 Nov 2025 14:44:49 +0000
Newsgroups gmane.linux.gentoo.documentation
Message-ID <CAHfWF5kBSeT_qq0wEVPpFJ-Bt-B=MBW4NyLJ3WdWJxuNXwK8VQ@mail.gmail.com>
--00000000000043bce20643023d05
Content-Type: text/plain; charset="UTF-8"

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
<https://wiki.gentoo.org/wiki/Handbook:Parts/Installation/Kernel#systemd-boot>

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
    touch /etc/kernel/install.d/05-check-chroot.install

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

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.

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




On Thu, 6 Nov 2025 at 00:11, Immolo <[email protected]> wrote:

> Hi all,
>
> Trying to keep this brief as possible, https://bugs.gentoo.org/965211
> highlights an issue with a change in systemd-boot behaviour.
> This is causing new users no end of issues and clogging up support time.
> The issue is systemd-boot takes it's kernel cmdline
> options from the host system, which in this case is the installcd,
> resulting in a system that will not boot.
>
> While I think we can solve this more elegantly in the future, we need
> something now to help users and people supporting them.
>
> Part 1:
>
> Add the following text and steps to
> https://wiki.gentoo.org/wiki/Handbook:Parts/Installation/Kernel#systemd-boot
>
>   By default systemd-boot 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
>     touch /etc/kernel/install.d/05-check-chroot.install
>
> 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.
>
> A copy/paste can be found at
> https://wiki.gentoo.org/wiki/User:Immolo/Sandbox/Kernel-systemd-boot
>
> Part 2:
>
> 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
>
> This can be both viewed and copied from
> https://wiki.gentoo.org/wiki/User:Immolo/Sandbox/Bootlloader-systemd-boot
>
> I will continue to work with the projects involved and update as needed,
> but for now this is the fix Gentoo needs.
>
> Kind regards,
>
> immol
>
>

--00000000000043bce20643023d05
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>H,</div><div><br></div><div>In my previous email I ma=
de some errors=C2=A0in my summary and the fix didn&#39;t not fully solve th=
e issue for Gentoo. Thanks to Nowa for being patient and explaining the par=
ts I did not fully grasp.</div><div><br></div><div>The summary is now <a hr=
ef=3D"https://bugs.gentoo.org/965211">https://bugs.gentoo.org/965211</a> hi=
ghlighted users were not understanding=C2=A0the current steps in the Handbo=
ok to correctly setup systemd-boot and EFISTUB systems. In turn this caused=
 a support=C2=A0queue=C2=A0issue for the=C2=A0same task happening=C2=A0over=
 and over. Gentoo has now added=C2=A0a chroot detection=C2=A0feature to sys=
-kernel/installkernel,=C2=A0which=C2=A0helps identify=C2=A0when a user has =
fallen into this trap.</div><div><br></div><div>The HB needs an update that=
 solves the issue for current stable users=C2=A0and how to deal with the ch=
root detection for ~ARCH users.</div><div><br></div><div>My solution to thi=
s is as=C2=A0follows.</div><div>=C2=A0=C2=A0<div>Part 1:</div><div><br></di=
v><div>Add the following=C2=A0text and steps to=C2=A0<a href=3D"https://wik=
i.gentoo.org/wiki/Handbook:Parts/Installation/Kernel#systemd-boot" target=
=3D"_blank">https://wiki.gentoo.org/wiki/Handbook:Parts/Installation/Kernel=
</a></div><div><br></div><div>Add to both systemd-boot and EFSSTUB:</div><d=
iv><br>=C2=A0 By default systemd-boot/EFISTUB will take the kernel cmdline =
from the system, which is less than ideal for an install from live media.<b=
r>=C2=A0 To workaround this the following changes must be made:<br><br>=C2=
=A0 =C2=A0 touch /etc/kernel/cmdline<br>=C2=A0 =C2=A0 touch /etc/kernel/ins=
tall.d/05-check-chroot.install</div><div><br></div><div>This
 gives systemd-boot a blank kernel cmdliine=C2=A0to use rather than using t=
he
 installcd&#39;s cmdine=C2=A0and gets around the chroot check if the user</=
div><div>decides to use ~ARCH.</div><div><br></div><div>For GRUB:</div><div=
><br>=C2=A0 Create the following to pass chroot checks for {{Package|sys-ke=
rnel/installkernel}}:<br>=C2=A0 =C2=A0 =C2=A0touch /etc/kernel/install.d/05=
-check-chroot.install</div><div><br></div><div>GRUB does not require any ot=
her tweaks which aren&#39;t already well explained in the HB so this is all=
 that is needed.</div><div><br></div><div>A copy/paste can be found at=C2=
=A0<a href=3D"https://wiki.gentoo.org/wiki/User:Immolo/Sandbox/Kernel-syste=
md-boot" target=3D"_blank">https://wiki.gentoo.org/wiki/User:Immolo/Sandbox=
/Kernel-systemd-boot</a><br><br><div>Part 2 (Optional):</div><div><br></div=
><div>Clean up the changes made so the blank /etc/kernel/cmdline is removed=
 and make Nowa&#39;s previous=C2=A0attempt easy to follow at=C2=A0</div><di=
v><a href=3D"https://wiki.gentoo.org/wiki/Handbook:AMD64/Blocks/Bootloader"=
 target=3D"_blank">https://wiki.gentoo.org/wiki/Handbook:AMD64/Blocks/Bootl=
oader</a></div><div>I don&#39;t like the idea of keeping /etc/kernel/cmdlin=
e for any longer than</div><div>is required for the install. This resolves =
that issue, however I would like someone</div><div>else to check if it&#39;=
s the correct call.</div><div><br></div><div>This can be both viewed and co=
pied from=C2=A0<a href=3D"https://wiki.gentoo.org/wiki/User:Immolo/Sandbox/=
Bootlloader-systemd-boot" target=3D"_blank">https://wiki.gentoo.org/wiki/Us=
er:Immolo/Sandbox/Bootlloader-systemd-boot</a></div><div><br></div><div>The=
se steps have now been confirmed=C2=A0as the fix by a user on Reddit, so al=
l that is</div><div>required now is for Nowa to please give a quick once ov=
er and if she is happy=C2=A0</div><div>then this should be taken as the con=
firmed solution=C2=A0into the HB ASAP.</div><div><br></div></div><div>NOTE:=
 Alpha and HPPA might need a second edit due to some wikicode quirks</div><=
div>I can only spot those when we make these changes though. (I&#39;m 70% s=
ure they will=C2=A0</div><div>be OK though.)</div><div><br></div><div>Kind =
regards,</div><div><br></div><div>immolo</div><div><br></div><div><br><br><=
/div></div></div><br><div class=3D"gmail_quote gmail_quote_container"><div =
dir=3D"ltr" class=3D"gmail_attr">On Thu, 6 Nov 2025 at 00:11, Immolo &lt;<a=
 href=3D"mailto:[email protected]">[email protected]</a>&gt; =
wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0=
px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir=
=3D"ltr"><div>Hi all,</div><div><br></div><div>Trying to keep this brief=C2=
=A0as possible,=C2=A0<a href=3D"https://bugs.gentoo.org/965211" target=3D"_=
blank">https://bugs.gentoo.org/965211</a> highlights an issue with a change=
 in systemd-boot behaviour.</div><div>This is causing new users no end of i=
ssues and clogging=C2=A0up support time. The issue is systemd-boot takes it=
&#39;s kernel cmdline=C2=A0</div><div>options from the host system, which=
=C2=A0in this case is the installcd, resulting in=C2=A0a system that will n=
ot boot.</div><div><br></div><div>While I think we can solve this more eleg=
antly in=C2=A0the future, we need something now to help users and people su=
pporting them.</div><div><br></div><div>Part 1:</div><div><br></div><div>Ad=
d the following=C2=A0text and steps to=C2=A0<a href=3D"https://wiki.gentoo.=
org/wiki/Handbook:Parts/Installation/Kernel#systemd-boot" target=3D"_blank"=
>https://wiki.gentoo.org/wiki/Handbook:Parts/Installation/Kernel#systemd-bo=
ot</a></div><div><br>=C2=A0 By default systemd-boot will take the kernel cm=
dline from the system, which is less than ideal for an install from live me=
dia.<br>=C2=A0 To workaround this the following changes must be made:<br><b=
r>=C2=A0 =C2=A0 touch /etc/kernel/cmdline<br>=C2=A0 =C2=A0 touch /etc/kerne=
l/install.d/05-check-chroot.install</div><div><br></div><div>This gives sys=
temd-boot a blank kernel cmdliine=C2=A0to use rather than using the install=
cd&#39;s cmdine=C2=A0and gets around the chroot check if the user</div><div=
>decides to use ~ARCH.</div><div><br></div><div>A copy/paste can be found a=
t=C2=A0<a href=3D"https://wiki.gentoo.org/wiki/User:Immolo/Sandbox/Kernel-s=
ystemd-boot" target=3D"_blank">https://wiki.gentoo.org/wiki/User:Immolo/San=
dbox/Kernel-systemd-boot</a></div><div><br></div><div>Part 2:</div><div><br=
></div><div>Clean up the changes made so the blank /etc/kernel/cmdline is r=
emoved and make Nowa&#39;s previous=C2=A0attempt easy to follow at=C2=A0</d=
iv><div><a href=3D"https://wiki.gentoo.org/wiki/Handbook:AMD64/Blocks/Bootl=
oader" target=3D"_blank">https://wiki.gentoo.org/wiki/Handbook:AMD64/Blocks=
/Bootloader</a></div><div><br></div><div>This can be both viewed and copied=
 from=C2=A0<a href=3D"https://wiki.gentoo.org/wiki/User:Immolo/Sandbox/Boot=
lloader-systemd-boot" target=3D"_blank">https://wiki.gentoo.org/wiki/User:I=
mmolo/Sandbox/Bootlloader-systemd-boot</a></div><div><br></div><div>I will =
continue to work with the projects involved and update as needed, but for n=
ow this is the fix Gentoo needs.</div><div><br></div><div>Kind regards,</di=
v><div><br></div><div>immol=C2=A0=C2=A0</div><div><br></div></div>
</blockquote></div>

--00000000000043bce20643023d05--