Closed BluishHumility closed 1 year ago
Thank you for the detailed explanation of this issue. I'll try and see what is happening when I find the time and I'll report back here.
I circled back to troubleshoot a little bit this evening and decided to test the mode = "embed_btrfs.logo"
option to see if it would work (since the normal icon from my rEFInd stanza is working fine). I stumbled on a clue:
sudo refind-btrfs
Initializing the block devices using lsblk.
Initializing the physical partition table for device '/dev/nvme0n1' using lsblk.
Analyzing the 'refind-btrfs.conf' file.
Initializing the live partition table for device '/dev/nvme0n1' using findmnt.
Found the ESP mounted at '/efi' on '/dev/nvme0n1p1'.
Found the root partition on '/dev/nvme0n1p2'.
Searching for snapshots of the 'eos-kde' subvolume in the '/.snapshots' directory.
Found subvolume 'eos-kde' mounted as the root partition.
Found 12 snapshots of the 'eos-kde' subvolume.
Searching for the 'refind.conf' file on '/dev/nvme0n1p1'.
Found 1 boot stanza matched with the root partition.
Embedding the 'inverted_large.png' logo into the 'eos-kde/boot/eos_logo.png' icon.
ERROR (refind_btrfs.system.pillow_command/pillow_command.py/embed_btrfs_logo_into_source_icon): Image.open('r') call failed!
Traceback (most recent call last):
File "/usr/lib/python3.10/site-packages/refind_btrfs/system/pillow_command.py", line 135, in embed_btrfs_logo_into_source_icon
) as btrfs_logo_image, Image.open(
File "/usr/lib/python3.10/site-packages/PIL/Image.py", line 3227, in open
fp = builtins.open(filename, "rb")
FileNotFoundError: [Errno 2] No such file or directory: '/efi/EFI/refind/eos-kde/boot/eos_logo.png'
ERROR (refind_btrfs.state_management.refind_btrfs_machine/refind_btrfs_machine.py/run): Could not read the '/efi/EFI/refind/eos-kde/boot/eos_logo.png' file!
That path (/efi/EFI/refind/eos-kde/boot/eos_logo.png
), as the error message points out, does not exist. It is adding the path to my regular icon (from my boot stanza) to /efi/EFI/refind/
. Here is my boot stanza:
menuentry "EOS-KDE" {
volume e798748f-c287-43e6-b675-cf376345f211
icon /eos-kde/boot/eos_logo.png
loader /eos-kde/boot/vmlinuz-linux-zen
initrd /eos-kde/boot/initramfs-linux-zen.img
options "root=UUID=5fa54f34-b5fc-40be-8092-8ba34ced9eba rw rootflags=subvol=eos-kde nvme.noacpi=1 nowatchdog
submenuentry "Boot fallback" {
initrd /eos-kde/boot/initramfs-linux-zen-fallback.img
}
}
eos-kde
is the name of the root subvolume for this installation.
A standard way to write the stanza is with the icon field first, with the path to the icon relative to the EFI partition. However, rEFInd allows for specifying an icon path where the icon is inside the root file system instead of on the EFI partition (in my case, the icon is in /boot
) as long as the icon field is added after the volume field in the stanza.
It appears refind-btrfs
is not aware that this is allowed, and is interpreting the path to my boot directory (/boot
inside the subvolume of eos-kde
) as a path relative to the refind.conf
directory.
Armed with this clue, I moved the icon from the boot directory to the EFI partition, and moved the icon field above the volume field in my rEFInd stanza. The script succeeded after this change, and the boot screen correctly showed the Btrfs-embedded logo.
Then, I changed back to mode = "custom"
, and my custom icon appears!
This last piece I am still scratching my head over, because the custom icon was on the EFI partition with a path relative to the refind.conf
directory the whole time. And it was validated by the script. It seems there is no reason for refind-btrfs
to be checking on the icon path from the boot stanza to begin with when using a custom icon, because it doesn't need to use it for anything. Still, it does appear that somehow it was causing a problem.
I'll close the issue here since I'm perfectly happy with this workaround. I realize this is kind of an unconventional bug that is unlikely to impact many folks, so I'm not sure if it is even worth to attempt some kind of fix or not, but either way I appreciate you taking a look and I thank you for your time.
A standard way to write the stanza is with the icon field first, with the path to the icon relative to the EFI partition.
Yeah, I assumed it needs to be somewhere on the ESP and I also mentioned that prerequisite in the config file as well as the fact that it isn't being used as-is but that it's format is also validated. I could play around with paths some more but I deem this feature out of scope, currently, since it's very easy to circumvent this validation by simply relocating the desired custom icon to the ESP - just as you did so yourself.
This last piece I am still scratching my head over, because the custom icon was on the EFI partition with a path relative to the refind.conf directory the whole time. And it was validated by the script.
This I don't understand, honestly. Perhaps rEFInd itself was somehow confused by the path, couldn't find the icon and used that ugly fallback icon instead? Still, that doesn't explain how it managed to find it afterwards. :confused:
Anyhow, I'm glad it worked out for you in the end and thank you for a detailed subsequent reply. :thumbsup:
Hello,
I am having a little trouble getting an icon to show up on my snapshot stanza boot entry. I do have a custom icon I would like to use, but I can't seem to get any icons to display for some reason. I have tested with an icon from the default set (
refind/icons/os_arch.png
), and I have also tried to use the default configuration with themode = "default"
setting under[boot-stanza-generation.icon]
, but instead of showing an icon I recognize I am getting this small box with yellow and black diagonal striping (on the right in this image):The script announces it is validating the image, and appears to succeed (I have tried an invalid path as well; it is not shy to point out my mistake):
The stanza that is generated shows the expected path for the icon, here is the top part of the stanza:
The image is in the same directory as the main
refind.conf
file, but I have tested moving it to other directories like../refind/icons
and.../refind/btrfs-snapshot-stanzas/
as well with the same result (the script validates the image, but the icon doesn't show up as I would expect).The pillow library is installed. I think something else pulled it in because I didn't explicitly install it, but I did confirm it is there.
I did see this note in the README:
I am using the prebuilt binary from the Chaotic-AUR repo. When I became stumped on the icon I did remove the Chaotic-AUR package and built the AUR package myself with Paru, however this did not have an impact on the issue with the icon.
Other than the issue with the icon, the package seems to be working great--it is finding my snapshots, setting up the rw versions in
/root/.refind-btrfs
, and the snapshots are bootable.