<div dir="ltr"><div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Nov 21, 2024 at 2:45 PM Lennart Poettering <<a href="mailto:lennart@poettering.net" target="_blank">lennart@poettering.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Do, 21.11.24 14:35, Itxaka Serrano Garcia (<a href="mailto:itxaka.garcia@spectrocloud.com" target="_blank">itxaka.garcia@spectrocloud.com</a>) wrote:<br>
<br>
> Hey folks,<br>
><br>
> we are currently implementing systemd-boot boot assessment on Kairos, where<br>
> we have a few entries under /loader/entries/<br>
><br>
> We made it so they start at threes tries so the config fails are for<br>
> example active+3.conf<br>
><br>
> On boot, we can see the filename renamed properly to active+2-1.conf until<br>
> the systemd-bless-boot starts, checks that the system is in complete boot<br>
> (reached boot-complete.target) and it marks it as good and renames it to<br>
> disable the boot assessment<br>
><br>
><br>
> Nov 21 13:08:10 kairos-vfog systemd[1]: Starting systemd-bless-boot.service<br>
> - Mark the Current Boot Loader Entry as Good...<br>
> Nov 21 13:08:10 kairos-vfog systemd-bless-boot[1522]: Marked boot as<br>
> 'good'. (Boot attempt counter is at 1.)<br>
> Nov 21 13:08:10 kairos-vfog systemd[1]: Finished systemd-bless-boot.service<br>
> - Mark the Current Boot Loader Entry as Good.<br>
><br>
> That's all good and dandy but now, our loader.conf is pointing to the<br>
> active+3.conf as the default key, so that wont match anymore.<br>
><br>
> Should systemd-bless-boot update the default entry in loader.conf if it<br>
> matches the current boot loader entry? Should systemd-boot ignore the boot<br>
> assessment part in the loader.conf default?<br>
><br>
> Does loader.conf accept a regex for the default entry so this can be fixed<br>
> by setting the entry to ^WHATEVER\+\d+(-\d+)?.conf$ ?<br>
<br>
See loader.conf(5). It supports globs, it's literally in the first<br>
sentence. (i.e. * and ?)<br></blockquote><div><br></div><div>Yeah I saw that but it's pretty difficult to set a glob that will work for both right? Does Not seem a use case for the boot assessment really, hence why I though some regex would make this easier (said no one ever lol)<br></div><div><br></div>root@kairos-1kfy:~# ls /efi/loader/entries/active*.*<br>/efi/loader/entries/active+2-1.conf /efi/loader/entries/active2butbroken.conf<br>/efi/loader/entries/active.conf</div><div class="gmail_quote"><br></div><div class="gmail_quote"><br><div>This matches unwanted entries. <br></div><div>The idea is to have a glob that matches both active.conf and active+2-1.conf but doesnt match activeNotReally.conf which with globs is a terrible idea.</div><div><br></div><div>I still think that the boot assessment part should be ignored by systemd-boot, so an entry should just automatically remove that part before trying to load the conf file (X+3-1.conf should be autocleaned to X.conf)<br></div><div><br></div><div><br></div><div>I'll keep trying to fix this up without having unwanted consequences, open to ideas :D<br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
That said, i think we actually should check the glob against the<br>
string where we stripped away the counters. Could you file a bug<br>
against that?</blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Lennart<br>
<br>
--<br>
Lennart Poettering, Berlin<br>
</blockquote></div></div>
</div>