diff options
Diffstat (limited to 'efi-sync')
-rw-r--r-- | efi-sync/README | 19 | ||||
-rw-r--r-- | efi-sync/doinst.sh | 14 | ||||
-rw-r--r-- | efi-sync/efi-sync.SlackBuild | 55 | ||||
-rw-r--r-- | efi-sync/efi-sync.info | 8 | ||||
-rw-r--r-- | efi-sync/files/rc.efi-sync.new | 62 | ||||
-rw-r--r-- | efi-sync/slack-desc | 5 |
6 files changed, 163 insertions, 0 deletions
diff --git a/efi-sync/README b/efi-sync/README new file mode 100644 index 0000000..e055ad8 --- /dev/null +++ b/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. If you use an initial ram disk (initrd), ensure +OUTPUT_IMAGE="/boot/initrd.gz" is configured to your EFI's initrd path. diff --git a/efi-sync/doinst.sh b/efi-sync/doinst.sh new file mode 100644 index 0000000..45cc593 --- /dev/null +++ b/efi-sync/doinst.sh @@ -0,0 +1,14 @@ +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... +} + +config etc/rc.d/rc.efi-sync.new diff --git a/efi-sync/efi-sync.SlackBuild b/efi-sync/efi-sync.SlackBuild new file mode 100644 index 0000000..08f7961 --- /dev/null +++ b/efi-sync/efi-sync.SlackBuild @@ -0,0 +1,55 @@ +#!/bin/sh + +PRGNAM=efi-sync +VERSION=${VERSION:-0.1.0} +BUILD=${BUILD:-1} +TAG=${TAG:-_slackcoder} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i586 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +CWD=$(pwd) +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.1.0-$ARCH-$BUILD$TAG.${PKGTYPE:-txz} diff --git a/efi-sync/efi-sync.info b/efi-sync/efi-sync.info new file mode 100644 index 0000000..632dff4 --- /dev/null +++ b/efi-sync/efi-sync.info @@ -0,0 +1,8 @@ +PRGNAM="efi-sync" +VERSION="0.1.0" +HOMEPAGE="https://git.server.ky/slackcoder/efi-sync" +DOWNLOAD="https://git.server.ky/slackcoder/efi-sync/snapshot/efi-sync-0.1.0.tar.xz" +MD5SUM="c4366ab8e5cb88d50f50c137f3f3f43c" +REQUIRES="" +MAINTAINER="Slack Coder" +EMAIL="slackcoder@server.ky" diff --git a/efi-sync/files/rc.efi-sync.new b/efi-sync/files/rc.efi-sync.new new file mode 100644 index 0000000..bd301ed --- /dev/null +++ b/efi-sync/files/rc.efi-sync.new @@ -0,0 +1,62 @@ +#!/bin/sh +# +# Startup/shutdown script for GNU Taler's exchange. +# + +PATH=$PATH:/usr/local/sbin + +# 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/efi-sync/slack-desc b/efi-sync/slack-desc new file mode 100644 index 0000000..e88de34 --- /dev/null +++ b/efi-sync/slack-desc @@ -0,0 +1,5 @@ + |-----handy-ruler------------------------------------------------------| +efi-sync: efi-sync +efi-sync: +efi-sync: Automatically install your kernel into the EFI. +efi-sync: |