Antynea / grub-btrfs

Include btrfs snapshots at boot options. (Grub menu)
GNU General Public License v3.0
764 stars 77 forks source link

No submenu created on fedora #348

Open diddiman opened 2 months ago

diddiman commented 2 months ago

I had this working, but one day the submenu was no longer there. Not sure what changed

Not sure what is needed but when i run the snapshots-btrfs i get

 sudo /etc/grub.d/41_snapshots-btrfs
Detecting snapshots ...
Found snapshot: 2024-08-22 22:10:10 | root/btrbk_snapshots/ROOT.20240822T2210 | N/A | N/A |
Found snapshot: 2024-08-22 10:30:01 | root/btrbk_snapshots/ROOT.20240822T1030 | N/A | N/A |
Found snapshot: 2024-08-21 10:10:01 | root/btrbk_snapshots/ROOT.20240821T1010 | N/A | N/A |
Found snapshot: 2024-08-20 10:08:02 | root/btrbk_snapshots/ROOT.20240820T1008 | N/A | N/A |
Found snapshot: 2024-08-19 10:28:01 | root/btrbk_snapshots/ROOT.20240819T1028 | N/A | N/A |
Found snapshot: 2024-08-18 15:10:01 | root/btrbk_snapshots/ROOT.20240818T1510 | N/A | N/A |
Found snapshot: 2024-08-17 21:32:02 | root/btrbk_snapshots/ROOT.20240817T2132 | N/A | N/A |
Found snapshot: 2024-08-16 10:22:02 | root/btrbk_snapshots/ROOT.20240816T1022 | N/A | N/A |
Found snapshot: 2024-08-15 10:43:01 | root/btrbk_snapshots/ROOT.20240815T1043 | N/A | N/A |
Found snapshot: 2024-08-12 10:46:02 | root/btrbk_snapshots/ROOT.20240812T1046 | N/A | N/A |
Found snapshot: 2024-08-04 12:31:01 | root/btrbk_snapshots/ROOT.20240804T1231 | N/A | N/A |
Found snapshot: 2024-07-13 13:11:07 | root/btrbk_snapshots/ROOT.20240713T1311 | N/A | N/A |
if [ ! -e "${prefix}/grub-btrfs.cfg" ]; then
echo ""
else
submenu 'Fedora Linux snapshots' {
    configfile "${prefix}/grub-btrfs.cfg"
}
fi
Found 12 snapshot(s)
Unmount /tmp/grub-btrfs.83ormpXxcB .. Success

if i the run sudo grub2-mkconfig -o /boot/grub2/grub.cfg the generated file has this in the end

### BEGIN /etc/grub.d/41_snapshots-btrfs ###
if [ ! -e "${prefix}/grub-btrfs.cfg" ]; then
echo ""
else
submenu 'Fedora Linux snapshots' {
    configfile "${prefix}/grub-btrfs.cfg"
}
fi
### END /etc/grub.d/41_snapshots-btrfs ###

and the /boot/grub2/grub-btrfs.cfg looks correct with all the snapshots listed. I can also see all the files there, ls gives fonts grub-btrfs.cfg grub.cfg grubenv

However when i in grub go to the location of grub ((hd1,gpt1)/boot/grub2/), i can see my grub file, but not the grub-btrfs.cfg

Any idea here?

diddiman commented 2 months ago

i tried setting GRUB_BTRFS_GRUB_DIRNAME="/boot/efi/EFI/fedora" and it worked... Does that make sense? Seemed to be able to boot at least

pbignardi commented 1 month ago

I'm facing the same issue. Apparently, the prefix variable is set to /usr when 41_snapshots-btrfs is run. This breaks things because no submenu gets created, as /usr/grub-btrfs.cfg doesn't exist (mine is located in /boot/grub2/grub-btrfs.cfg).

Just out of curiosity, are you also having the same issue?