Antynea / grub-btrfs

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

detect_rootflags cutting input #327

Open arlyon opened 3 months ago

arlyon commented 3 months ago

Hi there, thanks for putting this together! I am getting a syntax error when running the tool:

https://github.com/Antynea/grub-btrfs/blob/72a3dc092b9dd428593f411cfff79ed030ff81fe/41_snapshots-btrfs#L143-L149

        linux "/vmlinuz-0-rescue-01a9c4cabd6845548641e0d39e45051f" root=UUID=bb616308-e782-4419-8200-269af3026ed4 rd.luks.uuid=luks-bc0ec676-4e95-4373-bdc0-4257f833cad7 rhgb quiet  rd.live.overlay.overlayfs=1 rootflags=compress=zstd:1,x-systemd.devi>,subvol="@/.snapshots/1/snapshot"

The full set of rootflags for that device is compress=zstd:1,x-systemd.device-timeout=0 0 0

Not sure where the cutoff is happening as on my machine

grep -oE '^\s*[^#][[:graph:]]+\s+/\s+btrfs\s+[[:graph:]]+' /etc/fstab | sed -E 's/^.*[[:space:]]([[:graph:]]+)$/\1/;s/,?subvol(id)?=[^,$]+//g;s/^,//'

produces the correct(ish) value but misses the trailing 0

compress=zstd:1,x-systemd.device-timeout=0
arlyon commented 3 months ago

Nevermind it was my snapshot that had the broken fstab, however the additional 0s are still being trimmed