Can't create manual boot stanza with rEFInd

I installed rEFInd and run refind-install. The generated boot entry works really well, but it defaults to the linux-lts kernel and I would like it to autostart with the linux-zen kernel.
So for what I have understood the only way to do that is create a manual boot stanza with all the configuration parameters.
Unfortunately even though I tried with different configurations, I am always met with an "Invalid loader file" error, all the while the automatic entry is working well with the same options I set in the manual one.
So far I have come up with something like this:

menuentry "Garuda" {
        icon /EFI/refind/themes/refind-minimal/icons/os_arch.png
        volume "Garuda"
        loader "/garuda_root/boot/vmlinuz-linux-zen"
        initrd "/garuda_root/boot/initramfs-linux-zen.img"
        options "root=UUID=5a5ee3d7-be1f-4ecd-9bc2-a303fa333307 rw rootflags=subvol=garuda_root rootfstype=btrfs add_efi_memmap initrd=\arch_root\boot\intel-ucode.img quiet splash rd.udev.log_priority=3 vt.global_cursor_default=0 systemd.unified_cgroup_hierarchy=1 loglevel=3"

I know that something similar has already been posted, but the fact that the auto entry works tells me that there must be a way to configure the stanza in a way that refind can find the loader file.


I doubt you need a boot stanza for that - editing /boot/refind_linux.conf to pickup -zen should do it - even if you don't do it like mine (with variable boot params built in). Here's an example from one of my systems:

"Boot using default options"     "root=UUID=538b9f7d-c154-49af-be53-6f2e88747d6a rw resume=UUID=185941c4-f3d0-4e48-a621-5a7457f83e00 nowatchdog  add_efi_memmap sysrq_always_enabled=1 initrd=\boot\amd-ucode.img initrd=\boot\initramfs-%v.img"
"Boot using fallback initramfs"  "root=UUID=538b9f7d-c154-49af-be53-6f2e88747d6a resume=UUID=185941c4-f3d0-4e48-a621-5a7457f83e00 rw nowatchdog add_efi_memmap initrd=\boot\amd-ucode.img initrd=\boot\initramfs-%v-fallback.img"
"Boot to terminal"               "root=UUID=538b9f7d-c154-49af-be53-6f2e88747d6a rw add_efi_memmap initrd=\boot\amd-ucode.img initrd=\boot\initramfs-%v.img"

and the mods to /boot/efi/EFI/refind/refind.conf that enable variable usage.

section from refind.conf
# Comma-delimited list of strings to treat as if they were numbers for the
# purpose of kernel version number detection. These strings are matched on a
# first-found basis; that is, if you want to treat both "linux-lts" and
# "linux" as version strings, they MUST be specified as "linux-lts,linux",
# since if you specify it the other way, both vmlinuz-linux and
# vmlinuz-linux-lts will return with "linux" as the "version string," which
# is not wSummaryhat you'd want. Also, if the kernel or initrd file includes both a
# specified string and digits, the "version string" includes both. For
# instance, "vmlinuz-linux-4.8" would yield a version string of "linux-4.8".
# This option is intended for Arch and other distributions that don't include
# version numbers in their kernel filenames, but may provide other uniquely
# identifying strings for multiple kernels. If this feature causes problems
# (say, if your kernel filename includes "linux" but the initrd filename
# doesn't), be sure this is set to an empty string
# (extra_kernel_version_strings "") or comment out the option to disable it.
# Default is no extra version strings
extra_kernel_version_strings linux-zen,linux-lts,linux

Hopefully this will solve the difficulty!

it boots my -zen ZFS-enabled kernel by default as shown

Sorry for the late reply but thank you! This solved my issue! I really didn't think that there was no other way than to create a manual boot stanza, but reading online I have found out that it can be really tricky to make it work.
So thanks again for your time!

No problem! Just remember to adjust /boot/refind_linux.conf contents to match what YOU want to pass as boot parameters! :grin:


This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.