This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "IPFire 2.x development tree". The branch, next has been updated via 62db0b5320a0958b1677191bc177e5dbdaa8d608 (commit) via b25236acf75f47999bc01885c35a0fc80a782023 (commit) via e348f67fa68d34c35a9bab12bd9c8acfc2cadf0f (commit) via 6da6f5dbe2d31c920b4cd1e21d3c3abe0ed1f267 (commit) via ed91103e229b128288a9799a9bbbbe6cd1d7f32d (commit) from 5f04e70f746261430f4600de2e5bff6922a7a511 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 62db0b5320a0958b1677191bc177e5dbdaa8d608 Author: Arne Fitzenreiter Date: Tue Apr 2 19:36:46 2024 +0000 core186: add grub-btrfs initskript changes to updater Signed-off-by: Arne Fitzenreiter commit b25236acf75f47999bc01885c35a0fc80a782023 Author: Stefan Schantl Date: Wed Mar 27 20:39:20 2024 +0100 grub-btrfsd: Drop redundant used PIDFILE mechanism This case is already covered by the PID mechanism of the used functions Signed-off-by: Stefan Schantl Reviewed-by: Michael Tremer Signed-off-by: Arne Fitzenreiter commit e348f67fa68d34c35a9bab12bd9c8acfc2cadf0f Author: Stefan Schantl Date: Wed Mar 27 20:39:19 2024 +0100 grub-btrfsd: Adjust displayed starting message Signed-off-by: Stefan Schantl Reviewed-by: Michael Tremer Signed-off-by: Arne Fitzenreiter commit 6da6f5dbe2d31c920b4cd1e21d3c3abe0ed1f267 Author: Stefan Schantl Date: Wed Mar 27 20:39:18 2024 +0100 grub-btrfsd: Use generic volume_fs_type function for FS detection Signed-off-by: Stefan Schantl Reviewed-by: Michael Tremer Signed-off-by: Arne Fitzenreiter commit ed91103e229b128288a9799a9bbbbe6cd1d7f32d Author: Stefan Schantl Date: Wed Mar 27 20:39:17 2024 +0100 initscripts: Add generic function to get the filesystem type of a volume Signed-off-by: Stefan Schantl Reviewed-by: Michael Tremer Signed-off-by: Arne Fitzenreiter ----------------------------------------------------------------------- Summary of changes: config/rootfiles/core/186/filelists/files | 5 +++++ src/initscripts/system/functions | 8 ++++++++ src/initscripts/system/grub-btrfsd | 21 ++++++++------------- 3 files changed, 21 insertions(+), 13 deletions(-) Difference in files: diff --git a/config/rootfiles/core/186/filelists/files b/config/rootfiles/core/186/filelists/files index 00198bcc3..86c9d666a 100644 --- a/config/rootfiles/core/186/filelists/files +++ b/config/rootfiles/core/186/filelists/files @@ -1 +1,6 @@ +etc/rc.d/init.d/functions +etc/rc.d/init.d/grub-btrfsd +etc/rc.d/rc0.d/K01grub-btrfsd +etc/rc.d/rc3.d/S99grub-btrfsd +etc/rc.d/rc6.d/K01grub-btrfsd srv/web/ipfire/cgi-bin/vulnerabilities.cgi diff --git a/src/initscripts/system/functions b/src/initscripts/system/functions index 5a26aef45..b610143ab 100644 --- a/src/initscripts/system/functions +++ b/src/initscripts/system/functions @@ -883,3 +883,11 @@ running_on_oci() { # We are not running on OCI return 1 } + +volume_fs_type() { + if [ ! -d "${1}" ]; then + return + fi + + stat -f --format="%T" ${1} +} diff --git a/src/initscripts/system/grub-btrfsd b/src/initscripts/system/grub-btrfsd index dc5e32ad4..49073a807 100644 --- a/src/initscripts/system/grub-btrfsd +++ b/src/initscripts/system/grub-btrfsd @@ -25,27 +25,22 @@ 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 Daemon..." + loadproc -b /usr/bin/grub-btrfsd --syslog "$SNAPSHOTDIR" + ;; + esac ;; stop) boot_mesg "Stopping grub-btrfsd..." - killproc -p "$PIDFILE" /usr/bin/grub-btrfsd - sleep 1; + killproc /usr/bin/grub-btrfsd ;; restart) hooks/post-receive -- IPFire 2.x development tree