Skip to content
This repository has been archived by the owner on Dec 11, 2020. It is now read-only.
Jan Neumann edited this page Jun 16, 2018 · 2 revisions

Welcome to the refind-patched wiki! Let me walk you through the differences with original rEFInd commit by commit.

This commit resolves an issue I had with rEFInd on Manjaro.

Consider this scenario: Two initramfs files for a single kernel, both with the same version string, one of them just ends with -fallback.img:

$ ls -l /boot
total 130393
drwxr-xr-x 3 root root     1024 Jan  1  1970 efi
drwxr-xr-x 1 root root       72 Jun 15 18:44 grub
-rw-r--r-- 1 root root 28464063 Jun 15 18:31 initramfs-4.14-x86_64-fallback.img
-rw-r--r-- 1 root root  9576050 Jun 15 18:31 initramfs-4.14-x86_64.img
-rw-r--r-- 1 root root 29416916 Jun 15 18:42 initramfs-4.16-x86_64-fallback.img
-rw-r--r-- 1 root root  9610852 Jun 15 18:42 initramfs-4.16-x86_64.img
-rw-r--r-- 1 root root 29605750 Jun 15 18:43 initramfs-4.17-x86_64-fallback.img
-rw-r--r-- 1 root root  9656182 Jun 15 18:43 initramfs-4.17-x86_64.img
...

Up until now rEFInd would only look for the file with the longest version match, but these two files have identical version match, so rEFInd would choose randomly, sometimes picking the fallback version as default, which is incorrect.

This patched rEFInd version chooses the file with the shortest name whenever there are multiple initramfs files with the same kernel version. It's perfectly logical. In such scenario, the fallback version is never chosen, while at the same time current rEFInd's behavior is unmodified.

This commit adds the ability to use an initrd=%s.img variable in the refind_linux.conf file. This allows us to do this:

"Boot with standard options" "rw root=/dev/nvme0n1p6 quiet initrd=\boot\intel-ucode.img initrd=%s.img"
"Boot fallback initramfs"    "rw root=/dev/nvme0n1p6 initrd=\boot\intel-ucode.img initrd=%s-fallback.img"

Notice the %s at the end of each line. It gets replaced with the current selected autodetected initramfs file (without the .img extension, to allow appending strings such as -fallback). If the %s variable is not used at all, the behavior is identical to the original rEFInd.

Clone this wiki locally