From 1accd5e27212b07ca44860254f2705e79fce62fd Mon Sep 17 00:00:00 2001 From: Antynea Date: Sun, 7 Nov 2021 14:35:17 +0100 Subject: [PATCH] Make name of "grub-script-check" configurable (#177) 41_snapshots-btrfs file: * Remove "grub_script_check" variable Config file; * Make name of "grub-script-check" configurable * Might be 'grub2-script-check' on some systems (Fedora ...) --- 41_snapshots-btrfs | 4 +--- config | 6 ++++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/41_snapshots-btrfs b/41_snapshots-btrfs index fc2a71c..a0f04c0 100644 --- a/41_snapshots-btrfs +++ b/41_snapshots-btrfs @@ -123,8 +123,6 @@ detect_rootflags() | sed -E 's/^.*[[:space:]]([[:graph:]]+)$/\1/;s/,?subvol(id)?=[^,$]+//g;s/^,//') rootflags="rootflags=${fstabflags:+$fstabflags,}${GRUB_BTRFS_ROOTFLAGS:+$GRUB_BTRFS_ROOTFLAGS,}" } -## Path to grub-script-check -grub_script_check="${bindir}/grub-script-check" unmount_grub_btrfs_mount_point() { @@ -570,7 +568,7 @@ if [[ "${count_limit_snap}" = "0" || -z "${count_limit_snap}" ]]; then fi # Make a submenu in GRUB (grub.cfg) and move "grub-btrfs.new" to "grub-btrfs.cfg" header_menu -if ${grub_script_check} "$grub_directory/grub-btrfs.new"; then +if "${bindir}/${GRUB_BTRFS_SCRIPT_CHECK:-grub-script-check}" "$grub_directory/grub-btrfs.new"; then cat "$grub_directory/grub-btrfs.new" > "$grub_directory/grub-btrfs.cfg" rm -f "$grub_directory/grub-btrfs.new" cat << EOF diff --git a/config b/config index 8fc424b..bbaf9d3 100644 --- a/config +++ b/config @@ -106,6 +106,12 @@ GRUB_BTRFS_IGNORE_PREFIX_PATH=("var/lib/docker" "@var/lib/docker" "@/var/lib/doc # Default: grub-mkconfig #GRUB_BTRFS_MKCONFIG=/usr/bin/grub2-mkconfig +# Name of grub-script-check command, use by "grub-btrfs" +# Might be 'grub2-script-check' on some systems (Fedora ...) +# For example, on Fedora : "grub2-script-check" +# Default: grub-script-check +#GRUB_BTRFS_SCRIPT_CHECK=grub2-script-check + # Password protection management for submenu,snapshots # Refer to the Grub documentation https://www.gnu.org/software/grub/manual/grub/grub.html#Authentication-and-authorisation # and this comment https://github.com/Antynea/grub-btrfs/issues/95#issuecomment-682295660