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

detect_rootflags cutting input #327

Open
arlyon opened this issue Mar 28, 2024 · 1 comment
Open

detect_rootflags cutting input #327

arlyon opened this issue Mar 28, 2024 · 1 comment

Comments

@arlyon
Copy link

arlyon commented Mar 28, 2024

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

## Detect rootflags
detect_rootflags()
{
local fstabflags=$(grep -oE '^\s*[^#][[:graph:]]+\s+/\s+btrfs\s+[[:graph:]]+' "${grub_btrfs_mount_point}/${snap_dir_name_trim}/etc/fstab" \
| sed -E 's/^.*[[:space:]]([[:graph:]]+)$/\1/;s/,?subvol(id)?=[^,$]+//g;s/^,//')
rootflags="rootflags=${fstabflags:+$fstabflags,}${GRUB_BTRFS_ROOTFLAGS:+$GRUB_BTRFS_ROOTFLAGS,}"
}

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

arlyon commented Mar 28, 2024

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

@arlyon arlyon closed this as completed Mar 28, 2024
@arlyon arlyon reopened this Mar 28, 2024
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

1 participant