aboutsummaryrefslogtreecommitdiff
path: root/system
diff options
context:
space:
mode:
authorSlack Coder <slackcoder@server.ky>2024-05-04 09:24:32 +0900
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2024-05-04 21:45:20 +0700
commitc67b91cac93d4def8bb662d6d5b6b02cde237e44 (patch)
treea973a0a21c51e35358939d2fb2bccffa35d199c6 /system
parentf4116510b0d888e7bf53196d748ecc0d1240311a (diff)
downloadslackbuilds-c67b91cac93d4def8bb662d6d5b6b02cde237e44.tar.xz
system/efi-sync: Added (EFI auto update).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system')
-rw-r--r--system/efi-sync/README19
-rw-r--r--system/efi-sync/doinst.sh25
-rw-r--r--system/efi-sync/efi-sync.SlackBuild62
-rw-r--r--system/efi-sync/efi-sync.info10
-rw-r--r--system/efi-sync/files/rc.efi-sync.new60
-rw-r--r--system/efi-sync/slack-desc19
6 files changed, 195 insertions, 0 deletions
diff --git a/system/efi-sync/README b/system/efi-sync/README
new file mode 100644
index 0000000000..71a5cef40a
--- /dev/null
+++ b/system/efi-sync/README
@@ -0,0 +1,19 @@
+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:
+
+ if [ -x /etc/rc.d/rc.efi-sync ]; then
+ /etc/rc.d/rc.efi-sync start
+ fi
+
+and to /etc/rc.d/rc.local_shutdown (creating it if needed):
+
+ if [ -x /etc/rc.d/rc.efi-sync ]; then
+ /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.
diff --git a/system/efi-sync/doinst.sh b/system/efi-sync/doinst.sh
new file mode 100644
index 0000000000..519c0d5c0d
--- /dev/null
+++ b/system/efi-sync/doinst.sh
@@ -0,0 +1,25 @@
+config() {
+ NEW="$1"
+ OLD="$(dirname $NEW)/$(basename $NEW .new)"
+ # If there's no config file by that name, mv it over:
+ if [ ! -r $OLD ]; then
+ mv $NEW $OLD
+ elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
+ # toss the redundant copy
+ rm $NEW
+ fi
+ # Otherwise, we leave the .new copy for the admin to consider...
+}
+
+preserve_perms() {
+ NEW="$1"
+ OLD="$(dirname $NEW)/$(basename $NEW .new)"
+ if [ -e $OLD ]; then
+ cp -a $OLD ${NEW}.incoming
+ cat $NEW > ${NEW}.incoming
+ mv ${NEW}.incoming $NEW
+ fi
+ config $NEW
+}
+
+preserve_perms etc/rc.d/rc.efi-sync.new
diff --git a/system/efi-sync/efi-sync.SlackBuild b/system/efi-sync/efi-sync.SlackBuild
new file mode 100644
index 0000000000..e9a06ee65a
--- /dev/null
+++ b/system/efi-sync/efi-sync.SlackBuild
@@ -0,0 +1,62 @@
+#!/bin/bash
+
+cd $(dirname $0) ; CWD=$(pwd)
+
+PRGNAM=efi-sync
+VERSION=${VERSION:-0.2.0}
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+PKGTYPE=${PKGTYPE:-tgz}
+
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) ARCH=i586 ;;
+ arm*) ARCH=arm ;;
+ *) ARCH=$( uname -m ) ;;
+ esac
+fi
+
+if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
+ echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
+ exit 0
+fi
+
+TMP=${TMP:-/tmp/SBo}
+PKG=$TMP/package-$PRGNAM
+OUTPUT=${OUTPUT:-/tmp}
+
+set -e
+
+rm -rf $PKG
+mkdir -p $TMP $PKG $OUTPUT
+cd $TMP
+rm -rf $PRGNAM-$VERSION
+tar xvf $CWD/$PRGNAM-$VERSION.tar.xz
+cd $PRGNAM-$VERSION
+chown -R root:root .
+find -L . \
+ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
+ -o -perm 511 \) -exec chmod 755 {} \; -o \
+ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
+ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+
+mkdir -p $PKG/usr/sbin
+cp efi-sync $PKG/usr/sbin/
+chmod +x $PKG/usr/sbin/efi-sync
+
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+cp -a \
+ README.md \
+ $PKG/usr/doc/$PRGNAM-$VERSION
+cp "$CWD/README" "$PKG/usr/doc/$PRGNAM-$VERSION/README_slackware.md"
+
+mkdir -p $PKG/install
+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/"
+
+cd $PKG
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-0.2.0-$ARCH-$BUILD$TAG.$PKGTYPE
diff --git a/system/efi-sync/efi-sync.info b/system/efi-sync/efi-sync.info
new file mode 100644
index 0000000000..166c307260
--- /dev/null
+++ b/system/efi-sync/efi-sync.info
@@ -0,0 +1,10 @@
+PRGNAM="efi-sync"
+VERSION="0.2.0"
+HOMEPAGE="https://git.server.ky/slackcoder/efi-sync"
+DOWNLOAD="https://git.server.ky/slackcoder/efi-sync/snapshot/efi-sync-0.2.0.tar.xz"
+MD5SUM="9da8ebe6f6bcf30e0b8304c641c72396"
+DOWNLOAD_x86_64=""
+MD5SUM_x86_64=""
+REQUIRES=""
+MAINTAINER="Slack Coder"
+EMAIL="slackcoder@server.ky"
diff --git a/system/efi-sync/files/rc.efi-sync.new b/system/efi-sync/files/rc.efi-sync.new
new file mode 100644
index 0000000000..727c93b84a
--- /dev/null
+++ b/system/efi-sync/files/rc.efi-sync.new
@@ -0,0 +1,60 @@
+#!/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
diff --git a/system/efi-sync/slack-desc b/system/efi-sync/slack-desc
new file mode 100644
index 0000000000..1c4590c6f1
--- /dev/null
+++ b/system/efi-sync/slack-desc
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description.
+# Line up the first '|' above the ':' following the base package name, and
+# the '|' on the right side marks the last column you can put a character in.
+# You must make exactly 11 lines for the formatting to be correct. It's also
+# customary to leave one space after the ':' except on otherwise blank lines.
+
+ |-----handy-ruler------------------------------------------------------|
+efi-sync: efi-sync (Kernel EFI installer)
+efi-sync:
+efi-sync: Automatically install your kernel into the EFI on updates.
+efi-sync:
+efi-sync:
+efi-sync:
+efi-sync:
+efi-sync:
+efi-sync:
+efi-sync:
+efi-sync: