You are not logged in.

#1 2023-08-20 21:47:26

558 jakobsson
Member
From: Sweden
Registered: 2010-01-19
Posts: 28

[SOLVED]rEFInd and how to add the lts kernel to menu?

My pc, an old Dell runs Win10 on sda, Arch Linux on sdb. UEFI with secure boot and fast start up disabled.
refind is version 0.14.0.2-1. System updated, latest today, 20/8-2023
All screen messages have been scanned by my Samsung mobile and I have tried to correct some of its interpretation errors..

I have been around on the net for several days but still haven`t found a solution. Just recently I found out that I had missed to install the ext4 driver, and very strange, refind loaded some alternatives anyway. Now there is a ext4 driver but still no success for all menu variants.

rEFInd adds menu entries after those four lines I have in refind_linux.conf. Of my "own" lines none of the two lines that refers to the initrd=initramfs-linux-lts.img works. Of the four entries added by refind only two of those works, that sets the initrd= initrd=initramfs-linux-lts.img. I have read refind.conf if there are any settings that could be adjusted but I can`t find any relevant. I have made some changes in the refind.conf.
I want my refind_linux.conf to work! Or perhaps manual stanzas? Any ideas?

My refind_linux.conf w. 4 lines

"Boot using default options" "root=PARTUUID=01a4f584-65b2-4163-ad2f-666e7edd71e9 rw add_efi_memmap initrd=intel-ucode.img initrd=initramfs-linux.img"
"Boot using fallback initramfs"  "root=PARTUUID=01a4f584-65b2-4163-ad2f-666e7edd71e9 rw add_efi_memmap initrd=intel-ucode.img initrd=initramfs-fallback.img"
"Boot using lts"  "root=PARTUUID=01a4f584-65b2-4163-ad2f-666e7edd71e9 rw add_efi_memmap initrd=intel-ucode.img initrd=initramfs-linux-lts.img"
"Boot using lts fallback"  "root=PARTUUID=01a4f584-65b2-4163-ad2f-666e7edd71e9 rw add_efi_memmap initrd=intel-ucode.img initrd=initramfs-linux-lts-fallback.img"

refind Linux submeny
That produces a menu with a Win icon, a Linux penguin icon and an Arch icon. The Arch one because I have a manual stanza which also doesn`t work
Examining the Linux icon, there are 9 entries of which only four works. If I skip the two lines in refind_linux.conf ref. the lts kernel and its images, refind adds only two wmlinuz-linux-lts entries. Totally five entries and only the first one works. But now there is a new error, see below...

Boot options for vmlinuz-linux on 598 MiB FAT volume
Boot using default options      (from refind_linux.conf)
Boot using fallback initramfs           -"-
Boot using lts                                   -"-
Boot using lts fallback                      -"-
vmlinuz-linux-lts: Boot using default options    (added by refind)
vmlinuz-linux-lts: Boot using fallback initramfs        -"-
vmlinuz-linux-lts; Boot using lts                                -"-
vmlinuz-linux-lts: Boot using lts fallback                   -"-
Return to Main Menu

Of those four starting with "Boot" only the first two works. Of those four starting with "vmlinuz-linux-lts" only the last two works.
The first two "vmlinuz-linux-lts" entries has a wrong command line, if read by rEFInd line editor via F2, that refers to the normal kernel but it doesn`t start that either. The mkrlconf script works but gives just the settings for the normal kernel, and they are the same ones as in my refind_linux.conf. I have used the rEFInd log but no clues from there.

Startup error, freezes the pc
Always the same error , switch off with the powerbutton. REISUB doesn`t work.

::running early hook [udev] Warning: <lib<modules/6.1.46-1-lts/modules.devname not found - ignoring Starting systemd udevd version 254.1-1-arch:: running hook [udev]. . 
: running hook [keymap]Loading keymap...done:: 

performing fsck on ' PARTUUID=01a4f584-65b2-4163-ad2f-666e7edd?1e9`dev/sdb2: clean, 258539/2621440 files, 1843722/10485760 blocks:: 
mounting 'PARTUUID=01a4f584-65b2-4163-ad2f-666e7edd?1e9' on real root mount: /new root:unknown filesystem type 'ext4' 
dmesg(1) may have more information after failed mount system call.
ERROR: Failed to mount ' PARTUUID=01a4f584-65b2-4163-ad2f-666e7edd71e9' on real root. You are now being dropped into an emergency shell.sh: can' access tty: job control turned off[rootfs "1# 

