Antynea / grub-btrfs

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

Update grub-btrfsd submenu creation #289

Closed bkmo closed 1 year ago

bkmo commented 1 year ago

fix grub.cfg path in grub submenu creation. Addresses issue #288: grub-btrfsd submenu creation fails and the entire grub menu is recreated causing a conflict with "timeshift-autosnap" set to update grub as default.

Schievel1 commented 1 year ago

Thanks for your PR, good call, because normally you don't notice. I think I know what the actual problem is. In the previous version we used to source the file 41_snapshots_btrfs in grub-btrfsd to get the configured variables. But in 4.13 we source the config instead, and since grub_directory is set in 41_snapshots_btrfs it is empty in grub-btrfsd

// I'm gonna think about why I have done this a bit, then merge.

bkmo commented 1 year ago

This is what was going on in the 4.12 version: if [ -s "${GRUB_BTRFS_GRUB_DIRNAME:-/boot/grub}/grub-btrfs.cfg" ]; then seems to be looking for GRUB_BTRFS_GRUB_DIRNAME in the submenu instead of looking for "snapshots-btrfs" in grub.cfg. as done in 4.13.

Schievel1 commented 1 year ago

Yes, that doesn't work anymore since we do not always have grub-btrfs.cfg anymore. https://github.com/Antynea/grub-btrfs/pull/252