From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Tremer To: development@lists.ipfire.org Subject: Re: [PATCHv2 2/4] grub-btrfsd: Use generic volume_fs_type function for FS detection Date: Thu, 28 Mar 2024 10:32:04 +0000 Message-ID: <77EE6F05-23D1-46DC-A1D8-0C5F46E14947@ipfire.org> In-Reply-To: <20240327193920.14311-2-stefan.schantl@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7587279832032876773==" List-Id: --===============7587279832032876773== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Reviewed-by: Michael Tremer > On 27 Mar 2024, at 19:39, Stefan Schantl wrot= e: >=20 > Signed-off-by: Stefan Schantl > --- > src/initscripts/system/grub-btrfsd | 19 ++++++++----------- > 1 file changed, 8 insertions(+), 11 deletions(-) >=20 > diff --git a/src/initscripts/system/grub-btrfsd b/src/initscripts/system/gr= ub-btrfsd > index dc5e32ad4..90582b1b1 100644 > --- a/src/initscripts/system/grub-btrfsd > +++ b/src/initscripts/system/grub-btrfsd > @@ -25,21 +25,18 @@ > SNAPSHOTDIR=3D"/.snapshots" > PIDFILE=3D"/run/grub-btrfsd.pid" >=20 > -root_is_btrfs() { > - [ "$(stat -f --format=3D"%T" /)" =3D=3D "btrfs" ] || return 1 > - > - return 0 > -} > - > case "$1" in > start) > - root_is_btrfs || exit 0 > + root_fs_type=3D$(volume_fs_type "/") >=20 > - boot_mesg "Starting Grub/Btrfs snapshot manager..." > - loadproc -b -p "$PIDFILE" /usr/bin/grub-btrfsd --syslog "$SNAPSHOTDIR" > + case "$root_fs_type" in > + btrfs) >=20 > - # 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 > ;; >=20 > stop) > --=20 > 2.39.2 >=20 --===============7587279832032876773==--