From: Stefan Schantl Date: Wed, 27 Mar 2024 05:05:52 +0000 (+0100) Subject: grub-btrfsd: Use generic volume_fs_type function for FS detection X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=09d101ce4e99f4c2558a28f7b17aff8604005e3a;p=people%2Fstevee%2Fipfire-2.x.git grub-btrfsd: Use generic volume_fs_type function for FS detection Signed-off-by: Stefan Schantl --- diff --git a/src/initscripts/system/grub-btrfsd b/src/initscripts/system/grub-btrfsd index dc5e32ad4..90582b1b1 100644 --- a/src/initscripts/system/grub-btrfsd +++ b/src/initscripts/system/grub-btrfsd @@ -25,21 +25,18 @@ SNAPSHOTDIR="/.snapshots" PIDFILE="/run/grub-btrfsd.pid" -root_is_btrfs() { - [ "$(stat -f --format="%T" /)" == "btrfs" ] || return 1 - - return 0 -} - case "$1" in start) - root_is_btrfs || exit 0 + root_fs_type=$(volume_fs_type "/") - boot_mesg "Starting Grub/Btrfs snapshot manager..." - loadproc -b -p "$PIDFILE" /usr/bin/grub-btrfsd --syslog "$SNAPSHOTDIR" + case "$root_fs_type" in + btrfs) - # Store the gained PID to the defined pidfile - echo "$!" > "$PIDFILE" + boot_mesg "Starting Grub/Btrfs snapshot manager..." + loadproc -b -p "$PIDFILE" /usr/bin/grub-btrfsd --syslog "$SNAPSHOTDIR" + echo "$!" > "$PIDFILE" + ;; + esac ;; stop)