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

Immolo <[email protected]> Thu, 4 Dec 2025 12:10:53 +0000
Newsgroups gmane.linux.gentoo.documentation
Message-ID <CAHfWF5k9cS4Pnoff7yGSs0r7AQpdqZn5TUNZJMNstK2AQr=idA@mail.gmail.com>
--000000000000152c2306451f39e9
Content-Type: text/plain; charset="UTF-8"

Hi,

Systemd-boot is now complete.

I'm in the middle of checking GRUB on both openrc and systemd but I wonder
if we should just
disable the check from running if +grub is set? Currently on OpenRC at
least it looking for the
/etc/cmdline file and then promptly ignoring it as grub uses its own
system.

I want to make sure I've grasped this one before doing the edit.

Kind regards.

immolo

On Tue, 2 Dec 2025 at 12:26, Immolo <[email protected]> wrote:

>
>
> On Tue, 2 Dec 2025 at 11:36, Nowa Ammerlaan <[email protected]> wrote:
>
>> On 02/12/2025 11:50, Immolo wrote:
>> > Ah that's why we are on different pages, currently you only need one of
>> the
>> > files to be set not both which is why my solution only includes one.
>>
>> I did a quick test just now, and I definitely need to touch both
>> /etc/cmdline and /etc/kernel/cmdline if
>> INSTALLKERNEL_INITRD_GENERATOR=dracut and INSTALLKERNEL_LAYOUT=bls.
>>
>>
> Huh, I'll do a second test, but that was not the result I saw.
> Not worth worrying about beyond this point though, and we'll
> focus below.
>
> >     Alternatively we could instruct the user to symlink one to the
>> >     other, or
>> >     disable hostonly_cmdline (which is what I do on my systems).
>> >
>> >
>> > My thought was to get the user to symlink here so the user has one less
>> > thing
>> > to worry about.
>>
>> Symlinking is definitely the way to go, having two config files
>> potentially going out of sync will be a headache for the user later on.
>>
>> >
>> >      > This was part of the reason why I stuck to just using SD-boot
>> >     while we
>> >      > discuss, as it gets real confusing when you start summarising so
>> many
>> >      > different options.
>> >      >
>> >      > Does this general idea sound workable to you?
>> >      >
>> >      >     We could patch dracut to use the same file to make things
>> less
>> >      >     confusing, but this would be a breaking change for some
>> users.
>> >      >
>> >      >
>> >      > It's a shame we can't just symlink the two files as it would make
>> >      > all this so much simpler.
>> >
>> >     Well, we can, but we would then be potentially overwriting existing
>> >     config files with a symlink. I don't think
>> >     portage+etc-update/dispatch-conf can handle that.
>> >
>> >
>> > I meant presetup if I wasn't clear, the issue of course doing that means
>> > the file exists and the chroot script becomes pointless.
>> >
>> > I'll do some tests on distpatch-conf and seeing I can break it/
>>
>> I think the following should be safe to recommend:
>>
>> mkdir -p /etc/cmdline.d
>> ln -s /etc/kernel/cmdline /etc/cmdline.d/00-installkernel.conf
>>
>>
> Excellent, we both have the same idea so I'll do some user testing
> today and get it added to the HB.
>
>
>> We could even safely put that in the installkernel ebuild, but portage
>> will complain about a dead symlink if the target does not exist. We
>> could of course do it in postinst to avoid that problem.
>>
>>
> I think keeping simple in the HB is the answer for now, we can revisit
> if a need arises.
>
> Thanks again for the help
>
> immolo
>
>
> Best regards,
>> Nowa
>>
>> Best r
>>
>

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

<div dir=3D"ltr"><div>Hi,</div><div><br></div><div>Systemd-boot is now comp=
lete.</div><div><br></div><div>I&#39;m in the middle of checking GRUB on bo=
th openrc and systemd but I wonder if we should just</div><div>disable the =
check from running if=C2=A0+grub is set? Currently on OpenRC at least it lo=
oking for the=C2=A0</div><div>/etc/cmdline file and then promptly ignoring =
it as grub uses its own system.=C2=A0</div><div><br></div><div>I want to ma=
ke sure I&#39;ve grasped this one before doing the edit.</div><div><br></di=
v><div>Kind regards.</div><div><br></div><div>immolo</div></div><br><div cl=
ass=3D"gmail_quote gmail_quote_container"><div dir=3D"ltr" class=3D"gmail_a=
ttr">On Tue, 2 Dec 2025 at 12:26, Immolo &lt;<a href=3D"mailto:immoloism@go=
oglemail.com">[email protected]</a>&gt; wrote:<br></div><blockquote =
class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px sol=
id rgb(204,204,204);padding-left:1ex"><div dir=3D"ltr"><div dir=3D"ltr"><br=
></div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr"=
>On Tue, 2 Dec 2025 at 11:36, Nowa Ammerlaan &lt;<a href=3D"mailto:nowa@gen=
too.org" target=3D"_blank">[email protected]</a>&gt; wrote:<br></div><blockqu=
ote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px=
 solid rgb(204,204,204);padding-left:1ex">On 02/12/2025 11:50, Immolo wrote=
