commit 8b441c189df128fa3c0559efc360086555e3bb76
parent a65c67283c854d5f8dfc67d4757d1751611ef571
Author: Slack Coder <slackcoder@server.ky>
Date: Tue, 17 Feb 2026 09:53:13 -0500
EFI Sync: Fix rc script
Diffstat:
6 files changed, 89 insertions(+), 67 deletions(-)
diff --git a/efi-sync/README b/efi-sync/README
@@ -1,8 +1,8 @@
efi-sync is a program which will update your efi when your kernel or its
related files are updated.
-To have efi-sync to start and stop with your host, add to the beginning of
-/etc/rc.d/rc.local:
+To have efi-sync to start and stop with your host, add to the beginning
+of /etc/rc.d/rc.local:
if [ -x /etc/rc.d/rc.efi-sync ]; then
/etc/rc.d/rc.efi-sync start
@@ -14,6 +14,6 @@ and to /etc/rc.d/rc.local_shutdown (creating it if needed):
/etc/rc.d/rc.efi-sync stop
fi
-Also ensure your EFI is mounted on boot by having its entry configured in
-/etc/fstab. For more instructions, refer to the project's README in this
-packages documentation under /usr/doc.
+Also ensure your EFI is mounted on boot by having its entry configured
+in /etc/fstab. For more instructions, refer to the project's README in
+this packages documentation under /usr/doc.
diff --git a/efi-sync/doinst.sh b/efi-sync/doinst.sh
@@ -22,4 +22,5 @@ preserve_perms() {
config $NEW
}
+config etc/efi-sync.conf.new
preserve_perms etc/rc.d/rc.efi-sync.new
diff --git a/efi-sync/efi-sync.SlackBuild b/efi-sync/efi-sync.SlackBuild
@@ -4,7 +4,7 @@ cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=efi-sync
VERSION=${VERSION:-0.2.1}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
TAG=${TAG:-_slackcoder}
PKGTYPE=${PKGTYPE:-txz}
@@ -56,7 +56,8 @@ cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh
mkdir -p "$PKG/etc/rc.d"
-cp -R "$CWD/files/rc.efi-sync.new" "$PKG/etc/rc.d/"
+install -D -m 0644 "$CWD/file/efi-sync.conf.new" "$PKG/etc/efi-sync.conf.new"
+install -D -m 0644 "$CWD/file/rc.efi-sync.new" "$PKG/etc/rc.d/rc.efi-sync.new"
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE
diff --git a/efi-sync/file/efi-sync.conf.new b/efi-sync/file/efi-sync.conf.new
@@ -0,0 +1,8 @@
+# The kernel path to watch.
+#KERNEL=/boot/vmlinuz
+# The path to the EFI kernel.
+#EFI_KERNEL=/boot/efi/Slackware/vmlinuz
+# The path for the initial ram disk to install.
+#INITRD=/boot/initrd.gz
+# The path to the EFI's initial ram disk.
+#EFI_INITRD=/boot/efi/Slackware/initrd.gz
diff --git a/efi-sync/file/rc.efi-sync.new b/efi-sync/file/rc.efi-sync.new
@@ -0,0 +1,72 @@
+#!/bin/sh
+
+# Time to wait for shutdown before kill service.
+SHUTDOWN_WAIT=60
+
+efi_start() {
+ echo -n "Starting EFI Sync: "
+
+ daemon \
+ --name=efi-sync --pidfiles=/run \
+ --output=/var/log/efi-sync.log \
+ -- efi-sync watch
+
+ sleep 0.5s
+
+ if efi_status | grep "is running" >/dev/null ; then
+ echo "ok"
+ else
+ echo "Failed"
+ fi
+}
+
+efi_stop() {
+ echo -n "Stopping EFI Sync: "
+
+ if efi_status | grep "is running" >/dev/null ; then
+ /usr/bin/daemon --name=efi-sync --pidfiles=/run --stop
+ else
+ echo "Not running"
+ return
+ fi
+
+ for i in $(seq 1 ${SHUTDOWN_WAIT}) ; do
+ if efi_status | grep "is not running" >/dev/null ; then
+ break
+ else
+ sleep 1s
+ fi
+ done
+
+ if efi_status | grep "is not running" >/dev/null ; then
+ echo "Stopped"
+ else
+ /usr/bin/daemon --name=efi-sync --pidfiles=/run --signal=kill
+ echo "Killed"
+ fi
+}
+
+efi_status() {
+ echo -n "EFI Sync is "
+
+ if /usr/bin/daemon --name=efi-sync --pidfiles=/run --running ; then
+ echo "running"
+ else
+ echo "not running"
+ fi
+}
+
+case "$1" in
+start)
+ efi_start
+ ;;
+stop)
+ efi_stop
+ ;;
+status)
+ efi_status
+ ;;
+*)
+ echo $"Usage: $0 {start|stop|status}"
+ exit 1
+esac
diff --git a/efi-sync/files/rc.efi-sync.new b/efi-sync/files/rc.efi-sync.new
@@ -1,60 +0,0 @@
-#!/bin/sh
-#
-# Startup/shutdown script for GNU Taler's exchange.
-#
-
-# Seconds to wait for daemon to shutdown.
-SHUTDOWN_WAIT=60
-
-mkdir -p /run/efi-sync
-
-start() {
- echo "Starting EFI Sync"
-
- daemon \
- --name=efi-sync \
- --pidfiles=/run/efi-sync \
- --output=/var/log/efi-sync.log \
- -- efi-sync watch
-}
-
-stop() {
- echo "Stopping EFI Sync"
-
- if /usr/bin/daemon --pidfiles=/run/efi-sync --name=efi-sync --running ; then
- /usr/bin/daemon --pidfiles=/run/efi-sync --name=efi-sync --stop
- fi
-
- # Wait for daemon to politely shutdown.
- sleep 1
- if /usr/bin/daemon --pidfiles=/run/efi-sync --name=efi-sync --running; then
- echo "Waiting up to ${SHUTDOWN_WAIT} to stop..."
-
- let "count = 0"
- while /usr/bin/daemon --pidfiles=/run/efi-sync --name=efi-sync --running && [[ $count -lt 60 ]]; do
- sleep 1
- let "count = $count + 1"
- done
- fi
-}
-
-status() {
- if /usr/bin/daemon --pidfiles=/run/efi-sync --name=efi-sync --running ; then
- /usr/bin/daemon --pidfiles=/run/efi-sync --name=efi-sync --running --verbose
- fi
-}
-
-case "$1" in
-start)
- start
- ;;
-stop)
- stop
- ;;
-status)
- status
- ;;
-*)
- echo $"Usage: $0 {start|stop|status}"
- exit 1
-esac