Closed psfloyd closed 2 years ago
Sure, I could add this comparison as a fallback one in case the volume comparison evaluates to False.
I don't think that this would required much work at all, just by looking at how the code works. It's been a while since I've looked at it so I have to remember a few bits, here and there. Hopefully, the "root" option's possible formats you've listed here are exactly those or are at least finite.
The thing is that I don't have a separate /boot partition on my system, but I'll just have to mock this kind of layout somehow. I hope that these changes will be helpful for future users who are using similar layouts.
Thank you for the suggestion.
I found the possible formats for "root" in the archwiki: Persistent block device naming. The only one I left out is "Disk ID" because it is not currently supported by refind-btrfs.
For testing you could create a fake refind.conf with the volume set to an arbitrary value different than your root partition. Then run refind-btrfs with refind_config
set to that fake file. I have been testing in that way as to not break my bootloader.
If you need to do any testing in a live system I would be willing to run some tests for you.
I'll create a fake file, like you've mentioned, with the "wrong" volume value but I'll use the correct "root" flag so that I can trigger the fallback matching mechanism. I'll have to take care of this bug before working on this, though.
Regarding the disk id pattern, I suppose that lsblk and/or findmnt can provide these values and if so, I could support it as well.
TL;DR: use
root=
kernel parameter inoptions
token to find proper boot stanza, instead ofvolume
token.Looking at older issues and experimenting with my own layout I have noticed that the
refind-btrfs
has problems with partition layouts that have a separate boot partition.In my case the general layout is as follows:
As you can see there are 3 main partitions:
The problem is that for the system to properly boot the
volume
token in the manual stanza inrefind.conf
has to point to theboot
partition. Otherwise refind does not find the kernel images. The stanza I normally use looks like this:In this case
refind-btrfs
errors out withCould not find a boot stanza matched with the root partition!
. Because it is searching in thevolume
token, and this token is not pointing to the root partition.Because of this I think searching for the appropriate boot stanza by looking at the
options
token would work better and encompass a wider range of partition layouts.For this to work the tool would have to search for the
root=
kernel parameter in theoptions
token and use that parameter to match the proper boot stanza. This would be using the appropriate form of the name (block device name, PARTLABEL, PARTUUID).In my case it would match by block device name. But the
root=
kernel parameters also accepts the other naming schemes (and even more if it is an initrams with udev). The parameters would look like this in each case:What do you think of this idea? Does it sound possible to implement?