* [gentoo-user] Fun with systemd-boot
@ 2024-12-18 12:13 Alan Mackenzie
2024-12-18 12:50 ` Arsen Arsenović
2024-12-18 14:30 ` Peter Humphrey
0 siblings, 2 replies; 15+ messages in thread
From: Alan Mackenzie @ 2024-12-18 12:13 UTC (permalink / raw
To: gentoo-user
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).
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [gentoo-user] Fun with systemd-boot
2024-12-18 12:13 [gentoo-user] Fun with systemd-boot Alan Mackenzie
@ 2024-12-18 12:50 ` Arsen Arsenović
2024-12-18 13:41 ` Alan Mackenzie
2024-12-18 14:18 ` Joost Roeleveld
2024-12-18 14:30 ` Peter Humphrey
1 sibling, 2 replies; 15+ messages in thread
From: Arsen Arsenović @ 2024-12-18 12:50 UTC (permalink / raw
To: Alan Mackenzie; +Cc: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 2794 bytes --]
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ć
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 381 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [gentoo-user] Fun with systemd-boot
2024-12-18 12:50 ` Arsen Arsenović
@ 2024-12-18 13:41 ` Alan Mackenzie
2024-12-18 14:18 ` Joost Roeleveld
1 sibling, 0 replies; 15+ messages in thread
From: Alan Mackenzie @ 2024-12-18 13:41 UTC (permalink / raw
To: gentoo-user
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).
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [gentoo-user] Fun with systemd-boot
2024-12-18 12:50 ` Arsen Arsenović
2024-12-18 13:41 ` Alan Mackenzie
@ 2024-12-18 14:18 ` Joost Roeleveld
1 sibling, 0 replies; 15+ messages in thread
From: Joost Roeleveld @ 2024-12-18 14:18 UTC (permalink / raw
To: gentoo-user
----------------------- 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
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [gentoo-user] Fun with systemd-boot
2024-12-18 12:13 [gentoo-user] Fun with systemd-boot Alan Mackenzie
2024-12-18 12:50 ` Arsen Arsenović
@ 2024-12-18 14:30 ` Peter Humphrey
2024-12-18 15:58 ` Michael
2024-12-28 21:53 ` Wols Lists
1 sibling, 2 replies; 15+ messages in thread
From: Peter Humphrey @ 2024-12-18 14:30 UTC (permalink / raw
To: gentoo-user
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.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [gentoo-user] Fun with systemd-boot
2024-12-18 14:30 ` Peter Humphrey
@ 2024-12-18 15:58 ` Michael
2024-12-18 21:31 ` Alan Mackenzie
2024-12-19 11:36 ` Peter Humphrey
2024-12-28 21:53 ` Wols Lists
1 sibling, 2 replies; 15+ messages in thread
From: Michael @ 2024-12-18 15:58 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 3776 bytes --]
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
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [gentoo-user] Fun with systemd-boot
2024-12-18 15:58 ` Michael
@ 2024-12-18 21:31 ` Alan Mackenzie
2024-12-18 21:47 ` Re[2]: " Stefan Schmiedl
2024-12-19 10:59 ` Michael
2024-12-19 11:36 ` Peter Humphrey
1 sibling, 2 replies; 15+ messages in thread
From: Alan Mackenzie @ 2024-12-18 21:31 UTC (permalink / raw
To: gentoo-user
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).
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re[2]: [gentoo-user] Fun with systemd-boot
2024-12-18 21:31 ` Alan Mackenzie
@ 2024-12-18 21:47 ` Stefan Schmiedl
2024-12-19 10:59 ` Michael
1 sibling, 0 replies; 15+ messages in thread
From: Stefan Schmiedl @ 2024-12-18 21:47 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 1445 bytes --]
------ Original Message ------
From "Alan Mackenzie" <acm@muc.de>
To gentoo-user@lists.gentoo.org
Date 18.12.2024 22:31:42
Subject Re: [gentoo-user] Fun with systemd-boot
>
>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.)
After a bit of wiki browsing and experimentation I have ended up with
the following process for a gentoo VM using UEFI boot:
- `emerge gentoo-kernel-bin`
- kernel and initramfs end up in /boot
- `efi-update 6.12.5`
where efi-update is
#!/bin/zsh
BASE=/efi/EFI/gentoo/
VERSION=${1-6.8.10}
KERNEL="vmlinuz-${VERSION}-gentoo-dist"
INITRD="initramfs-${VERSION}-gentoo-dist.img"
cp /boot/${KERNEL} /boot/${INITRD} ${BASE}
efibootmgr --create-only --create --disk /dev/sdd --part 1 --label
"gentoo ${VERSION}" --loader "\\EFI\\gentoo\\${KERNEL}" --unicode
"initrd=\\EFI\\gentoo\\${INITRD}"
echo "try: efibootmgr -n XXXX"
echo "use: efibootmgr -o XXXX,YYYY,..."
echo "del: efibootmgr -B -b XXXX"
The last three lines are to remind of which options to use for managing
the kernel for the next boot only (try), changing the permament boot
sequence
and cleaning up old kernels. I never had to enter the UEFI BIOS on this
VM.
HTH,
s.
[-- Attachment #2: Type: text/html, Size: 4608 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [gentoo-user] Fun with systemd-boot
2024-12-18 21:31 ` Alan Mackenzie
2024-12-18 21:47 ` Re[2]: " Stefan Schmiedl
@ 2024-12-19 10:59 ` Michael
2024-12-19 15:46 ` Alan Mackenzie
1 sibling, 1 reply; 15+ messages in thread
From: Michael @ 2024-12-19 10:59 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 2923 bytes --]
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.
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [gentoo-user] Fun with systemd-boot
2024-12-18 15:58 ` Michael
2024-12-18 21:31 ` Alan Mackenzie
@ 2024-12-19 11:36 ` Peter Humphrey
1 sibling, 0 replies; 15+ messages in thread
From: Peter Humphrey @ 2024-12-19 11:36 UTC (permalink / raw
To: gentoo-user
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.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [gentoo-user] Fun with systemd-boot
2024-12-19 10:59 ` Michael
@ 2024-12-19 15:46 ` Alan Mackenzie
2024-12-19 16:38 ` Michael
2024-12-28 22:01 ` Wols Lists
0 siblings, 2 replies; 15+ messages in thread
From: Alan Mackenzie @ 2024-12-19 15:46 UTC (permalink / raw
To: gentoo-user
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).
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [gentoo-user] Fun with systemd-boot
2024-12-19 15:46 ` Alan Mackenzie
@ 2024-12-19 16:38 ` Michael
2024-12-28 22:01 ` Wols Lists
1 sibling, 0 replies; 15+ messages in thread
From: Michael @ 2024-12-19 16:38 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 1151 bytes --]
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. ;-)
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [gentoo-user] Fun with systemd-boot
2024-12-18 14:30 ` Peter Humphrey
2024-12-18 15:58 ` Michael
@ 2024-12-28 21:53 ` Wols Lists
2024-12-29 12:51 ` Peter Humphrey
1 sibling, 1 reply; 15+ messages in thread
From: Wols Lists @ 2024-12-28 21:53 UTC (permalink / raw
To: gentoo-user
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
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [gentoo-user] Fun with systemd-boot
2024-12-19 15:46 ` Alan Mackenzie
2024-12-19 16:38 ` Michael
@ 2024-12-28 22:01 ` Wols Lists
1 sibling, 0 replies; 15+ messages in thread
From: Wols Lists @ 2024-12-28 22:01 UTC (permalink / raw
To: gentoo-user
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
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [gentoo-user] Fun with systemd-boot
2024-12-28 21:53 ` Wols Lists
@ 2024-12-29 12:51 ` Peter Humphrey
0 siblings, 0 replies; 15+ messages in thread
From: Peter Humphrey @ 2024-12-29 12:51 UTC (permalink / raw
To: gentoo-user
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.
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2024-12-29 12:51 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-18 12:13 [gentoo-user] Fun with systemd-boot Alan Mackenzie
2024-12-18 12:50 ` Arsen Arsenović
2024-12-18 13:41 ` Alan Mackenzie
2024-12-18 14:18 ` Joost Roeleveld
2024-12-18 14:30 ` Peter Humphrey
2024-12-18 15:58 ` Michael
2024-12-18 21:31 ` Alan Mackenzie
2024-12-18 21:47 ` Re[2]: " Stefan Schmiedl
2024-12-19 10:59 ` Michael
2024-12-19 15:46 ` Alan Mackenzie
2024-12-19 16:38 ` Michael
2024-12-28 22:01 ` Wols Lists
2024-12-19 11:36 ` Peter Humphrey
2024-12-28 21:53 ` Wols Lists
2024-12-29 12:51 ` Peter Humphrey
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox