dakanji / RefindPlus

A Boot Manager for Mac and PC
GNU General Public License v3.0
295 stars 64 forks source link

Symlinked openSUSE Tumbleweed Linux kernels do not appear #117

Closed MarioG-X closed 1 year ago

MarioG-X commented 1 year ago

RefindPlus Version

v0.13.3.AA Release

Device Type

Apple Mac

Problem Description

Opensuse Tumbleweed now uses an alias/link in the /boot directory to point to the kernel file and RP cannot find it. This change was made last year to Tumbleweed and other linux distributions. The real vmlinuz file is now in /usr/lib/modules/5.18.11-1-default.

I tested the following and it booted, the RP problem seems related to /boot/vmlinuz-xxx being a link/alias:

  1. In /boot rename vmlinuz and vmlinuz-5.18.11-1-default.
  2. copied vmlinuz from /usr/lib/modules/5.18.11-1-default to /boot.
  3. In /boot renamed vmlinuz to vmlinuz-5.18.11-1-default

Since Leap is being discontinued I am converting to Tumbleweed. I attached an RP log of the startup and a list of the directories from /boot through to the actual kernel.

I googled tumbleweed kernel "usr/lib/modules" and found similar issues. See opensuse web

Problem Point

Before starting a loader or tool

Affected Items

Lin OS Loader

Debug Log

22n28v2542.log

Additional Context

RPnotes.txt

dakanji commented 1 year ago

Hello,

I don't have access to my dev setup but will get round to looking at this presently. Can you confirm whether the issue affects rEFInd?

MarioG-X commented 1 year ago

Tested with native rEFInd and I get same results. So this is something rEFInd will need to address as well.

dakanji commented 1 year ago

Apparently, rEFInd and hence, RefindPlus, do not support symlinks. Support was disabled in the v0.6.11 release of rEFInd (check the changelog) due to some other issues providing this apparently caused

Please raise a request for this to be revisited upstream. If changed, then will flow into RefindPlus. I suppose you can use the workarounds you listed in the interim.

MarioG-X commented 1 year ago

Bummer, I don't have a way to report since it's not on GitHub and not plan on a sourceforge account. So I sent an email to author, hope he sees it. Since other distros are doing this since last year I am surprised it was not addressed by now. At least the workaround works on Tumbleweed but may not work for other distros.

dakanji commented 1 year ago

He does respond to emails at times.

The default is that symlinks are simply ignored when scanning for loaders as they can apparently cause some other problems. Looking at things briefly, it seems possible to add an option to bypass the bit ignoring symlinks. With this, those that need this can activate it while the default behaviour stays as is.

github-actions[bot] commented 1 year ago

This item is being closed as a known issue.

MarioG-X commented 1 year ago

A summary of his very good and extensive response: Very difficult for rEFInd because EFI can't handle subdirectories Possible solutions:

  1. Copy the Kernel to /boot as I am doing.
  2. Hard links in /boot to /usr... should work if /boot is in same partition as actual kernels.
  3. Use config option also_scan_dirs to point to /usr...

Unfortunately, all options require changes each time the kernel is updated because not only does the kernel name change but each kernel is now in it's own directory with other kernel related files.

So his (great) idea is to see if there is a way to enhance also_scan_dirs to use a generic name so that it can find and search multiple directories. If that works, no need to change anything for kernel updates. Crossing fingers.

dakanji commented 1 year ago

I see.

You can try X250 in the interim and add a allow_boot_symlinks token to the config file to see whether the bypass idea has legs. The file is a detailed debug build so it will be much slower than a normal run.

X250-BOOTx64.efi.zip

MarioG-X commented 1 year ago

It worked! Slow but it worked. Odd that looking at the log it had no reference to /usr anywhere. Is this something you should to mention/send "upstream" he knows about it? 22p01y0938.log

dakanji commented 1 year ago

Probably easier for you to just reply to his email and let him know that bypassing the symlink check function works for you.

The call was made conditional depending on the presence of a config setting. It is called by default unless the token is set

MarioG-X commented 1 year ago

I sent emailed the info and a link to this issue.

dakanji commented 1 year ago

I have made a merge request of code adding a 'follow-symlinks' option to the upstream codebase: https://sourceforge.net/p/refind/code/merge-requests/46/

If accepted, it will appear in rEFInd at some point.