mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-20 07:53:01 +02:00
grub-btrfsd: Use generic volume_fs_type function for FS detection
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org> Reviewed-by: Michael Tremer <michael.tremer@ipfire.org> Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
This commit is contained in:
committed by
Arne Fitzenreiter
parent
ed91103e22
commit
6da6f5dbe2
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user