From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Schantl To: development@lists.ipfire.org Subject: Re: [PATCH 15/17] grub-btrfs: New package Date: Tue, 19 Mar 2024 21:21:10 +0100 Message-ID: <026e8baa5505d9e92c959255998bc7f610d264c3.camel@ipfire.org> In-Reply-To: <2753EE8D-A67D-4EF6-AAFF-0D9A9F7CC90A@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2593601298526075715==" List-Id: --===============2593601298526075715== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Am Montag, dem 18.03.2024 um 16:13 +0000 schrieb Michael Tremer: >=20 >=20 > > On 15 Mar 2024, at 19:14, Stefan Schantl > > wrote: > >=20 > > This kind of grub addon will extend the grub boot menu by a > > additional > > submenu where a BTRFS snapshot can be selected to directly use as > > root > > volume and boot into it. > >=20 > > The grub-btrfsd daemon is using inotify(tools) to watch the > > snapshot directory for > > new or deleted snapshots and calls grub-mkconfig to adjust the > > snapshot grub submenu > >=20 > > Signed-off-by: Stefan Schantl > > --- > > config/rootfiles/common/grub-btrfs=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 | 14 ++++ > > config/rootfiles/common/x86_64/initscripts |=C2=A0 4 ++ > > lfs/grub-btrfs=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | 79 > > ++++++++++++++++++++++ > > lfs/initscripts=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 |=C2=A0 3 + > > make.sh=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 |=C2=A0= 1 + > > src/initscripts/system/grub-btrfsd=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 | 61 +++++++++++++++++ > > 6 files changed, 162 insertions(+) > > create mode 100644 config/rootfiles/common/grub-btrfs > > create mode 100644 lfs/grub-btrfs > > create mode 100644 src/initscripts/system/grub-btrfsd > >=20 > > diff --git a/config/rootfiles/common/grub-btrfs > > b/config/rootfiles/common/grub-btrfs > > new file mode 100644 > > index 000000000..a612af065 > > --- /dev/null > > +++ b/config/rootfiles/common/grub-btrfs > > @@ -0,0 +1,14 @@ > > +boot/grub/grubenv > > +etc/default/grub-btrfs > > +etc/default/grub-btrfs/config > > +etc/grub.d/41_snapshots-btrfs > > +usr/bin/grub-btrfsd > > +#usr/lib/systemd/system/grub-btrfsd.service > > +#usr/share/doc/grub-btrfs > > +#usr/share/doc/grub-btrfs/README.md > > +#usr/share/doc/grub-btrfs/initramfs-overlayfs.md > > +#usr/share/licenses > > +#usr/share/licenses/grub-btrfs > > +#usr/share/licenses/grub-btrfs/LICENSE > > +#usr/share/man/man8/grub-btrfs.8.bz2 > > +#usr/share/man/man8/grub-btrfsd.8.bz2 > > diff --git a/config/rootfiles/common/x86_64/initscripts > > b/config/rootfiles/common/x86_64/initscripts > > index a5e1596fb..2d6fa85dc 100644 > > --- a/config/rootfiles/common/x86_64/initscripts > > +++ b/config/rootfiles/common/x86_64/initscripts > > @@ -26,6 +26,7 @@ etc/rc.d/init.d/firewall > > etc/rc.d/init.d/firstsetup > > etc/rc.d/init.d/fsresize > > etc/rc.d/init.d/functions > > +etc/rc.d/init.d/grub-btrfsd > > etc/rc.d/init.d/halt > > etc/rc.d/init.d/ipsec > > etc/rc.d/init.d/leds > > @@ -92,6 +93,7 @@ etc/rc.d/init.d/vnstat > > etc/rc.d/init.d/waitdrives > > etc/rc.d/init.d/wlanclient > > #etc/rc.d/rc0.d > > +etc/rc.d/rc0.d/K01grub-btrfsd > > #etc/rc.d/rc0.d/K01imspetor > > #etc/rc.d/rc0.d/K01motion > > #etc/rc.d/rc0.d/K01vdradmin > > @@ -135,10 +137,12 @@ etc/rc.d/rc3.d/S32apache > > etc/rc.d/rc3.d/S40fcron > > etc/rc.d/rc3.d/S98rc.local > > #etc/rc.d/rc3.d/S98sslh > > +etc/rc.d/rc3.d/S99grub-btrfsd > > #etc/rc.d/rc3.d/S99imspetor > > #etc/rc.d/rc3.d/S99motion > > #etc/rc.d/rc3.d/S99vdradmin > > #etc/rc.d/rc6.d > > +etc/rc.d/rc6.d/K01grub-btrfsd > > #etc/rc.d/rc6.d/K01imspetor > > #etc/rc.d/rc6.d/K01motion > > #etc/rc.d/rc6.d/K01vdradmin > > diff --git a/lfs/grub-btrfs b/lfs/grub-btrfs > > new file mode 100644 > > index 000000000..8dc0c4f3e > > --- /dev/null > > +++ b/lfs/grub-btrfs > > @@ -0,0 +1,79 @@ > > +################################################################## > > ############# > > +#=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2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=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 # > > +# This program is free software: you can redistribute it and/or > > modify=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 # > > +# it under the terms of the GNU General Public License as > > published by=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 # > > +# the Free Software Foundation, either version 3 of the License, > > or=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 # > > +# (at your option) any later > > version.=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 # > > +#=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 # > > +# This program is distributed in the hope that it will be > > useful,=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 # > > +# but WITHOUT ANY WARRANTY; without even the implied warranty > > of=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 # > > +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.=C2=A0 See > > the=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 # > > +# GNU General Public License for more > > details.=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 # > > +#=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 # > > +# You should have received a copy of the GNU General Public > > License=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 # > > +# along with this program.=C2=A0 If not, see > > .=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 # > > +#=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 # > > +################################################################## > > ############# > > + > > +################################################################## > > ############# > > +# Definitions > > +################################################################## > > ############# > > + > > +include Config > > + > > +VER=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =3D 4.13 > > + > > +THISAPP=C2=A0=C2=A0=C2=A0 =3D grub-btrfs-$(VER) > > +DL_FILE=C2=A0=C2=A0=C2=A0 =3D $(THISAPP).tar.gz > > +DL_FROM=C2=A0=C2=A0=C2=A0 =3D $(URL_IPFIRE) > > +DIR_APP=C2=A0=C2=A0=C2=A0 =3D $(DIR_SRC)/$(THISAPP) > > +TARGET=C2=A0=C2=A0=C2=A0=C2=A0 =3D $(DIR_INFO)/$(THISAPP) > > + > > +################################################################## > > ############# > > +# Top-level Rules > > +################################################################## > > ############# > > + > > +objects =3D $(DL_FILE) > > + > > +$(DL_FILE) =3D $(DL_FROM)/$(DL_FILE) > > + > > +$(DL_FILE)_BLAKE2 =3D > > e2f11a0a8282e3ec8ff8223e3bad70b5d5c5e81b4d740a1bf3554db412dbe48a8a0 > > f216f4e6c65ae1d11c01a27b8b92bae9b470c60d2389505ce089511536e1a > > + > > +install : $(TARGET) > > + > > +check : $(patsubst %,$(DIR_CHK)/%,$(objects)) > > + > > +download :$(patsubst %,$(DIR_DL)/%,$(objects)) > > + > > +b2 : $(subst %,%_BLAKE2,$(objects)) > > + > > +dist: > > + @$(PAK) > > + > > +################################################################## > > ############# > > +# Downloading, checking, b2sum > > +################################################################## > > ############# > > + > > +$(patsubst %,$(DIR_CHK)/%,$(objects)) : > > + @$(CHECK) > > + > > +$(patsubst %,$(DIR_DL)/%,$(objects)) : > > + @$(LOAD) > > + > > +$(subst %,%_BLAKE2,$(objects)) : > > + @$(B2SUM) > > + > > +################################################################## > > ############# > > +# Installation Details > > +################################################################## > > ############# > > + > > +$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) > > + @$(PREBUILD) > > + @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axf > > $(DIR_DL)/$(DL_FILE) > > + $(UPDATE_AUTOMAKE) > > + cd $(DIR_APP) && make install > > + @rm -rf $(DIR_APP) > > + @$(POSTBUILD) > > diff --git a/lfs/initscripts b/lfs/initscripts > > index e078632ab..4d67ee0c4 100644 > > --- a/lfs/initscripts > > +++ b/lfs/initscripts > > @@ -91,6 +91,7 @@ $(TARGET) : > > install -v -m 755 $$i /etc/rc.d/helper/; \ > > done > >=20 > > + ln -sf ../init.d/grub-btrfsd /etc/rc.d/rc0.d/K01grub-btrfsd > > ln -sf ../init.d/imspetor /etc/rc.d/rc0.d/K01imspetor > > ln -sf ../init.d/motion /etc/rc.d/rc0.d/K01motion > > ln -sf ../init.d/vdradmin /etc/rc.d/rc0.d/K01vdradmin > > @@ -132,10 +133,12 @@ $(TARGET) : > > ln -sf ../init.d/fcron /etc/rc.d/rc3.d/S40fcron > > ln -sf ../../sysconfig/rc.local /etc/rc.d/rc3.d/S98rc.local > > ln -sf ../init.d/sslh /etc/rc.d/rc3.d/S98sslh > > + ln -sf ../init.d/grub-btrfsd /etc/rc.d/rc3.d/S99grub-btrfsd > > ln -sf ../init.d/imspetor /etc/rc.d/rc3.d/S99imspetor > > ln -sf ../init.d/motion /etc/rc.d/rc3.d/S99motion > > ln -sf ../init.d/vdradmin /etc/rc.d/rc3.d/S99vdradmin > >=20 > > + ln -sf ../init.d/grub-btrfsd /etc/rc.d/rc6.d/K01grub-btrfsd > > ln -sf ../init.d/imspetor /etc/rc.d/rc6.d/K01imspetor > > ln -sf ../init.d/motion /etc/rc.d/rc6.d/K01motion > > ln -sf ../init.d/vdradmin /etc/rc.d/rc6.d/K01vdradmin > > diff --git a/make.sh b/make.sh > > index 30bd5f16b..0aa3d26af 100755 > > --- a/make.sh > > +++ b/make.sh > > @@ -1713,6 +1713,7 @@ buildipfire() { > > =C2=A0 lfsmake2 mympd > > =C2=A0 lfsmake2 btrfs-progs > > =C2=A0 lfsmake2 inotify-tools > > +=C2=A0 lfsmake2 grub-btrfs > >=20 > > =C2=A0 # Kernelbuild ... current we have no platform that need > > =C2=A0 # multi kernel builds so KCFG is empty > > diff --git a/src/initscripts/system/grub-btrfsd > > b/src/initscripts/system/grub-btrfsd > > new file mode 100644 > > index 000000000..833f90cb1 > > --- /dev/null > > +++ b/src/initscripts/system/grub-btrfsd > > @@ -0,0 +1,61 @@ > > +#!/bin/sh > > +################################################################## > > ############# > > +#=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A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A0=C2=A0=C2=A0 > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 # > > +# This program is free software: you can redistribute it and/or > > modify=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 # > > +# it under the terms of the GNU General Public License as > > published by=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 # > > +# the Free Software Foundation, either version 3 of the License, > > or=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 # > > +# (at your option) any later > > version.=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 # > > +#=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 # > > +# This program is distributed in the hope that it will be > > useful,=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 # > > +# but WITHOUT ANY WARRANTY; without even the implied warranty > > of=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 # > > +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.=C2=A0 See > > the=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 # > > +# GNU General Public License for more > > details.=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 # > > +#=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 # > > +# You should have received a copy of the GNU General Public > > License=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 # > > +# along with this program.=C2=A0 If not, see > > .=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 # > > +#=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 # > > +################################################################## > > ############# > > + > > +. /etc/sysconfig/rc > > +. ${rc_functions} > > + > > +SNAPSHOTDIR=3D"/.snapshots" > > +PIDFILE=3D"/run/grub-btrfsd.pid" > > + > > +root_is_btrfs() { > > +=C2=A0=C2=A0=C2=A0 [ "$(stat -f --format=3D"%T" /)" =3D=3D "btrfs" ] || = return 1 > > + > > +=C2=A0=C2=A0=C2=A0 return 0 > > +} > > + > > +case "$1" in > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 start) > > + root_is_btrfs || exit 0 > > + > > + boot_mesg "Starting grub-btrfsd..." >=20 > Please give this a more human-readable name. Like the other services > :) Okay, any suggestions? >=20 > > + loadproc -b -p "$PIDFILE" /usr/bin/grub-btrfsd --syslog > > "$SNAPSHOTDIR" > > + > > + # Store the gained PID to the defined pidfile > > + echo "$!" > "$PIDFILE" > > + ;; > > + > > + stop) > > + boot_mesg "Stopping grub-btrfsd..." > > + killproc -p "$PIDFILE" /usr/bin/grub-btrfsd > > + sleep 1; > > + ;; > > + > > + restart) > > + $0 stop > > + sleep 2 > > + $0 start > > + ;; > > + > > + *) > > + echo "Usage: $0 {start|stop|restart}" > > + exit 1 > > + ;; > > +esac > > --=20 > > 2.39.2 > >=20 >=20 --===============2593601298526075715==--