• Re: [gentoo-user] Fun with systemd-boot

    From =?utf-8?Q?Arsen_Arsenovi=C4=87?=@21:1/5 to Alan Mackenzie on Wed Dec 18 14:00:01 2024
    Hi Alan,

    Alan Mackenzie <acm@muc.de> writes:

    Hello, Gentoo.

    I've been having fun with systemd-boot.

    On my new (2024-08) machine, on Friday 2024-12-06, I suddenly noticed
    that my /boot partition was empty, I can't remember why I looked at it.
    I am quite sure I didn't empty it myself. There then followed a couple
    of hours where I restored the boot manager, kernels, and the boot configuration. Thankfully, it booted again the next time I tried.

    On my old machine, I've been noticing over the past weeks that only two
    older kernels have been offered for booting, despite me installing later kernels to /boot/EFI/gentoo, and configuring them in /boot/loader.

    You don't need to do that manually, installkernel should handle it for
    you. You should get installkernel[systemd,systemd-boot].

    It all became clear yesterday and today. bootctl install had
    installed itself to /dev/nvme1n1p1 rather than /boot (which I have
    mounted on /dev/nvme0n1p1).

    This would mean you mounted /dev/nvme1n1p1 on /efi:

    --esp-path=
    Path to the EFI System Partition (ESP). If not specified,
    /efi/, /boot/, and /boot/efi/ are checked in turn. It is
    recommended to mount the ESP to /efi/, if possible.

    You should have one ESP mounted at any time, and mounted at /efi. The
    rest should work fine.

    Both of these partitions are EFI system partitions. It also clogged
    up my UEFI boot sequence with lots of extra entries, leaving nvme1
    rather than nvme0 the prime EFI system partition for booting with.

    UEFI boot order entries are only created as part of 'bootctl install' so
    this would mean you ran it many times. It only needs to be ran once.
    To update the bootloader, you'd use 'bootctl update', to add/remove
    entries you'd use kernel-install.

    I've had a look at the manual page for bootctrl. It doesn't mention any
    way of specifying which EFI partition will get written to, and doesn't
    seem to mention that it changes the UEFI BIOS settings. Or maybe it
    does. It's a vague, poor quality manual.

    That'd be --esp-path.

    WRT changing UEFI settings, this is a necessity for UEFI boot -
    grub-install does the same thing.

    I don't need all this. Booting should not be fun. It should be boring, boring, boring. Boring and dependable.

    Could somebody perhaps suggest a better boot loader to me? I need to be
    able to chose between several kernels at booting time, but I certainly
    don't want something "refined" like grub - I just need what I thought systemd-boot actually was before yesterday.

    I suspect your problem lies elsewhere. What partitions are you
    mounting? How are you installing kernels?

    Have a lovely day!
    --
    Arsen Arsenović

    --=-=-Content-Type: application/pgp-signature; name="signature.asc"

    -----BEGIN PGP SIGNATURE-----

    iOcEARYKAI8WIQT+4rPRE/wAoxYtYGFSwpQwHqLEkwUCZ2LFAV8UgAAAAAAuAChp c3N1ZXItZnByQG5vdGF0aW9ucy5vcGVucGdwLmZpZnRoaG9yc2VtYW4ubmV0RkVF MkIzRDExM0ZDMDBBMzE2MkQ2MDYxNTJDMjk0MzAxRUEyQzQ5MxEcYXJzZW5AZ2Vu dG9vLm9yZwAKCRBSwpQwHqLEkzKVAP9lT8R6RkQPT6Y2E/nfi2dxxFCcAinqhZwB /Y+0gFrcHQD/eH+n+5GoB2l8mqrj+2MGrWXt//77c/z2a4Wh9nwwgAM=msBK
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Alan Mackenzie@21:1/5 to All on Wed Dec 18 13:20:01 2024
    Hello, Gentoo.

    I've been having fun with systemd-boot.

    On my new (2024-08) machine, on Friday 2024-12-06, I suddenly noticed
    that my /boot partition was empty, I can't remember why I looked at it.
    I am quite sure I didn't empty it myself. There then followed a couple
    of hours where I restored the boot manager, kernels, and the boot configuration. Thankfully, it booted again the next time I tried.

    On my old machine, I've been noticing over the past weeks that only two
    older kernels have been offered for booting, despite me installing later kernels to /boot/EFI/gentoo, and configuring them in /boot/loader.

    It all became clear yesterday and today. bootctl install had installed
    itself to /dev/nvme1n1p1 rather than /boot (which I have mounted on /dev/nvme0n1p1). Both of these partitions are EFI system partitions. It
    also clogged up my UEFI boot sequence with lots of extra entries, leaving
    nvme1 rather than nvme0 the prime EFI system partition for booting with.

    I've had a look at the manual page for bootctrl. It doesn't mention any
    way of specifying which EFI partition will get written to, and doesn't
    seem to mention that it changes the UEFI BIOS settings. Or maybe it
    does. It's a vague, poor quality manual.

    I don't need all this. Booting should not be fun. It should be boring, boring, boring. Boring and dependable.

    Could somebody perhaps suggest a better boot loader to me? I need to be
    able to chose between several kernels at booting time, but I certainly
    don't want something "refined" like grub - I just need what I thought systemd-boot actually was before yesterday.

    Thanks in advance!

    --
    Alan Mackenzie (Nuremberg, Germany).

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Joost Roeleveld@21:1/5 to All on Wed Dec 18 14:10:02 2024
    This message is in MIME format.

    ----_com.ninefolders.hd3.email_104099846169693_alt
    Content-Type: text/plain; charset=utf-8

    Sorry for the top post. (Need to fix this mobile app)

    I have been using "refind" for my desktops and laptops. It works perfectly and even makes dualboot with non Linux simple.

    Sent from Nine

    ________________________________
    From: Alan Mackenzie [acm@muc.de]
    Sent: Wednesday, 18 December 2024 13:13
    To: [gentoo-user@lists.gentoo.org]
    Subject: [gentoo-user] Fun with systemd-boot

    Hello, Gentoo.

    I've been having fun with systemd-boot.

    On my new (2024-08) machine, on Friday 2024-12-06, I suddenly noticed
    that my /boot partition was empty, I can't remember why I looked at it.
    I am quite sure I didn't empty it myself. There then followed a couple
    of hours where I restored the boot manager, kernels, and the boot configuration. Thankfully, it booted again the next time I tried.

    On my old machine, I've been noticing over the past weeks that only two
    older kernels have been offered for booting, despite me installing later kernels to /boot/EFI/gentoo, and configuring them in /boot/loader.

    It all became clear yesterday and today. bootctl install had installed
    itself to /dev/nvme1n1p1 rather than /boot (which I have mounted on /dev/nvme0n1p1). Both of these partitions are EFI system partitions. It
    also clogged up my UEFI boot sequence with lots of extra entries, leaving
    nvme1 rather than nvme0 the prime EFI system partition for booting with.

    I've had a look at the manual page for bootctrl. It doesn't mention any
    way of specifying which EFI partition will get written to, and doesn't
    seem to mention that it changes the UEFI BIOS settings. Or maybe it
    does. It's a vague, poor quality manual.

    I don't need all this. Booting should not be fun. It should be boring,
    boring, boring. Boring and dependable.

    Could somebody perhaps suggest a better boot loader to me? I need to be
    able to chose between several kernels at booting time, but I certainly
    don't want something "refined" like grub - I just need what I thought systemd-boot actually was before yesterday.

    Thanks in advance!

    --
    Alan Mackenzie (Nuremberg, Germany).




    ----_com.ninefolders.hd3.email_104099846169693_alt
    Content-Type: text/html; charset=utf-8
    Content-Transfer-Encoding: quoted-printable

    <html><body><div id="nine_body_n193d9d-63df9" class="nine_body mceEditable" dir="auto" style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12.0pt; line-height: 1.3; color: #1f497d;"><div class="nine-pg" dir="auto">Sorry for the top post.
    (Need to fix this mobile app)</div><div class="nine-pg" dir="auto"><br /></div><div class="nine-pg" dir="auto">I have been using "refind" for my desktops and laptops. It works perfectly and even makes dualboot with non Linux simple.</div><div class="
    nine-pg blank sign" dir="auto"><br /></div><div id="nine-sign-n193d9d-63df9" class="nine_signature" dir="auto"><div class="nine-pg" dir="auto">Sent from <a style="text-decoration: none; color: #009bdf;" href="http://www.9folders.com/">Nine</a></div></div>
    <div class="nine-pg blank msg" dir="auto"><br /></div></div><div id="quoted_header_n193d9d-63df9" class="quoted_header_editor" dir="auto"><hr style="border: none; height: 1px; color: #e1e1e1; background-color: #e1e1e1;" /><div dir="auto" style="border:
    none; padding: 3.0pt 0cm 0cm 0cm;"><span style="font-size: 11.0pt; font-family: Calibri, Arial, Helvetica, sans-serif;"><b>From:</b> Alan Mackenzie [acm@muc.de]<br /><b>Sent:</b> Wednesday, 18 December 2024 13:13<br /><b>To:</b> [gentoo-user@lists.gentoo.
    org]<br /><b>Subject:</b> [gentoo-user] Fun with systemd-boot<br /></span></div></div><div id="quoted_body_n193d9d-63df9" class="quoted_body_editor mceEditable" dir="auto"><div class="nine-pg" dir="auto"><br type="attribution" /></div><div class="nine-pg"
    dir="auto"><div class="nine-pg" dir="auto">Hello, Gentoo.</div><div class="nine-pg" dir="auto"><br /></div><div class="nine-pg" dir="auto">I've been having fun with systemd-boot.</div><div class="nine-pg" dir="auto"><br /></div><div class="nine-pg" dir="
    auto">On my new (2024-08) machine, on Friday 2024-12-06, I suddenly noticed</div><div class="nine-pg" dir="auto">that my /boot partition was empty, I can't remember why I looked at it.</div><div class="nine-pg" dir="auto">I am quite sure I didn't empty
    it myself. There then followed a couple</div><div class="nine-pg" dir="auto">of hours where I restored the boot manager, kernels, and the boot</div><div class="nine-pg" dir="auto">configuration. Thankfully, it booted again the next time I tried.</div><
    div class="nine-pg" dir="auto"><br /></div><div class="nine-pg" dir="auto">On my old machine, I've been noticing over the past weeks that only two</div><div class="nine-pg" dir="auto">older kernels have been offered for booting, despite me installing
    later</div><div class="nine-pg" dir="auto">kernels to /boot/EFI/gentoo, and configuring them in /boot/loader.</div><div class="nine-pg" dir="auto"><br /></div><div class="nine-pg" dir="auto">It all became clear yesterday and today. bootctl install had
    installed</div><div class="nine-pg" dir="auto">itself to /dev/nvme1n1p1 rather than /boot (which I have mounted on</div><div class="nine-pg" dir="auto">/dev/nvme0n1p1). Both of these partitions are EFI system partitions. It</div><div class="nine-pg"
    dir="auto">also clogged up my UEFI boot sequence with lots of extra entries, leaving</div><div class="nine-pg" dir="auto">nvme1 rather than nvme0 the prime EFI system partition for booting with.</div><div class="nine-pg" dir="auto"><br /></div><div class=
    "nine-pg" dir="auto">I've had a look at the manual page for bootctrl. It doesn't mention any</div><div class="nine-pg" dir="auto">way of specifying which EFI partition will get written to, and doesn't</div><div class="nine-pg" dir="auto">seem to mention
    that it changes the UEFI BIOS settings. Or maybe it</div><div class="nine-pg" dir="auto">does. It's a vague, poor quality manual.</div><div class="nine-pg" dir="auto"><br /></div><div class="nine-pg" dir="auto">I don't need all this. Booting should
    not be fun. It should be boring,</div><div class="nine-pg" dir="auto">boring, boring. Boring and dependable.</div><div class="nine-pg" dir="auto"><br /></div><div class="nine-pg" dir="auto">Could somebody perhaps suggest a better boot loader to me? I
    need to be</div><div class="nine-pg" dir="auto">able to chose between several kernels at booting time, but I certainly</div><div class="nine-pg" dir="auto">don't want something "refined" like grub - I just need what I thought</div><div class="nine-pg"
    dir="auto">systemd-boot actually was before yesterday.</div><div class="nine-pg" dir="auto"><br /></div><div class="nine-pg" dir="auto">Thanks in advance!</div><div class="nine-pg" dir="auto"><br /></div><div class="nine-pg" dir="auto">-- </div><div
    class="nine-pg" dir="auto">Alan Mackenzie (Nuremberg, Germany).</div><div class="nine-pg" dir="auto"><br /></div></div></div></body></html>&nbsp;<br>
    ----_com.ninefolders.hd3.email_104099846169693_alt--

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Alan Mackenzie@21:1/5 to All on Wed Dec 18 14:50:01 2024
    Hello, Arsen.

    On Wed, Dec 18, 2024 at 13:50:09 +0100, Arsen Arsenović wrote:
    Hi Alan,

    Alan Mackenzie <acm@muc.de> writes:

    Hello, Gentoo.

    I've been having fun with systemd-boot.

    On my new (2024-08) machine, on Friday 2024-12-06, I suddenly noticed
    that my /boot partition was empty, I can't remember why I looked at it.
    I am quite sure I didn't empty it myself. There then followed a couple
    of hours where I restored the boot manager, kernels, and the boot configuration. Thankfully, it booted again the next time I tried.

    On my old machine, I've been noticing over the past weeks that only two older kernels have been offered for booting, despite me installing later kernels to /boot/EFI/gentoo, and configuring them in /boot/loader.

    You don't need to do that manually, installkernel should handle it for
    you. You should get installkernel[systemd,systemd-boot].

    No, I don't need to learn a new abstruse command (which might do anything
    apart from its prime function) when cp works 100%.

    It all became clear yesterday and today. bootctl install had
    installed itself to /dev/nvme1n1p1 rather than /boot (which I have
    mounted on /dev/nvme0n1p1).

    This would mean you mounted /dev/nvme1n1p1 on /efi:

    --esp-path=
    Path to the EFI System Partition (ESP). If not specified,
    /efi/, /boot/, and /boot/efi/ are checked in turn. It is
    recommended to mount the ESP to /efi/, if possible.

    I have never knowingly mounted anything on /efi. Even if it was by
    accident, somehow, I certainly wouldn't have done it on both my old and
    new machines. And why the partition on nvme1?

    You should have one ESP mounted at any time, and mounted at /efi. The
    rest should work fine.

    I've got /dev/nvme0n1p1 mounted on /boot. That should work.

    Both of these partitions are EFI system partitions. It also clogged
    up my UEFI boot sequence with lots of extra entries, leaving nvme1
    rather than nvme0 the prime EFI system partition for booting with.

    UEFI boot order entries are only created as part of 'bootctl install' so
    this would mean you ran it many times.

    That's possible, though I don't remember now.

    It only needs to be ran once. To update the bootloader, you'd use
    'bootctl update', to add/remove entries you'd use kernel-install.

    I've had a look at the manual page for bootctrl. It doesn't mention any way of specifying which EFI partition will get written to, and doesn't
    seem to mention that it changes the UEFI BIOS settings. Or maybe it
    does. It's a vague, poor quality manual.

    That'd be --esp-path.

    Thanks! Though just /boot should work.

    WRT changing UEFI settings, this is a necessity for UEFI boot -
    grub-install does the same thing.

    I've always set the boot devices in the BIOS settings - including an
    entry for my DVD device, enabling me to install Gentoo. :-)

    I don't need all this. Booting should not be fun. It should be boring, boring, boring. Boring and dependable.

    Could somebody perhaps suggest a better boot loader to me? I need to be able to chose between several kernels at booting time, but I certainly don't want something "refined" like grub - I just need what I thought systemd-boot actually was before yesterday.

    I suspect your problem lies elsewhere. What partitions are you
    mounting? How are you installing kernels?

    I mount an EFI partition on /boot, along with several LVM partitions on /
    and subdirectories. I install kernels with cp from /usr/src/linux-x.y.z-gentoo/arch/x86/boot/bzImage to /boot/EFI/gentoo/,
    with a suitable new name. Then I add a new configuration file for the
    new kernel in /boot/loader/Entries.

    Have a lovely day!

    Thanks!

    --
    Arsen Arsenović

    --
    Alan Mackenzie (Nuremberg, Germany).

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Peter Humphrey@21:1/5 to All on Wed Dec 18 15:40:01 2024
    On Wednesday 18 December 2024 12:13:59 GMT Alan Mackenzie wrote:

    I've been having fun with systemd-boot.

    I've been using bootctl from systemd-utils for some years; ever since I graduated to an EFI system. I don't follow the wiki because of the resulting impenetrable thicket of unpronounceable names and 32-digit hex numbers. Fine for a distro builder, perhaps, but not for me thank you - especially as I want a selection of kernels to boot from, which I never did work out how to achieve following the official advice.

    My method has only one related USE variable:
    sys-apps/systemd-utils boot kernel-install

    My EFI partition, unformatted and not mentioned in /etc/fstab, is /dev/ nvme0n1p1. 0n1p2 is the FAT-32 /boot.
    # tree -L 3 /boot
    /boot
    ├── [config files from make install]
    ├── early_ucode.cpio
    ├── EFI
    │ ├── BOOT
    │ │ └── BOOTX64.EFI
    │ ├── Linux
    │ └── systemd
    │ └── systemd-bootx64.efi
    ├── intel-uc.img
    ├── loader
    │ ├── entries
    │ │ ├── 06-gentoo-rescue-6.6.52.conf
    │ │ ├── 07-gentoo-rescue-6.6.52.nonet.conf
    │ │ ├── 08-gentoo-rescue-6.6.62.conf
    │ │ ├── 09-gentoo-rescue-6.6.62.nonet.conf
    │ │ ├── 30-gentoo-6.6.62.conf
    │ │ ├── 32-gentoo-6.6.62.nox.conf
    │ │ └── 34-gentoo-6.6.62.nonet.conf
    │ ├── entries.srel
    │ ├── loader.conf
    │ └── random-seed
    ├── [System.map files from make install]
    ├── vmlinuz-6.6.38-gentoo-rescue
    ├── vmlinuz-6.6.52-gentoo
    ├── vmlinuz-6.6.52-gentoo-rescue
    ├── vmlinuz-6.6.62-gentoo
    └── vmlinuz-6.6.62-gentoo-rescue

    This is the relevant parts of the kernel make script on my little i5 NUC box: cd /usr/src/linux
    time (make -j4 && make modules_install &&\
    make install && rm -f /boot/*old)
    emerge @module-rebuild @x11-module-rebuild
    rm -f /boot/early_ucode.cpio.new &&\
    iucode_tool -q -S --write-earlyfw=/boot/early_ucode.cpio.new \
    -tr /boot/early_ucode.cpio -tb /lib/firmware/intel-ucode &&\
    mv -v /boot/early_ucode.cpio.new /boot/early_ucode.cpio &&\
    echo

    Then all I have to do is some simple mmv and sed -i on the files in /boot/ loader/entries and loader.conf. Also remove obsolete kernels, configs and maps from /boot. Oh, and bootctl set-default 30-gentoo-6.6.62.conf if it's a remote machine and I won't be present at boot time.

    8

    Could somebody perhaps suggest a better boot loader to me? I need to be
    able to chose between several kernels at booting time, but I certainly
    don't want something "refined" like grub - I just need what I thought systemd-boot actually was before yesterday.

    That's even worse than what I was suffering until I developed my own system.

    Thanks in advance!

    Hope that helps.

    --
    Regards,
    Peter.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Joost Roeleveld@21:1/5 to All on Wed Dec 18 15:20:01 2024
    ----------------------- Original message -----------------------
    From: Alan Mackenzie <acm@muc.de>
    To: gentoo-user@lists.gentoo.org
    Date: Wed, 18 Dec 2024 14:41:00 +0100 ----------------------------------------------------------------

    Hello, Arsen.

    On Wed, Dec 18, 2024 at 13:50:09 +0100, Arsen Arsenović wrote:
    Hi Alan,

    Alan Mackenzie <acm@muc.de> writes:

    Hello, Gentoo.

    I've been having fun with systemd-boot.

    On my new (2024-08) machine, on Friday 2024-12-06, I suddenly noticed
    that my /boot partition was empty, I can't remember why I looked at it.
    I am quite sure I didn't empty it myself. There then followed a couple
    of hours where I restored the boot manager, kernels, and the boot
    configuration. Thankfully, it booted again the next time I tried.

    On my old machine, I've been noticing over the past weeks that only two
    older kernels have been offered for booting, despite me installing later >> > kernels to /boot/EFI/gentoo, and configuring them in /boot/loader.

    You don't need to do that manually, installkernel should handle it for
    you. You should get installkernel[systemd,systemd-boot].

    No, I don't need to learn a new abstruse command (which might do anything apart from its prime function) when cp works 100%.

    It all became clear yesterday and today. bootctl install had
    installed itself to /dev/nvme1n1p1 rather than /boot (which I have
    mounted on /dev/nvme0n1p1).

    This would mean you mounted /dev/nvme1n1p1 on /efi:

    --esp-path=
    Path to the EFI System Partition (ESP). If not specified,
    /efi/, /boot/, and /boot/efi/ are checked in turn. It is
    recommended to mount the ESP to /efi/, if possible.

    I have never knowingly mounted anything on /efi. Even if it was by
    accident, somehow, I certainly wouldn't have done it on both my old and
    new machines. And why the partition on nvme1?

    You should have one ESP mounted at any time, and mounted at /efi. The
    rest should work fine.

    I've got /dev/nvme0n1p1 mounted on /boot. That should work.

    Both of these partitions are EFI system partitions. It also clogged
    up my UEFI boot sequence with lots of extra entries, leaving nvme1
    rather than nvme0 the prime EFI system partition for booting with.

    UEFI boot order entries are only created as part of 'bootctl install' so
    this would mean you ran it many times.

    That's possible, though I don't remember now.

    It only needs to be ran once. To update the bootloader, you'd use
    'bootctl update', to add/remove entries you'd use kernel-install.

    I've had a look at the manual page for bootctrl. It doesn't mention any
    way of specifying which EFI partition will get written to, and doesn't
    seem to mention that it changes the UEFI BIOS settings. Or maybe it
    does. It's a vague, poor quality manual.

    That'd be --esp-path.

    Thanks! Though just /boot should work.

    WRT changing UEFI settings, this is a necessity for UEFI boot -
    grub-install does the same thing.

    I've always set the boot devices in the BIOS settings - including an
    entry for my DVD device, enabling me to install Gentoo. :-)

    I don't need all this. Booting should not be fun. It should be boring,
    boring, boring. Boring and dependable.

    Could somebody perhaps suggest a better boot loader to me? I need to be
    able to chose between several kernels at booting time, but I certainly
    don't want something "refined" like grub - I just need what I thought
    systemd-boot actually was before yesterday.

    I suspect your problem lies elsewhere. What partitions are you
    mounting? How are you installing kernels?

    I mount an EFI partition on /boot, along with several LVM partitions on /
    and subdirectories. I install kernels with cp from /usr/src/linux-x.y.z-gentoo/arch/x86/boot/bzImage to /boot/EFI/gentoo/,
    with a suitable new name. Then I add a new configuration file for the
    new kernel in /boot/loader/Entries.

    For sys-boot/refind:

    # ls /boot/EFI/Gentoo/
    gentoo_6_6_62.efi

    I include the initramfs and commandline into the kernel image.
    But you can specify initrd seperately if needed by adding extra menu-entries.

    --
    Joost

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael@21:1/5 to All on Wed Dec 18 15:58:14 2024
    On Wednesday 18 December 2024 14:30:12 GMT Peter Humphrey wrote:
    On Wednesday 18 December 2024 12:13:59 GMT Alan Mackenzie wrote:
    I've been having fun with systemd-boot.

    I've been using bootctl from systemd-utils for some years; ever since I graduated to an EFI system. I don't follow the wiki because of the resulting impenetrable thicket of unpronounceable names and 32-digit hex numbers.
    Fine for a distro builder, perhaps, but not for me thank you - especially
    as I want a selection of kernels to boot from, which I never did work out
    how to achieve following the official advice.

    My method has only one related USE variable:
    sys-apps/systemd-utils boot kernel-install

    My EFI partition, unformatted and not mentioned in /etc/fstab, is /dev/ nvme0n1p1. 0n1p2 is the FAT-32 /boot.
    # tree -L 3 /boot
    /boot
    ├── [config files from make install]
    ├── early_ucode.cpio
    ├── EFI
    │ ├── BOOT
    │ │ └── BOOTX64.EFI
    │ ├── Linux
    │ └── systemd
    │ └── systemd-bootx64.efi
    ├── intel-uc.img
    ├── loader
    │ ├── entries
    │ │ ├── 06-gentoo-rescue-6.6.52.conf
    │ │ ├── 07-gentoo-rescue-6.6.52.nonet.conf
    │ │ ├── 08-gentoo-rescue-6.6.62.conf
    │ │ ├── 09-gentoo-rescue-6.6.62.nonet.conf
    │ │ ├── 30-gentoo-6.6.62.conf
    │ │ ├── 32-gentoo-6.6.62.nox.conf
    │ │ └── 34-gentoo-6.6.62.nonet.conf
    │ ├── entries.srel
    │ ├── loader.conf
    │ └── random-seed
    ├── [System.map files from make install]
    ├── vmlinuz-6.6.38-gentoo-rescue
    ├── vmlinuz-6.6.52-gentoo
    ├── vmlinuz-6.6.52-gentoo-rescue
    ├── vmlinuz-6.6.62-gentoo
    └── vmlinuz-6.6.62-gentoo-rescue

    This is the relevant parts of the kernel make script on my little i5 NUC
    box: cd /usr/src/linux
    time (make -j4 && make modules_install &&\
    make install && rm -f /boot/*old)
    emerge @module-rebuild @x11-module-rebuild
    rm -f /boot/early_ucode.cpio.new &&\
    iucode_tool -q -S --write-earlyfw=/boot/early_ucode.cpio.new \
    -tr /boot/early_ucode.cpio -tb /lib/firmware/intel-ucode &&\
    mv -v /boot/early_ucode.cpio.new /boot/early_ucode.cpio &&\
    echo

    Not relevant to the OP, but why don't you build the µcode blob in the kernel itself for a simpler life?


    Then all I have to do is some simple mmv and sed -i on the files in /boot/ loader/entries and loader.conf. Also remove obsolete kernels, configs and maps from /boot. Oh, and bootctl set-default 30-gentoo-6.6.62.conf if it's
    a remote machine and I won't be present at boot time.

    8

    Could somebody perhaps suggest a better boot loader to me? I need to be able to chose between several kernels at booting time, but I certainly don't want something "refined" like grub - I just need what I thought systemd-boot actually was before yesterday.

    That's even worse than what I was suffering until I developed my own system.
    Thanks in advance!

    Hope that helps.

    If the OP is running a systemd installation then using an ESP FAT32 formatted partition on /efi mountpoint and a XBOOTLDR partition at /boot mountpoint would greatly simplify things and avoid conflicts between what the systemd bootctl expects to find and wants to do and what the user prefers:

    https://wiki.gentoo.org/wiki/EFI_System_Partition#Standard_layout

    On an OpenRC system without GRUB, rEFInd is a good choice, or for a totally manual approach use the efibootmgr:

    https://wiki.gentoo.org/wiki/Efibootmgr

    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCAAdFiEEXqhvaVh2ERicA8Ceseqq9sKVZxkFAmdi8RYACgkQseqq9sKV ZxmXMg//W4ekNe7Gp7aT1itMMCaTXUb+WjLf0vtUrdPbmpHogurP1+HYhqQOEr+1 0ToGlBtVQn1mhMGImsAOPCZjx+i6qVapcyubSoHNv03qVsogmyKpGIwj0OhIdJ7q 5Vx6Cfvak9WZlhqnKHYyaiq9dHuPC7xofqAbv8jRvR2/h7ps9ez4FhiYwB4znBhu xBsLb+W7Zu5+mZb/NX2LzP7krgX5G3APEZpW8e/Hm3sE2N11lqTnhrUXpAybB9LF c6u3IKG3ZqdF+Z18LZghZ9drfy8bg6VUrYuklc1zWr4WQtk4C5LrnF2no0hLWZYP Z1RQ8JplGEAzFr/wZPja0J4v6FMKJi97YzeVRvmrhdO3wEIAV3JveoSH/b7h1jT5 Ckp+IHxWKAJzCm0SmCavXZKbg9v6IAF+/M4NNv5dFOxILJZX3qRxKg0iEbJGv8Z/ +m11baG3RmMeX2ZtawUrwa25xQ8TMPD1wK9XdvpZ1W75COu+tWgk/BQsfGQjQ+cF nS73NICzg2mW3MXzNYHJk4zrZgzypwBuc/lSXbvliI93U+y4/57nZ8cmCw+yG3Pl YYJzWGVYGr0+8nbreTTjDo/11Ka84Y+Fvw8kCYX/YLvpEHlyZp3K4EzlhQbFp7mH XyObgnKeVusJu0Qrexgl8dZoM9qdSdwVUE6jXYBjMRJzl6jVDS0=
    =lbzW
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Alan Mackenzie@21:1/5 to Michael on Wed Dec 18 22:40:02 2024
    Hello, Michael.

    Thanks for the reply.

    On Wed, Dec 18, 2024 at 15:58:14 +0000, Michael wrote:
    On Wednesday 18 December 2024 14:30:12 GMT Peter Humphrey wrote:
    On Wednesday 18 December 2024 12:13:59 GMT Alan Mackenzie wrote:
    I've been having fun with systemd-boot.

    [ .... ]

    Could somebody perhaps suggest a better boot loader to me? I need to be able to chose between several kernels at booting time, but I certainly don't want something "refined" like grub - I just need what I thought systemd-boot actually was before yesterday.

    That's even worse than what I was suffering until I developed my own system.
    Thanks in advance!

    Hope that helps.

    If the OP is running a systemd installation then using an ESP FAT32 formatted partition on /efi mountpoint and a XBOOTLDR partition at /boot mountpoint would greatly simplify things and avoid conflicts between what the systemd bootctl expects to find and wants to do and what the user prefers:

    https://wiki.gentoo.org/wiki/EFI_System_Partition#Standard_layout

    I'm on openRC.

    On an OpenRC system without GRUB, rEFInd is a good choice, or for a totally manual approach use the efibootmgr:

    https://wiki.gentoo.org/wiki/Efibootmgr

    I got efibootmgr installed on one of my machines. Somebody (tm) should
    tell the maintainers that "File or directory not found" is an incomplete
    error message. It cost me around an hour till I figured out it was
    trying to access files on /dev/sda1 (which I don't have).

    Also, none of the documentation was explicit in saying that with
    efibootmgr, you have to go into the BIOS setup to select the kernel you
    want to boot. Nothing wrong with that, but if I'd know first, I wouldn't
    have bothered getting it working. (Sorry, it's been a strenuous
    evening.)

    rEFInd doesn't feel right, somehow. It seems to involve a graphics
    screen, and configuring icons in a config file. I just want want to get
    the system booted, with a choice of kernels at boot time, and not have
    all the overhead of graphics and "flexibility".

    I thought systemd-boot was OK, until it starting emptying my /boot
    partition, and booting from a partition other than the one I'd told it
    to. Don't we just love software which is clever?

    <Sigh>. It looks like I'm going to have to make some compromises,
    somewhere. It's a pity lilo isn't still going.

    --
    Alan Mackenzie (Nuremberg, Germany).

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael@21:1/5 to All on Thu Dec 19 10:59:54 2024
    On Wednesday 18 December 2024 21:31:42 GMT Alan Mackenzie wrote:
    Hello, Michael.

    Thanks for the reply.

    On Wed, Dec 18, 2024 at 15:58:14 +0000, Michael wrote:

    On an OpenRC system without GRUB, rEFInd is a good choice, or for a
    totally
    manual approach use the efibootmgr:

    https://wiki.gentoo.org/wiki/Efibootmgr

    I got efibootmgr installed on one of my machines. Somebody (tm) should
    tell the maintainers that "File or directory not found" is an incomplete error message. It cost me around an hour till I figured out it was
    trying to access files on /dev/sda1 (which I don't have).

    When you run efibootmgr with no options it accesses the UEFI BIOS menu stored on the MoBo's EEPROM and displays its entries in the terminal. It does not access the disk. When you create an entry it will verify the fs path and kernel image you are adding on the boot menu actually exists on the fs - in this case it will try to read the contents of the FAT32 fs on the disk, but should only access the disk and partition you tell it to access when creating EFI boot menu entries, e.g.:

    efibootmgr --create --disk /dev/sda --part 1 ...
    efibootmgr --create --disk /dev/nvme0n1 --part 3 ...

    It is just a CLI tool to interact with the UEFI firmware API. It is the UEFI firmware itself which is probing block devices, reading and writing on its EEPROM.

    You'll have to copy your own kernel images on the FAT32 /efi or /boot partition, or use 'make install'.


    Also, none of the documentation was explicit in saying that with
    efibootmgr, you have to go into the BIOS setup to select the kernel you
    want to boot. Nothing wrong with that, but if I'd know first, I wouldn't have bothered getting it working. (Sorry, it's been a strenuous
    evening.)

    Yes, you can enter the MoBos BIOS menu, if you prefer to, or you can specify/ edit your own preferred order of the UEFI boot menu entries:

    --bootorder 5,2,4

    or you can select which menu entry to boot next into before you reboot:

    --bootnext 00005


    rEFInd doesn't feel right, somehow. It seems to involve a graphics
    screen, and configuring icons in a config file. I just want want to get
    the system booted, with a choice of kernels at boot time, and not have
    all the overhead of graphics and "flexibility".

    I thought systemd-boot was OK, until it starting emptying my /boot
    partition, and booting from a partition other than the one I'd told it
    to. Don't we just love software which is clever?

    <Sigh>. It looks like I'm going to have to make some compromises,
    somewhere. It's a pity lilo isn't still going.

    There is sys-boot/elilo available for UEFI systems, but it hasn't been touched for more than 10 years. I've never tried it, but this doesn't mean it won't work as is.

    There's also syslinux, but you'll need to use efibootmgr (once) to let the
    UEFI firmware know about the syslinux image.
    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCAAdFiEEXqhvaVh2ERicA8Ceseqq9sKVZxkFAmdj/KoACgkQseqq9sKV Zxnq6BAA547eOwF4nRrigkBqt0v3dCZFLod45JajH8szqwBdVb20tRizshk4pBG/ odhvLLXjFi7uN6jnyS1AHn5vxtzMSFNauKVNPIaM7091frPXplVGXRsPcvEP3/DZ LbJio0XNVCH6D8ivuas4N4Ovf9h4sIXFJlfpd1zKvSHtLx2MFfMhDmqLGJ041H4N ArYzzvg4ILjeOR1UB2Y0H/DrjlEKKXMC07OuzTJcPQzp7bYJTtxGZ8NzMnB18wDI 8JFHiTxPjHMrsCOxWEQ39b3rc5nicLgzxSu+PkUXWQFt3mg+sXJSQdJtG03G8lcN EcTiyqFiwCvjuda9n7SRPH1ghE2w7Y1SUeOaDp7lxenmTtr/mMIneiuMDyx4ZEeu EbC5pdi4sfI+D74mJ4P7tzpkxhlra3vViSmgIrm7t0c02s35oQw6+hT52lgMIgRs hsoUFzyrh2jKchWe438IDvS3XyYlDA/1RLgiy0BjTPDvzdQKcFfV+sT9vB1BVgCJ vlrT+S+uMaiRPWeNIZkEaxYtJozr295+dJ9gx7tPTIuAcboRTIJOACH5t/0qMPRF o2gUwXsW75QEzOtiU2+q6RNqJeSE6gjM6wIRT2dxOjAvwP4Y5IRJwRQI5Vyl2Uf1 7Ax45kH7JvOZodREKf3J311ByMWswugkDcz/IEMVFWjCFjWmfgQ=
    =c9jr
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Peter Humphrey@21:1/5 to All on Thu Dec 19 12:40:01 2024
    On Wednesday 18 December 2024 15:58:14 GMT Michael wrote:
    On Wednesday 18 December 2024 14:30:12 GMT Peter Humphrey wrote:

    This is the relevant parts of the kernel make script on my little i5 NUC

    Not relevant to the OP, but why don't you build the µcode blob in the kernel itself for a simpler life?

    Well spotted.

    In fact I do that. I think the extra stuff in that script I showed must have resulted from an old system. I've now removed it.

    --
    Regards,
    Peter.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Alan Mackenzie@21:1/5 to Michael on Thu Dec 19 16:50:02 2024
    Hello, Michael.

    On Thu, Dec 19, 2024 at 10:59:54 +0000, Michael wrote:
    On Wednesday 18 December 2024 21:31:42 GMT Alan Mackenzie wrote:
    On Wed, Dec 18, 2024 at 15:58:14 +0000, Michael wrote:

    On an OpenRC system without GRUB, rEFInd is a good choice, or for a totally manual approach use the efibootmgr:

    https://wiki.gentoo.org/wiki/Efibootmgr

    I got efibootmgr installed on one of my machines. Somebody (tm) should tell the maintainers that "File or directory not found" is an incomplete error message. It cost me around an hour till I figured out it was
    trying to access files on /dev/sda1 (which I don't have).

    When you run efibootmgr with no options it accesses the UEFI BIOS menu stored on the MoBo's EEPROM and displays its entries in the terminal. It does not access the disk. When you create an entry it will verify the fs path and kernel image you are adding on the boot menu actually exists on the fs - in this case it will try to read the contents of the FAT32 fs on the disk, but should only access the disk and partition you tell it to access when creating EFI boot menu entries, e.g.:

    efibootmgr --create --disk /dev/sda --part 1 ...
    efibootmgr --create --disk /dev/nvme0n1 --part 3 ...

    It is just a CLI tool to interact with the UEFI firmware API. It is the UEFI firmware itself which is probing block devices, reading and writing on its EEPROM.

    OK, I'm flogging a dead horse here, but the correct error message would
    have been along the lines:

    File or directory not found: /dev/sda1/EFI/whatever.

    The name of the file it couldn't find would have alerted me immediately
    to the error in my command line.

    You'll have to copy your own kernel images on the FAT32 /efi or /boot partition, or use 'make install'.

    Yes, understood.

    Also, none of the documentation was explicit in saying that with efibootmgr, you have to go into the BIOS setup to select the kernel you want to boot. Nothing wrong with that, but if I'd know first, I wouldn't have bothered getting it working. (Sorry, it's been a strenuous
    evening.)

    Yes, you can enter the MoBos BIOS menu, if you prefer to, or you can
    specify/ edit your own preferred order of the UEFI boot menu entries:

    --bootorder 5,2,4

    or you can select which menu entry to boot next into before you reboot:

    --bootnext 00005

    Yes, I've got that, thanks. That means deciding which kernel to boot
    next before shutting down. That's too cumbersome for me.

    Anyhow, as I said, I got efibootmgr working satisfactorally in the end.

    rEFInd doesn't feel right, somehow. It seems to involve a graphics
    screen, and configuring icons in a config file. I just want want to get the system booted, with a choice of kernels at boot time, and not have
    all the overhead of graphics and "flexibility".

    I thought systemd-boot was OK, until it starting emptying my /boot partition, and booting from a partition other than the one I'd told it
    to. Don't we just love software which is clever?

    <Sigh>. It looks like I'm going to have to make some compromises, somewhere. It's a pity lilo isn't still going.

    There is sys-boot/elilo available for UEFI systems, but it hasn't been touched
    for more than 10 years. I've never tried it, but this doesn't mean it won't work as is.

    There's also syslinux, but you'll need to use efibootmgr (once) to let the UEFI firmware know about the syslinux image.

    Yes. I spent the morning getting syslinux working on my old machine, for
    which I did indeed need efibootmgr (actually more than once). I cleared
    out most of the debris from the BIOS's list of bootable things, leaving
    only (in order) my DVD drive, syslinux, and systemd-boot. I strongly
    suspect I will never be using the last of these again.

    I've also changed the partition type of my /dev/nvme1n1p2 from EFI System Partition to ordinary Linux file system. I was even getting twisted up
    myself between that partition and the proper /boot partition. Now it
    can't happen again.

    I amn't absolutely sure what started writing stuff onto /dev/nvme1n1p2,
    but I strongly suspect it was systemd-boot, still. I'm sure that on my
    old machine it was bootctl install that wrote the executable file onto
    the EFI partition that WASN'T mounted as /boot, or even mounted at all.

    Anyhow, syslinux appears to be running satisfactorally on my old machine
    (after I swapped out vesamenu.c32 for menu.c32 to eliminate the graphical
    slant of the former). But I worry a little that the syslinux project
    doesn't appear to be in its vigorous prime of life. It seems to be a
    project that was made to work properly, then the maintainers decided
    there was nothing more to be done, so they didn't do anything. (This is
    much better than the usual Microsoft strategy.)

    So I now have to get syslinux onto my new machine, now. It won't take me
    very long.

    Thanks for the help over the last two or three posts!

    Having two EFI System partitions probably is a bad idea.

    --
    Alan Mackenzie (Nuremberg, Germany).

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael@21:1/5 to All on Thu Dec 19 16:38:39 2024
    On Thursday 19 December 2024 15:46:06 GMT Alan Mackenzie wrote:

    OK, I'm flogging a dead horse here, but the correct error message would
    have been along the lines:

    File or directory not found: /dev/sda1/EFI/whatever.

    Yes, it would be reasonable to expect at least this much. Perhaps efibootmgr just prints out whatever the UEFI firmware API with its limited repertoire returns. :-/

    When I first started using it, I occasionally forgot the loader directive
    needs to use MSDOS nomenclature conventions; e.g.

    --loader "\EFI\Gentoo\foo-x64.efi"

    and I couldn't decipher from the error message what was wrong with my syntax.



    Having two EFI System partitions probably is a bad idea.

    I have two /efi partitions on two different disks. The UEFI firmware probes block devices and scans FAT32 partitions marked with an EFI System Partition GPT label, then lists all .efi executables it finds in there in its boot menu.

    I never had a problem I didn't cause myself (e.g. deleting the wrong kernel image), but when 'smart' scripts "... for your own safety and convenience" are let loose on your drives then all bets are off. ;-)
    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCAAdFiEEXqhvaVh2ERicA8Ceseqq9sKVZxkFAmdkTA8ACgkQseqq9sKV ZxkIzRAAqWiUobrYuii8myeSESYgL0xXqitoP4x2PTlZK+K9B+348qpq/b8GhQzn X5IZ/DLNWczdefwsqg/zuiF94H0I2sd4q9Vqwj1ClXv5w6WwycLimMIgqRmVDt2T 2nYXN05x8FJktZiGkMwYwupv+6P4vQBMChYYihB2At34R2Htq8L41hgxQ8puy8sQ 5mSdta7AJtWyq8AAiHHHRoG+M0M4wHggtBDrOL7AnTevzLPVH2QoyDwMFdt3D/K2 eLJsG/NEw3qqC4+8zDOOC3/FCoalXZsQRgzrtxK0qENJ31HTshwbVr6WYMhHPDLx diHwbQAbtkkaRCHouwPXDYmx5D1CBaAJbhp8r9LX56tSFwHeK59ftbC0nJVFElo2 0wVJIWze3ZypPzVDsJu306YEnjgYoIa82EyoF75ZgRspVn4oMV6z9rkk+iIE/riy ww9VEoNaE9CvNrBfUAj79mbWmlFlrn7fbGoNOKVlvt9RoxksdwdWYBQmmRJdxlOB 1Aa+bTnNvHHr9P/TXEDaCbYg5QKvdnDZmPwocWu6ZUKIU4ro18n44TdoNMHf4q52 3PikdydPhMZZeYncwiOiIxWBvBYjNHK6vZ2Jy7+WujZrV3lQC0cl4IfZQ+FUTym8 xk3pmdixkR5yqUf279CfyHKYnWHTY7iG8pnF49zO3bqbGKJE8RQ=
    =G1bB
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Wols Lists@21:1/5 to Peter Humphrey on Sat Dec 28 23:00:01 2024
    On 18/12/2024 14:30, Peter Humphrey wrote:
    On Wednesday 18 December 2024 12:13:59 GMT Alan Mackenzie wrote:

    I've been having fun with systemd-boot.
    I've been using bootctl from systemd-utils for some years; ever since I graduated to an EFI system. I don't follow the wiki because of the resulting impenetrable thicket of unpronounceable names and 32-digit hex numbers. Fine for a distro builder, perhaps, but not for me thank you - especially as I want
    a selection of kernels to boot from, which I never did work out how to achieve
    following the official advice.

    That's my problem too ...

    If I want a multiboot system, with just ONE bootloader, eg grub, I do
    NOT want a distro install mechanism messing about with the other
    distros. ESPECIALLY if (I'm looking at you, SUSE) you mess it up so YOU
    can't boot, and neither can anything else!

    (And no,I don't expect gentoo to get it right, either.)

    Cheers,
    Wol

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Wols Lists@21:1/5 to Alan Mackenzie on Sat Dec 28 23:10:01 2024
    On 19/12/2024 15:46, Alan Mackenzie wrote:
    I amn't absolutely sure what started writing stuff onto /dev/nvme1n1p2,
    but I strongly suspect it was systemd-boot, still. I'm sure that on my
    old machine it was bootctl install that wrote the executable file onto
    the EFI partition that WASN'T mounted as /boot, or even mounted at all.

    Bear in mind that gentoo insists on mounting /boot for you, if it exists
    in fstab. B*****y e***ing stupid if you ask me.

    There's a flag that says "don't mount boot", but all that does is scream
    blue murder and say "if you won't let me mount boot I won't play",
    before terminating. All I wanted was for it to stick it in the boot
    DIRECTORY and let me sort things out later :-(

    And the alleged workaround promptly caused the kernel compile to crash
    with "file not found", despite whatever option it was apparently having absolutely nothing to do with where it was supposed to be looking for
    its files.

    So basically, the fact that you THINK /boot isn't mounted means nothing
    - gentoo will mount it behind your back, and wail blue murder if it can't.

    Cheers,
    Wol

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Peter Humphrey@21:1/5 to All on Sun Dec 29 14:00:04 2024
    On Saturday 28 December 2024 21:53:53 Greenwich Mean Time Wols Lists wrote:
    On 18/12/2024 14:30, Peter Humphrey wrote:
    On Wednesday 18 December 2024 12:13:59 GMT Alan Mackenzie wrote:
    I've been having fun with systemd-boot.

    I've been using bootctl from systemd-utils for some years; ever since I graduated to an EFI system. I don't follow the wiki because of the resulting impenetrable thicket of unpronounceable names and 32-digit hex numbers. Fine for a distro builder, perhaps, but not for me thank you - especially as I want a selection of kernels to boot from, which I never
    did work out how to achieve following the official advice.

    Er... some misattribution here. Those six lines were mine, not Alan's.

    That's my problem too ...

    If I want a multiboot system, with just ONE bootloader, eg grub, I do
    NOT want a distro install mechanism messing about with the other
    distros. ESPECIALLY if (I'm looking at you, SUSE) you mess it up so YOU
    can't boot, and neither can anything else!

    (And no,I don't expect gentoo to get it right, either.)

    Gentoo does what it can, but it certainly needs some help to make the system work as the sysop wants it, even if there's no other distro present.

    --
    Regards,
    Peter.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)