Persistent systemd-boot entry changes in CachyOS
systemd-boot loader and entries configs get deleted after kernel updates
How can I persist kernel options with systemd-boot?
systemd boot kernel
Videos
Hi everyone,
I need some help to resolve this issue. The last two kernel updates since setting up systemd-boot had ended up in getting the loader.conf and the different entries files automatically deleted on ArchLinux. Of course it does not make sense to me it is doing this but I have to recreate them from a liveCD every time.
To compare, I have another Arch-based system where I have a similar systemd-boot configuration and this does not happen. Yes, these two systems have different system configurations when it comes to BIOS and UEFI versions, etc, so I do understand it is almost comparing apples to oranges in some ways.
Hello! Yesterday i installed arch witch systemd boot instead of grub, i also instaled the zen-kernel, but when i turn on the PC i cannot change between kernels like i use to do on grub. How can i change the kernel? Thanks for the answers!
Hi! I get really strange behavior of pacman: updating kernel removes all entries:
> ls /boot/loader/entries arch.conf
> cat /boot/loader/entries/arch.conf title Arch Linux linux /vmlinuz-linux initrd /intel-ucode.img initrd /initramfs-linux.img options root=/dev/nvme0n1p5 rootflags=subvol=@ rw
> cat /boot/loader/loader.conf default arch.conf timeout 3 #console-mode keep
> sudo pacman -Sy linux .... .... (4/4) Updating systemd-boot entries Error: There are no boot loader entries after entry generation error: command failed to execute correctly
> ls /boot/loader/entries <empty>
Pop!_OS manages boot entries using kernelstub. Its configuration is stored in a JSON file at /etc/kernelstub/configuration. You can add boot options there under default → kernel_options.
See the other answer for information on how to edit this file using the kernelstub command. Don't forget to upvote that answer if you find it helpful.
May I suggest trying the kernel boot option "acpi_osi=" in the place of the option you suggested?
This will correct a lot of issues with sleep and hibernate.
But to answer your question as you asked.
It is recommended to test the parameter on this setup before adding it, one would suggest you hold the space bar when powering up the system to catch the boot menu, then hit the "e" key to edit the line command line and test your boot option before saving it.
kernelstub works as following
To add a boot use -a "options" yours would be as follows
kernelstub -a "mem_sleep_default=deep"
To delete a boot option use -d "options" yours would be as follows
kernelstub -d "mem_sleep_default=deep"
and
# kernelstub -p
kernelstub.Config : INFO Looking for configuration...
kernelstub : INFO System information:
OS:..................Pop!_OS 22.04
Root partition:....../dev/dm-1
Root FS UUID:........f3b6a3b7-32e7-4f9c-9b8d-1952d5d8e0f3
ESP Path:............/boot/efi
ESP Partition:......./dev/nvme0n1p1
ESP Partition #:.....1
NVRAM entry #:.......-1
Boot Variable #:.....0000
Kernel Boot Options:.quiet systemd.show_status=false splash loglevel=0 acpi_osi=
Kernel Image Path:.../boot/vmlinuz-6.2.6-76060206-generic
Initrd Image Path:.../boot/initrd.img-6.2.6-76060206-generic
Force-overwrite:.....False
kernelstub : INFO Configuration details:
ESP Location:................../boot/efi
Management Mode:...............True
Install Loader configuration:..True
Configuration version:.........3