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

Immolo <[email protected]> Tue, 2 Dec 2025 09:08:54 +0000
Newsgroups gmane.linux.gentoo.documentation
Message-ID <CAHfWF5n=52pOEUrUicrMG1RqwupVgdb0LcEYJdJuBVEyx92FtA@mail.gmail.com>
--0000000000009df5d00644f4723d
Content-Type: text/plain; charset="UTF-8"

On Mon, 1 Dec 2025 at 15:18, Nowa Ammerlaan <[email protected]> wrote:

> Thanks immolo,
>
> This looks good, my only comment is that for the openrc section the path
> for the cmdline should be /etc/kernel/cmdline as well.


Following the code this what I thought should happen (my bash is still
rough)
however, unless I use /etc/cmdlline the chroot detection fails and I can't
see
why.


> Systemd-boot uses
> the systemd kernel-install always so the path is exactly the same apart
> from the USE flag configuration. I never implemented systemd-boot in
> openrc installkernel since the systemd build system has an unbreakable
> dependency between sd-boot and kernel-install.
>
> Best regards,
> Nowa
>
> On 30/11/2025 22:16, Immolo wrote:
> > Hi,
> >
> > Apologies on the delay, it's been one of those months!
> >
> > I have been about to use this time to follow how the newer community
> > members interact with the HB and then use that with guidance that
> > Nowa has provided.
> >
> > For ease I'm just going to show how this change works with
> > systemd-boot as adding all together just adds confusion
> >
> > https://wiki.gentoo.org/wiki/User:Immolo/Sandbox/SDboot <https://
> > wiki.gentoo.org/wiki/User:Immolo/Sandbox/SDboot>
> >
> > I'll fluff it up to match the HB standards, however this has
> > been repeatedly proven to solve the detection issue and
> > the new user trap, where users got lost between how the
> > OpenRC and systemd options began and ended.
> >
> > If happy I will proceed to clean up each section and how
> > they interact with later parts f the HB.
> >
> > Kind regards
> >
> > immolo
> >
> > On Sat, 8 Nov 2025 at 18:01, Nowa Ammerlaan <[email protected]
> > <mailto:[email protected]>> wrote:
> >
> >     On 08/11/2025 18:36, Immolo wrote:
> >      >  > I agree, this should not be required, if /etc/kernel/cmdline
> >     is present
> >      >  >> then the check will pass.
> >      >
> >      >  > The path is also different for systemd kernel-install versus
> >      > installkernel.
> >      >
> >      > Oh that explains why I originally read your chroot warning as
> >     vague before.
> >      >
> >      > I'll update once we have agreed on how we want  it to look.
> >      >
> >      >>>
> >      >>> Note I can live with us mentioning this suppression file but I
> >     just want
> >      >>> to be clear on why we're doing it.
> >      >>>
> >      >>>>   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?
> >      >
> >      >  > It is disabled for grub (or well it should be, that is how I
> >     intended
> >      > for this to work).
> >      >
> >      > The disabled check is currently not working, So far confirmed by
> >     a user
> >      > on Reddit
> >      > and on my test VM.
> >      >
> >      > As I didn't understand why your code isn't working yet, I opted to
> >      > handle this in the
> >      > cleanup pass (It's how we deal with major faults in telecoms and
> >     I just
> >      > noticed today
> >      > I apply this logic in Gentoo bugs I deem major.)
> >      >
> >
> >
> >     I think we are conflating two (unfortunately separate things),
> there's
> >     the check for the dracut cmdline (which runs if dracut is selected):
> >     /etc/cmdline(.d) or dracut.conf and the check for systemd-boot/ukify
> >     (which runs if layout is bls type 1 or type 2):
> /etc/*kernel/*cmdline.
> >     The latter is the one that I was talking about here and it should not
> >     run for grub (since the layout is set to something else)
> >
> >     I hate that these two paths are different, but there is unfortunately
> >     nothing I can do about that. I think the user on Reddit was hitting
> the
> >     other check for dracut. But I'd have to see logs to be sure.
> >
> >     Best regards,
> >     Nowa
> >
> >
> >
>
>

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

<div dir=3D"ltr"><div dir=3D"ltr">On Mon, 1 Dec 2025 at 15:18, Nowa Ammerla=
an &lt;<a href=3D"mailto:[email protected]">[email protected]</a>&gt; wrote:<br=
></div><div class=3D"gmail_quote gmail_quote_container"><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">Thanks immolo,<br>
<br>
This looks good, my only comment is that for the openrc section the path <b=
r>
for the cmdline should be /etc/kernel/cmdline as well. </blockquote><div><b=
r></div><div>Following the code this what I thought should happen (my bash =
is still rough)</div><div>however, unless I use /etc/cmdlline=C2=A0the chro=
ot detection fails and I can&#39;t see=C2=A0</div><div>why.</div><div>=C2=
=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8e=
x;border-left:1px solid rgb(204,204,204);padding-left:1ex">Systemd-boot use=
s <br>
the systemd kernel-install always so the path is exactly the same apart <br=
>
from the USE flag configuration. I never implemented systemd-boot in <br>
openrc installkernel since the systemd build system has an unbreakable <br>
dependency between sd-boot and kernel-install.<br>
<br>
Best regards,<br>
Nowa<br>
<br>
On 30/11/2025 22:16, Immolo wrote:<br>
&gt; Hi,<br>
&gt; <br>
&gt; Apologies on the delay, it&#39;s been one of those months!<br>
&gt; <br>
&gt; I have been about to use this time to follow how the newer community<b=
r>
&gt; members interact with the HB and then use that with guidance=C2=A0that=
<br>
&gt; Nowa has provided.<br>
&gt; <br>
&gt; For ease I&#39;m just going to show how this change=C2=A0works with<br=
>
&gt; systemd-boot as adding=C2=A0all together=C2=A0just adds confusion<br>
&gt; <br>
&gt; <a href=3D"https://wiki.gentoo.org/wiki/User:Immolo/Sandbox/SDboot" re=
l=3D"noreferrer" target=3D"_blank">https://wiki.gentoo.org/wiki/User:Immolo=
/Sandbox/SDboot</a> &lt;https:// <br>
&gt; <a href=3D"http://wiki.gentoo.org/wiki/User:Immolo/Sandbox/SDboot" rel=
=3D"noreferrer" target=3D"_blank">wiki.gentoo.org/wiki/User:Immolo/Sandbox/=
SDboot</a>&gt;<br>
&gt; <br>
&gt; I&#39;ll fluff=C2=A0it up to match the HB standards, however this has<=
br>
&gt; been repeatedly=C2=A0proven to solve the detection issue and<br>
&gt; the new user trap, where users got lost between how the<br>
&gt; OpenRC and systemd options began and ended.<br>
&gt; <br>
&gt; If happy I will proceed to clean up each section and how<br>
&gt; they interact=C2=A0with later parts f the HB.<br>
&gt; <br>
&gt; Kind regards<br>
&gt; <br>
&gt; immolo<br>
&gt; <br>
&gt; On Sat, 8 Nov 2025 at 18:01, Nowa Ammerlaan &lt;<a href=3D"mailto:nowa=
@gentoo.org" target=3D"_blank">[email protected]</a> <br>
&gt; &lt;mailto:<a href=3D"mailto:[email protected]" target=3D"_blank">nowa@g=
entoo.org</a>&gt;&gt; wrote:<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0On 08/11/2025 18:36, Immolo wrote:<br>
&gt;=C2=A0 =C2=A0 =C2=A0 &gt;=C2=A0 &gt; I agree, this should not be requir=
ed, if /etc/kernel/cmdline<br>
&gt;=C2=A0 =C2=A0 =C2=A0is present<br>
&gt;=C2=A0 =C2=A0 =C2=A0 &gt;=C2=A0 &gt;&gt; then the check will pass.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 &gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 &gt;=C2=A0 &gt; The path is also different for sys=
temd kernel-install versus<br>
&gt;=C2=A0 =C2=A0 =C2=A0 &gt; installkernel.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 &gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 &gt; Oh that explains why I originally=C2=A0read=
=C2=A0your chroot warning as<br>
&gt;=C2=A0 =C2=A0 =C2=A0vague before.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 &gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 &gt; I&#39;ll update=C2=A0once we have agreed=C2=
=A0on how we want=C2=A0 it to look.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 &gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 &gt;&gt;&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 &gt;&gt;&gt; Note I can live with us mentioning th=
is suppression file but I<br>
&gt;=C2=A0 =C2=A0 =C2=A0just want<br>
&gt;=C2=A0 =C2=A0 =C2=A0 &gt;&gt;&gt; to be clear on why we&#39;re doing it=
.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 &gt;&gt;&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 &gt;&gt;&gt;&gt;=C2=A0 =C2=A0This gives systemd-bo=
ot a blank kernel cmdliine to use<br>
&gt;=C2=A0 =C2=A0 =C2=A0rather than using the installcd&#39;s cmdine and ge=
ts around the<br>
&gt;=C2=A0 =C2=A0 =C2=A0 &gt;&gt;&gt;&gt;=C2=A0 =C2=A0chroot check if the u=
ser<br>
&gt;=C2=A0 =C2=A0 =C2=A0 &gt;&gt;&gt;&gt;&gt;=C2=A0 =C2=A0decides to use ~A=
RCH.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 &gt;&gt;&gt;&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 &gt;&gt;&gt;&gt;=C2=A0 =C2=A0For GRUB:<br>
&gt;=C2=A0 =C2=A0 =C2=A0 &gt;&gt;&gt;&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 &gt;&gt;&gt;&gt;=C2=A0 =C2=A0 =C2=A0Create the fol=
lowing to pass chroot checks for {{Package|<br>
&gt;=C2=A0 =C2=A0 =C2=A0sys-kernel/installkernel}}:<br>
&gt;=C2=A0 =C2=A0 =C2=A0 &gt;&gt;&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 touch =
/etc/kernel/install.d/05-check-chroot.install<br>
&gt;=C2=A0 =C2=A0 =C2=A0 &gt;&gt;&gt;&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 &gt;&gt;&gt; I&#39;m not following this bit.. can&=
#39;t we just disable the check<br>
&gt;=C2=A0 =C2=A0 =C2=A0for grub<br>
&gt;=C2=A0 =C2=A0 =C2=A0 &gt;&gt;&gt; instead somehow?<br>
&gt;=C2=A0 =C2=A0 =C2=A0 &gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 &gt;=C2=A0 &gt; It is disabled for grub (or well i=
t should be, that is how I<br>
&gt;=C2=A0 =C2=A0 =C2=A0intended<br>
&gt;=C2=A0 =C2=A0 =C2=A0 &gt; for this to work).<br>
&gt;=C2=A0 =C2=A0 =C2=A0 &gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 &gt; The disabled check is currently not working, =
So far confirmed by<br>
&gt;=C2=A0 =C2=A0 =C2=A0a user<br>
&gt;=C2=A0 =C2=A0 =C2=A0 &gt; on Reddit<br>
&gt;=C2=A0 =C2=A0 =C2=A0 &gt; and on my test VM.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 &gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 &gt; As I didn&#39;t understand why your code isn&=
#39;t working yet, I opted to<br>
&gt;=C2=A0 =C2=A0 =C2=A0 &gt; handle this in the<br>
&gt;=C2=A0 =C2=A0 =C2=A0 &gt; cleanup pass (It&#39;s how we deal with major=
 faults in telecoms and<br>
&gt;=C2=A0 =C2=A0 =C2=A0I just<br>
&gt;=C2=A0 =C2=A0 =C2=A0 &gt; noticed today<br>
&gt;=C2=A0 =C2=A0 =C2=A0 &gt; I apply this logic in Gentoo bugs I deem majo=
r.)<br>
&gt;=C2=A0 =C2=A0 =C2=A0 &gt;<br>
&gt; <br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0I think we are conflating two (unfortunately separa=
te things), there&#39;s<br>
&gt;=C2=A0 =C2=A0 =C2=A0the check for the dracut cmdline (which runs if dra=
cut is selected):<br>
&gt;=C2=A0 =C2=A0 =C2=A0/etc/cmdline(.d) or dracut.conf and the check for s=
ystemd-boot/ukify<br>
&gt;=C2=A0 =C2=A0 =C2=A0(which runs if layout is bls type 1 or type 2): /et=
c/*kernel/*cmdline.<br>
&gt;=C2=A0 =C2=A0 =C2=A0The latter is the one that I was talking about here=
 and it should not<br>
&gt;=C2=A0 =C2=A0 =C2=A0run for grub (since the layout is set to something =
else)<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0I hate that these two paths are different, but ther=
e is unfortunately<br>
&gt;=C2=A0 =C2=A0 =C2=A0nothing I can do about that. I think the user on Re=
ddit was hitting the<br>
&gt;=C2=A0 =C2=A0 =C2=A0other check for dracut. But I&#39;d have to see log=
s to be sure.<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0Best regards,<br>
&gt;=C2=A0 =C2=A0 =C2=A0Nowa<br>
&gt; <br>
&gt; <br>
&gt; <br>
<br>
</blockquote></div></div>

--0000000000009df5d00644f4723d--