The ext4_x64.efi driver for ext4 fs is present in /boot/EFI/refind/drivers_x64/ map

New error, scanned with interpretation errors.

 Starting vmlinus-linux-lts Using load options 'root=PaRTUU1D=01a4f584-65b2-4163-ad2f-666e7edd71e9 es-fallback.img'
EF1 stub: ERROR: Failed to open file: initramfs-fallback.img
EFI stub: ERROR: Failed to load initrd: 0x800000000000000e EFI stub: ERROR: efi_main() failed Error: Not Found returned from vmlinuz-11nux-1ts
Hit any key to continue 

This error is recoverable and controlled by refind that lets me back out to the menu again.

Partitions and fstab
Due to old habits I use separate partitions for /, /boot, /home, /var and [swap] The sdb6 is a special that was added after the main installation, for shuffling files between Win on sda and Arch Linux on sdb.

[leif@Krasaki ~]$ lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sda      8:0    0 238,5G  0 disk 
├─sda1   8:1    0   529M  0 part 
├─sda2   8:2    0   100M  0 part 
├─sda3   8:3    0    16M  0 part 
├─sda4   8:4    0 237,5G  0 part 
└─sda5   8:5    0   400M  0 part 
sdb      8:16   0   1,8T  0 disk 
├─sdb1   8:17   0   600M  0 part /boot
├─sdb2   8:18   0    40G  0 part /
├─sdb3   8:19   0   425G  0 part /home
├─sdb4   8:20   0   425G  0 part /var
├─sdb5   8:21   0    15M  0 part [SWAP]
└─sdb6   8:22   0   529G  0 part /run/media/leif/FAT32
sr0     11:0    1  1024M  0 rom
# Static information about the filesystems.
# See fstab(5) for details.

# <file system> <dir> <type> <options> <dump> <pass>
# /dev/sdb2
UUID=0c55c21d-ae01-426d-843b-03c8fd594c08	/         	ext4      	rw,relatime	0 1

# /dev/sdb1
UUID=23B9-781B      	/boot     	vfat      	rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro	0 2

# /dev/sdb3
UUID=02c3643f-4a1d-4765-8803-2e0726c40010	/home     	ext4      	rw,relatime	0 2

# /dev/sdb4
UUID=a25cf407-4af7-4310-9024-76cb3ff85a22	/var      	ext4      	rw,relatime	0 2

# /dev/sdb5
UUID=4b7471b9-cc0c-4202-87ad-83d1ff398f97	none      	swap      	defaults  	0 0

# /dev/sdb6
UUID=76BB-EE04		 /run/media/leif/FAT32/	  vfat		uid=1000,gid=users,umask=002 0 2

The contents of /boot, /boot/EFI/refind and /boot/EFI/refind/drivers_x64

 [leif@Krasaki ~]$ ls -a /boot
.                                 initramfs-linux-lts.img
..                                intel-ucode.img
EFI                               refind_linux.conf
initramfs-linux-fallback.img      vmlinuz-linux
initramfs-linux.img               vmlinuz-linux-lts
initramfs-linux-lts-fallback.img
[leif@Krasaki ~]$
leif@Krasaki ~]$ ls -a /boot/EFI/refind
.   BOOT.CSV     icons  refind.conf         refind_x64.efi
..  drivers_x64  keys   refind.conf-sample  vars
[leif@Krasaki ~]$ cd /boot/EFI/refind/drivers*
[leif@Krasaki drivers_x64]$ ls -a
.  ..  ext4_x64.efi
[leif@Krasaki drivers_x64]$ 
$

refind.conf excerpts w. manual stanza

[root@Krasaki leif]# sed -n '/^[^#]/p' /boot/EFI/refind/refind.conf
timeout 20
use_nvram false
showtools memtest, about, reboot, exit
scan_driver_dirs /boot/EFI/refind/drivers_x64/
scanfor internal,manual
extra_kernel_version_strings linux-lts,linux

menuentry "Arch Linux" {
    icon     /EFI/refind/icons/os_arch.png
    volume   PARTUUID="e0779704-1662-4c48-a746-707b56b56bfb"
    loader   /boot/vmlinuz-linux
    initrd   /boot/initramfs-linux.img
	options  "root=PARTUUID=01a4f584-65b2-4163-ad2f-666e7edd71e9 rw add_efi_memmap initrd=\boot\intel-ucode.img"
    submenuentry "Boot using fallback initramfs" {
        initrd /boot/initramfs-linux-fallback.img
    }
    submenuentry "Boot to terminal" {
        add_options "systemd.unit=multi-user.target"
    }
 }
[root@Krasaki leif]#

Manual stanza load lines as scanned from screen
Default with corresponding errors

 rEFInd Line Editor
root =PARTUUID=01a4f584-65b2-4163-ad2f-666e7edd71e9 rw add_efi_memmap initrd=\boot\intel-ucode.img
Use cursor keys to edit, Esc to exit, Enter to boot with edited options 
Using load options 'root=PARTUUID=01a4f584-65b2-4163-ad2f-666e7edd71e9 rw add_efi_memmap initrd=\boot\intel-ucode.img 
Starting vmlinuz-linux Invalid loader file!Error: Not Found while loading vmlinuz-1inux Hit any key to continue

Manual stanza load lines as scanned from screen
Fallback with corresponding error

rEFInd - Line Editor root=PARTUUID=01a4f584-65b2-4163-ad2f-666e7edd71e9 rw add_efi_memmap initrd=\boot\intel-ucode.img 
initrd=\boot\initramfs-linux Use cursor keys to edit, Esc to exit. Enter to boot with edited options
 Starting vmlinuz-linux load options 'root=PARTUUIDtsita4ten4 6fb2-4163 ad2f-666edd71e9 rw add_efi memmap initrd=\boot\intel-ucode.img initrd=boot\initramfs-linux-fallback.invalid loader file
Errors Not Found while loading vmlinuz-linux Hit any key to continue  

Last edited by 558 jakobsson (2024-01-11 17:29:25)

Offline

#2 2023-08-21 07:50:25

d_fajardo
Member
Registered: 2017-07-28
Posts: 1,568

Re: [SOLVED]rEFInd and how to add the lts kernel to menu?

Have a read of this regarding stanza definitions:
https://www.rodsbooks.com/refind/configfile.html

Offline

#3 2023-08-21 15:56:02

558 jakobsson
Member
From: Sweden
Registered: 2010-01-19
Posts: 28

Re: [SOLVED]rEFInd and how to add the lts kernel to menu?

I think all of this started some weeks ago, I thought I had a working rEFInd setup but after a

sudo pacman -Syu

which installed, amongst other things, a new lts-kernel, but not the normal one, refind put that newer kernel as the default. But I can be wrong here, the spelling mistake is older than that update, it must origins from the install in June and perhaps I never checked all menu entries after that. Although, that menu reshuffle, that's what made me check the menu.

Thanks for the link, d_fajardo. I had read that part before and now I tried some settings in refind.conf, but no difference.

I have made some progress, first I found a mistake on line 2 in the refind_linux conf

 initrd=initramfs-fallback.img

should of course be

initrd=initramfs-linux-fallback.img

Then I reinstalled

 sudo pacman -S linux-lts linux-lts-headers

and could access the lts via the menu.

But then I couldn`t access the normal kernel!
I then reinstalled

 sudo pacman -S linux linux-headers

  which resulted that I could no longer, again, reach the lts kernel.

As for now, I am using the lts-kernel, because I did this

 sudo pacman -S linux linux-headers linux-lts linux-lts-headers

which made the normal kernel inaccessible.

Always the same error , switch off with the power button. REISUB doesn`t work.

::running early hook [udev] Warning: <lib<modules/6.1.46-1-lts/modules.devname not found - ignoring Starting systemd udevd version 254.1-1-arch:: running hook [udev]. . 
: running hook [keymap]Loading keymap...done:: 

performing fsck on ' PARTUUID=01a4f584-65b2-4163-ad2f-666e7edd?1e9`dev/sdb2: clean, 258539/2621440 files, 1843722/10485760 blocks:: 
mounting 'PARTUUID=01a4f584-65b2-4163-ad2f-666e7edd?1e9' on real root mount: /new root:unknown filesystem type 'ext4' 
dmesg(1) may have more information after failed mount system call.
ERROR: Failed to mount ' PARTUUID=01a4f584-65b2-4163-ad2f-666e7edd71e9' on real root. You are now being dropped into an emergency shell.sh: can' access tty: job control turned off[rootfs "1# 

Offline

#4 2023-08-21 19:16:33

d_fajardo
Member
Registered: 2017-07-28
Posts: 1,568

Re: [SOLVED]rEFInd and how to add the lts kernel to menu?

which installed, amongst other things, a new lts-kernel, but not the normal one, refind put that newer kernel as the default

Did you explicitly installed the lts kernel? An upgrade won't install that automatically so you must have installed it. Also rEFInd won't  automatically boot another kernel unless you told it to do so or have run refind-install afterwards.
Can you post both:

ls -l /dev/disk/by-uuid
ls -l /dev/disk/by-partuuid
ls /boot

This is just to check you uuid and partuuid in your configurations are matching and if images are in the boot directory.

Offline

#5 2023-08-21 22:16:15

558 jakobsson
Member
From: Sweden
Registered: 2010-01-19
Posts: 28

Re: [SOLVED]rEFInd and how to add the lts kernel to menu?

Thank you for taking your time to help.
Yes, I installed the lts- kernel when I did the whole new Arch install earlier, 8th of July according to the pacman log. I wanted the lts as an back up possibility.

But since my first post I have found and read an old question, almost 8 years old, regarding refind and how to config it,

 https://askubuntu.com/questions/697407/set-up-refind-to-boot-ubuntu-directly-no-grub-menu-displayed  

where Rod Smith, the man behind rEFInd, strongly recommended the auto detection, combined with running the mkrlconf script.. I had read the refind_linux.conf produced by the script before but I never tested it. It seemed very like my own variant. The script never mentions anything about some other kernels, i.e the lts in my case.
But the auto detection picks up that kernel. That did the trick.

The script works. I just added the two initrd points to the first line...

"Boot with standard options"  "root=PARTUUID=01a4f584-65b2-4163-ad2f-666e7edd71e9 rw add_efi_memmap initrd=intel-ucode.img initrd=initramfs-linux.img"
"Boot to single-user mode"    "root=PARTUUID=01a4f584-65b2-4163-ad2f-666e7edd71e9 rw add_efi_memmap single"
"Boot with minimal options"   "ro root=UUID=0c55c21d-ae01-426d-843b-03c8fd594c08"

The auto detection added the corresponding alternatives for the lts kernel. I think, I can make this case as solved, thank you.

Offline

#6 2023-08-22 15:45:55

558 jakobsson
Member
From: Sweden
Registered: 2010-01-19
Posts: 28

Re: [SOLVED]rEFInd and how to add the lts kernel to menu?

Yesterday I thought this case was solved, but today I realize I missed something.

refind_linux.conf
"Boot with standard options"  "root=PARTUUID=01a4f584-65b2-4163-ad2f-666e7edd71e9 rw add_efi_memmap initrd=intel-ucode.img initrd=initramfs-linux.img"
"Boot to single-user mode"    "root=PARTUUID=01a4f584-65b2-4163-ad2f-666e7edd71e9 rw add_efi_memmap single"
"Boot with minimal options"   "ro root=UUID=0c55c21d-ae01-426d-843b-03c8fd594c08" 

The auto detection adds three lines to the menu, whose first three lines is from refind_linux.conf above.

Those three extras have the vmlinuz-linux-lts pretexts and the same text "Boot etc " as those in the refind_linux.conf file.
However the first

vmlinus-linux-lts: Boot with standard options

has this initrd statement:

initrd=initramfs-linux.img 

which obviously is wrong. Should be

initrd=initramfs-linux-lts.img

and if edited like that with the line editor in refind, it works. Why?

For test I added a fourth line in my refind_linux.conf:

"Boot using lts kernel"  "root=PARTUUID=01a4f584-65b2-4163-ad2f-666e7edd71e9 rw add_efi_memmap initrd=intel-ucode.img initrd=initramfs-linux-lts.img" 

which ought to work but it didn´t. And the auto detection mimics me and adds a fourth line as well

vmlinuz-linux-lts: Boot using lts kernel

and that works.

Why do I have to add

"Boot using lts kernel"  "root=PARTUUID=01a4f584-65b2-4163-ad2f-666e7edd71e9 rw add_efi_memmap initrd=intel-ucode.img initrd=initramfs-linux-lts.img" 

to refind_linux.conf to force the auto detection to add what looks like the same entry?

The texts in the line editor for both alternatives is

root=PARTUUID=01a4f584-65b2-4163-ad2f-666e7edd71e9 rw add_efi_memmap initrd=intel-ucode.img initrd=initramfs-linux-lts.img

but only one works?

Conclusion: I can access the lts kernel in two ways, either by editing the the first "vmlinus" or using the last "vmlinus" line, on top of that I have two faulty lines.

Offline

Board footer

Powered by FluxBB