Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update grub-btrfsd submenu creation #289

Merged
merged 1 commit into from
Jul 26, 2023
Merged

Conversation

bkmo
Copy link
Contributor

@bkmo bkmo commented Jun 13, 2023

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.

fix grub.cfg path in grub submenu creation
@bkmo bkmo changed the title Update grub-btrfsd Update grub-btrfsd submenu creation Jun 13, 2023
@@ -206,7 +206,7 @@ setup() {
create_grub_menu() {
# create the grub submenu of the whole grub menu, depending on wether the submenu already exists
# and gives feedback if it worked
if grep "snapshots-btrfs" "{grub_directory}/grub.cfg"; then
if grep "snapshots-btrfs" "${GRUB_BTRFS_GRUB_DIRNAME:-/boot/grub}"/grub.cfg; then
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure how this solves it. The grub_directory variable should already be set to this:

grub_directory=${GRUB_BTRFS_GRUB_DIRNAME:-"/boot/grub"}

@Schievel1
Copy link
Collaborator

Schievel1 commented Jun 14, 2023

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
Copy link
Contributor Author

bkmo commented Jun 14, 2023

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
Copy link
Collaborator

Yes, that doesn't work anymore since we do not always have grub-btrfs.cfg anymore. #252

@Schievel1 Schievel1 merged commit 490720a into Antynea:master Jul 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants