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

Syntax errors are detected in generated grub-btrfs.cfg file #230

Closed
theburrins opened this issue Nov 20, 2022 · 6 comments
Closed

Syntax errors are detected in generated grub-btrfs.cfg file #230

theburrins opened this issue Nov 20, 2022 · 6 comments

Comments

@theburrins
Copy link

$new snapshots directory is /run/timeshift/10374/backup/timeshift-btrfs/snapshots$
Generating grub configuration file ...
Found theme: /boot/grub/themes/Gradient_Glow_Blue/theme.txt
Found background image: /usr/share/images/desktop-base/desktop-grub.png
Found linux image: /boot/vmlinuz-5.10.0-19-amd64
Found initrd image: /boot/initrd.img-5.10.0-19-amd64
Found linux image: /boot/vmlinuz-5.10.0-18-amd64
Found initrd image: /boot/initrd.img-5.10.0-18-amd64
Found linux image: /boot/vmlinuz-5.10.0-17-amd64
Found initrd image: /boot/initrd.img-5.10.0-17-amd64
Found mtest-64.efi image: /@/boot/uefi-mt/mtest-64.efi
Adding boot menu entry for EFI firmware configuration
Detecting snapshots ...
Found snapshot: 2022-11-20 23:15:45 | timeshift-btrfs/snapshots/2022-11-20_23-15-45/@ | ondemand | Dopo aggiornamento... grub failed |
Found snapshot: 2022-11-20 18:58:26 | timeshift-btrfs/snapshots/2022-11-20_18-58-26/@ | ondemand | Prima dell'aggiornamento |
Found snapshot: 2022-11-20 18:30:04 | timeshift-btrfs/snapshots/2022-11-20_18-30-04/@ | ondemand | Dopo installazione grub-btrfsd |
Found snapshot: 2022-10-30 23:47:43 | timeshift-btrfs/snapshots/2022-10-30_23-47-43/@ | ondemand | Prima aggiornamento kernel e altro |
Found snapshot: 2022-10-08 19:12:41 | timeshift-btrfs/snapshots/2022-10-08_19-12-41/@ | ondemand | Prima aggiornamento e installazione Eclipse |
Found 5 snapshot(s)
errore: syntax error.
errore: Incorrect command.
errore: syntax error.
Errore di sintassi alla riga 59
Syntax errors are detected in generated grub-btrfs.cfg file.
If you think an error has occurred, please file a bug report at "https://github.com/Antynea/grub-btrfs"
Unmount /tmp/grub-btrfs.JVBhVZLgVE .. Success
Unable to delete /tmp/grub-btrfs.JVBhVZLgVE: Device or ressource is busy

I attach the grub-btrfs.cfg

grub-btrfs.cfg.zip

@theburrins
Copy link
Author

newsnapshotsdirectoryis/run/timeshift/10374/backup/timeshift−btrfs/snapshots Generating grub configuration file ... Found theme: /boot/grub/themes/Gradient_Glow_Blue/theme.txt Found background image: /usr/share/images/desktop-base/desktop-grub.png Found linux image: /boot/vmlinuz-5.10.0-19-amd64 Found initrd image: /boot/initrd.img-5.10.0-19-amd64 Found linux image: /boot/vmlinuz-5.10.0-18-amd64 Found initrd image: /boot/initrd.img-5.10.0-18-amd64 Found linux image: /boot/vmlinuz-5.10.0-17-amd64 Found initrd image: /boot/initrd.img-5.10.0-17-amd64 Found mtest-64.efi image: /@/boot/uefi-mt/mtest-64.efi Adding boot menu entry for EFI firmware configuration Detecting snapshots ... Found snapshot: 2022-11-20 23:15:45 | timeshift-btrfs/snapshots/2022-11-20_23-15-45/@ | ondemand | Dopo aggiornamento... grub failed | Found snapshot: 2022-11-20 18:58:26 | timeshift-btrfs/snapshots/2022-11-20_18-58-26/@ | ondemand | Prima dell'aggiornamento | Found snapshot: 2022-11-20 18:30:04 | timeshift-btrfs/snapshots/2022-11-20_18-30-04/@ | ondemand | Dopo installazione grub-btrfsd | Found snapshot: 2022-10-30 23:47:43 | timeshift-btrfs/snapshots/2022-10-30_23-47-43/@ | ondemand | Prima aggiornamento kernel e altro | Found snapshot: 2022-10-08 19:12:41 | timeshift-btrfs/snapshots/2022-10-08_19-12-41/@ | ondemand | Prima aggiornamento e installazione Eclipse | Found 5 snapshot(s) errore: syntax error. errore: Incorrect command. errore: syntax error. Errore di sintassi alla riga 59 Syntax errors are detected in generated grub-btrfs.cfg file. If you think an error has occurred, please file a bug report at "https://github.com/Antynea/grub-btrfs" Unmount /tmp/grub-btrfs.JVBhVZLgVE .. Success Unable to delete /tmp/grub-btrfs.JVBhVZLgVE: Device or ressource is busy

