From 93317a1cf567c9c8d6d4e500eef72dc4ed30c2a9 Mon Sep 17 00:00:00 2001 From: Logan Rathbone Date: Sat, 23 Apr 2022 01:29:11 +0700 Subject: system/efiboots: Added (GTK3 frontend for efibootmgr). Signed-off-by: Willy Sudiarto Raharjo --- system/efiboots/README | 3 + system/efiboots/doinst.sh | 9 ++ .../efiboots-1.0-fix-python-exception.patch | 12 +++ system/efiboots/efiboots.SlackBuild | 101 +++++++++++++++++++++ system/efiboots/efiboots.info | 10 ++ system/efiboots/slack-desc | 19 ++++ 6 files changed, 154 insertions(+) create mode 100644 system/efiboots/README create mode 100644 system/efiboots/doinst.sh create mode 100644 system/efiboots/efiboots-1.0-fix-python-exception.patch create mode 100644 system/efiboots/efiboots.SlackBuild create mode 100644 system/efiboots/efiboots.info create mode 100644 system/efiboots/slack-desc (limited to 'system/efiboots') diff --git a/system/efiboots/README b/system/efiboots/README new file mode 100644 index 000000000000..d799279a7a01 --- /dev/null +++ b/system/efiboots/README @@ -0,0 +1,3 @@ +efiboots is a Python/GTK3 application that acts as a frontend for +efibootmgr. It provides an easy to use interface for managing +UEFI boot options. diff --git a/system/efiboots/doinst.sh b/system/efiboots/doinst.sh new file mode 100644 index 000000000000..65c7e2eeb9aa --- /dev/null +++ b/system/efiboots/doinst.sh @@ -0,0 +1,9 @@ +if [ -x /usr/bin/update-desktop-database ]; then + /usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1 +fi + +if [ -e usr/share/icons/hicolor/icon-theme.cache ]; then + if [ -x /usr/bin/gtk-update-icon-cache ]; then + /usr/bin/gtk-update-icon-cache -f usr/share/icons/hicolor >/dev/null 2>&1 + fi +fi diff --git a/system/efiboots/efiboots-1.0-fix-python-exception.patch b/system/efiboots/efiboots-1.0-fix-python-exception.patch new file mode 100644 index 000000000000..6900f0fd0a46 --- /dev/null +++ b/system/efiboots/efiboots-1.0-fix-python-exception.patch @@ -0,0 +1,12 @@ +diff -Naur efiboots-1.0.orig/efiboots.py efiboots-1.0/efiboots.py +--- efiboots-1.0.orig/efiboots.py 2022-04-12 01:36:59.888996574 -0400 ++++ efiboots-1.0/efiboots.py 2022-04-12 01:37:32.991997960 -0400 +@@ -272,7 +272,7 @@ + boot = run_efibootmgr() + except subprocess.CalledProcessError as e: + logging.exception("Error running efibootmgr. Please check that it is correctly installed.") +- error_dialog(parent=self.window, title="efibootmgr utility not installed!", message="Please check that the efibootmgr utility is correctly installed, as this program requires its output.\n" + e) ++ error_dialog(parent=self.window, title="efibootmgr utility not installed!", message="Please check that the efibootmgr utility is correctly installed, as this program requires its output.\n" + e.output) + sys.exit(-1) + except UnicodeDecodeError as e: + logging.exception("Error decoding efibootmgr -v output.") diff --git a/system/efiboots/efiboots.SlackBuild b/system/efiboots/efiboots.SlackBuild new file mode 100644 index 000000000000..e27d593921f9 --- /dev/null +++ b/system/efiboots/efiboots.SlackBuild @@ -0,0 +1,101 @@ +#!/bin/bash + +# Slackware build script for efiboots + +# Copyright © 2022 Logan Rathbone Province of Ontario, +# Canada. +# +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +cd $(dirname $0) ; CWD=$(pwd) + +PRGNAM=efiboots +VERSION=${VERSION:-1.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} + +if [ "$ARCH" = "i586" ]; then + SLKCFLAGS="-O2 -march=i586 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$VERSION +tar xvf $CWD/$PRGNAM-$VERSION.tar.gz +cd $PRGNAM-$VERSION + +# fix python exception crash if efibootmgr throws an error +patch -p1 < $CWD/efiboots-1.0-fix-python-exception.patch + +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 {} \; + +python3 setup.py install --root=$PKG + +find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ + | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a \ + LICENSE README* \ + $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc +cat $CWD/doinst.sh > $PKG/install/doinst.sh + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE diff --git a/system/efiboots/efiboots.info b/system/efiboots/efiboots.info new file mode 100644 index 000000000000..091eaea5d4ea --- /dev/null +++ b/system/efiboots/efiboots.info @@ -0,0 +1,10 @@ +PRGNAM="efiboots" +VERSION="1.0" +HOMEPAGE="https://github.com/Elinvention/efiboots" +DOWNLOAD="https://github.com/Elinvention/efiboots/archive/refs/tags/1.0/efiboots-1.0.tar.gz" +MD5SUM="a3e5fc6372638a007aa4aebbf2f7fcbd" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="" +MAINTAINER="Logan Rathbone" +EMAIL="poprocks@gmail.com" diff --git a/system/efiboots/slack-desc b/system/efiboots/slack-desc new file mode 100644 index 000000000000..ecd1511708ab --- /dev/null +++ b/system/efiboots/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------------------------------------------------------| +efiboots: efiboots (GTK3 frontend for efibootmgr) +efiboots: +efiboots: efiboots is a Python/GTK3 application that acts as a frontend for +efiboots: efibootmgr. It provides an easy to use interface for managing +efiboots: UEFI boot options. +efiboots: +efiboots: homepage: https://github.com/Elinvention/efiboots +efiboots: +efiboots: +efiboots: +efiboots: -- cgit v1.2.3