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 ...)
This commit is contained in:
Antynea
2021-11-07 14:35:17 +01:00
committed by GitHub
parent 2500ce8d30
commit 1accd5e272
2 changed files with 7 additions and 3 deletions

View File

@@ -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

6
config
View File

@@ -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