I attach the grub-btrfs.cfg

grub-btrfs.cfg.zip

the problem occurred after upgrading grub to grub-pc version 2.06-3 deb11u4 (stable-security)

@Schievel1
Copy link
Collaborator

Schievel1 commented Nov 21, 2022

Hm, I wonder which line it means with line 59, because that is

submenu '| 2022-11-20 18:30:04 | timeshift-btrfs/snapshots/2022-11-20_18-30-04/@ | ondemand | Dopo installazione grub-btrfsd              |' {

which does not look suspicious at all. You could try deleting the comment of that snapshot and try running grub-mkconf again although I don't understand what problem it has with this.

Since this happened after an upgrade, lets poke at this first.

  • Did you change the config in /etc/default/grub-btrfs/config? If so, what is the value of GRUB_BTRFS_SCRIPT_CHECK?
  • does that executable exist? grub-btrfs uses the value of ${bindir}/${GRUB_BTRFS_SCRIPT_CHECK}, so normally that should be something like /usr/bin/grub-script-check

@Schievel1
Copy link
Collaborator

Oh no wait a sec. I think you uploaded the wrong file. 41_snapshots-btrfs generates a grub-btrfs.new file and checks it for errors. Only if there aren't any it will copy the content of grub-btrfs.new over to grub-btrfs.cfg. So could you search for that grub-btrfs.new file? It should be in /boot/grub as well

Schievel1 added a commit that referenced this issue Nov 21, 2022
I noticed that this is confusing in #230, user would search for errors in
the grub-btrfs.cfg file although the old grub-btrfs.cfg file is never
overwritten with grub-btrfs.new

Signed-off-by: Pascal Jäger <pascal.jaeger@leimstift.de>
Schievel1 added a commit that referenced this issue Nov 21, 2022
I noticed that this is confusing in #230, user would search for errors in
the grub-btrfs.cfg file although the old grub-btrfs.cfg file is never
overwritten with grub-btrfs.new

Signed-off-by: Pascal Jäger <pascal.jaeger@leimstift.de>
Schievel1 added a commit that referenced this issue Nov 21, 2022
I noticed that this is confusing in #230, user would search for errors in
the grub-btrfs.cfg file although the old grub-btrfs.cfg file is never
overwritten with grub-btrfs.new

Signed-off-by: Pascal Jäger <pascal.jaeger@leimstift.de>
Schievel1 added a commit that referenced this issue Nov 21, 2022
I noticed that this is confusing in #230, user would search for errors in
the grub-btrfs.cfg file although the old grub-btrfs.cfg file is never
overwritten with grub-btrfs.new

Signed-off-by: Pascal Jäger <pascal.jaeger@leimstift.de>
@Schievel1
Copy link
Collaborator

I can see the error.

Found snapshot: 2022-11-20 18:58:26 | timeshift-btrfs/snapshots/2022-11-20_18-58-26/@ | ondemand | Prima dell'aggiornamento |

I was digging that much in the wrong .cfg file there and in different possibilities that I did not notice. The single quote (') is not allowed in a snapshot name/ comment by grub.
See also #198 and I fixed this in newer versions of grub-btrfs with b2b5307 (although the only thing I do here is removing any ' from the snapshot comment)

Please remove the ' from the snapshot comment, I am sure it will work. Please close this issue when it does.

@Schievel1
Copy link
Collaborator

Schievel1 commented Nov 24, 2022

Please upgrade to Version 4.12, this version will sanitize the comments from snapshots automatically.

@theburrins
Copy link
Author

theburrins commented Nov 29, 2022 via email

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

No branches or pull requests

2 participants