:<br>
&gt; Ah that&#39;s why we are on different pages, currently you only need o=
ne of the<br>
&gt; files to be set not both which is why my solution only includes one.<b=
r>
<br>
I did a quick test just now, and I definitely need to touch both <br>
/etc/cmdline and /etc/kernel/cmdline if <br>
INSTALLKERNEL_INITRD_GENERATOR=3Ddracut and INSTALLKERNEL_LAYOUT=3Dbls.<br>
<br></blockquote><div><br></div><div>Huh, I&#39;ll do a second test, but th=
at was not the result I saw.</div><div>Not worth worrying about beyond this=
 point though, and we&#39;ll</div><div>focus below.</div><div><br></div><bl=
ockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-lef=
t:1px solid rgb(204,204,204);padding-left:1ex">
&gt;=C2=A0 =C2=A0 =C2=A0Alternatively we could instruct the user to symlink=
 one to the<br>
&gt;=C2=A0 =C2=A0 =C2=A0other, or<br>
&gt;=C2=A0 =C2=A0 =C2=A0disable hostonly_cmdline (which is what I do on my =
systems).<br>
&gt; <br>
&gt; <br>
&gt; My thought was to get the user to symlink here so the user has one les=
s <br>
&gt; thing<br>
&gt; to worry about.<br>
<br>
Symlinking is definitely the way to go, having two config files <br>
potentially going out of sync will be a headache for the user later on.<br>
<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0 &gt; This was part of the reason why I stuck to ju=
st using SD-boot<br>
&gt;=C2=A0 =C2=A0 =C2=A0while we<br>
&gt;=C2=A0 =C2=A0 =C2=A0 &gt; discuss, as it gets real confusing when you s=
tart summarising so many<br>
&gt;=C2=A0 =C2=A0 =C2=A0 &gt; different options.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 &gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 &gt; Does this general idea sound workable to you?=
<br>
&gt;=C2=A0 =C2=A0 =C2=A0 &gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 &gt;=C2=A0 =C2=A0 =C2=A0We could patch dracut to u=
se the same file to make things less<br>
&gt;=C2=A0 =C2=A0 =C2=A0 &gt;=C2=A0 =C2=A0 =C2=A0confusing, but this would =
be a breaking change for some users.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 &gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 &gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 &gt; It&#39;s a shame we can&#39;t just symlink th=
e two files as it would make<br>
&gt;=C2=A0 =C2=A0 =C2=A0 &gt; all this so much simpler.<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0Well, we can, but we would then be potentially over=
writing existing<br>
&gt;=C2=A0 =C2=A0 =C2=A0config files with a symlink. I don&#39;t think<br>
&gt;=C2=A0 =C2=A0 =C2=A0portage+etc-update/dispatch-conf can handle that.<b=
r>
&gt; <br>
&gt; <br>
&gt; I meant presetup if I wasn&#39;t clear, the issue of course doing that=
 means<br>
&gt; the file exists and the chroot script becomes pointless.<br>
&gt; <br>
&gt; I&#39;ll do some tests on distpatch-conf=C2=A0and seeing I can break i=
t/<br>
<br>
I think the following should be safe to recommend:<br>
<br>
mkdir -p /etc/cmdline.d<br>
ln -s /etc/kernel/cmdline /etc/cmdline.d/00-installkernel.conf<br>
<br></blockquote><div><br></div><div>Excellent, we both have the same idea =
so I&#39;ll do some user testing=C2=A0</div><div>today and get it added to =
the HB.</div><div>=C2=A0</div><blockquote class=3D"gmail_quote" style=3D"ma=
rgin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:=
1ex">
We could even safely put that in the installkernel ebuild, but portage <br>
will complain about a dead symlink if the target does not exist. We <br>
could of course do it in postinst to avoid that problem.<br>
<br></blockquote><div><br></div><div>I think keeping simple in the HB is th=
e answer for now, we can revisit=C2=A0</div><div>if a need arises.</div><di=
v><br></div><div>Thanks again for the help</div><div><br></div><div>immolo<=
/div><div><br></div><div><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">
Best regards,<br>
Nowa<br>
<br>
Best r<br>
</blockquote></div></div>
</blockquote></div>

--000000000000152c2306451f39e9--