Sysop: | Amessyroom |
---|---|
Location: | Fayetteville, NC |
Users: | 43 |
Nodes: | 6 (0 / 6) |
Uptime: | 96:13:21 |
Calls: | 290 |
Files: | 904 |
Messages: | 76,426 |
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.
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ć
I've been having fun with systemd-boot.
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.
Thanks in advance!
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.
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.
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
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
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).
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.
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?
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.
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.
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.
Having two EFI System partitions probably is a bad idea.
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.
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.
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.)