diff options
author | Richard Neumann | 2017-03-22 11:23:10 +0100 |
---|---|---|
committer | Richard Neumann | 2017-03-22 11:23:10 +0100 |
commit | 7264f38686e31c11940b4e32e2b206af9c5e6493 (patch) | |
tree | 03c30c23ba167fbc82c13a7b7ef90bfc5471f080 | |
download | aur-7264f38686e31c11940b4e32e2b206af9c5e6493.tar.gz |
Initial commit
-rw-r--r-- | .SRCINFO | 22 | ||||
-rw-r--r-- | .gitignore | 3 | ||||
-rw-r--r-- | PKGBUILD | 28 | ||||
-rw-r--r-- | fbsplash.hook | 13 | ||||
-rw-r--r-- | fbsplash.install | 11 | ||||
-rwxr-xr-x | mkfbsplash | 75 |
6 files changed, 152 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..51ecd2688b8a --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,22 @@ +# Generated by mksrcinfo v8 +# Wed Mar 22 10:22:57 UTC 2017 +pkgbase = mkinitcpio-fbsplash + pkgdesc = Tools to include a framebuffer based boot splash within the initcpio + pkgver = 1.0.0 + pkgrel = 1 + url = https://aur.archlinux.org/packages/mkinitcpio-fbsplash/ + arch = any + license = GPL3 + makedepends = unzip + makedepends = findutils + depends = bash + optdepends = fbv: for image generation script. + source = fbsplash.hook + source = fbsplash.install + source = mkfbsplash + sha256sums = 37226adfbfdaefa82721735873a5c86d02911032722008ee1eadc1d6a6d6ab55 + sha256sums = d6cc6d4b3ac48b93c79db4b9e61d37c115f51453f6009ba2e3c4d8d8991446d9 + sha256sums = a2dec17047857a6af0308c383a8ba9127ebbd25aa2ebef69b96a66152c3925ec + +pkgname = mkinitcpio-fbsplash + diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..0cfa4c3ebb1b --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +*.pkg.tar.xz +pkg +src diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..da3512506716 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,28 @@ +# Maintainer: Richard Neumann <mail at richard dash neumann period de> + +pkgname='mkinitcpio-fbsplash' +pkgver='1.0.0' +pkgrel=1 +url="https://aur.archlinux.org/packages/${pkgname}/" +pkgdesc='Tools to include a framebuffer based boot splash within the initcpio' +arch=('any') +license=('GPL3') +depends=('bash') +optdepends=('fbv: for image generation script.') +makedepends=('unzip' 'findutils') +source=('fbsplash.hook' 'fbsplash.install' 'mkfbsplash') +sha256sums=('37226adfbfdaefa82721735873a5c86d02911032722008ee1eadc1d6a6d6ab55' + 'd6cc6d4b3ac48b93c79db4b9e61d37c115f51453f6009ba2e3c4d8d8991446d9' + 'a2dec17047857a6af0308c383a8ba9127ebbd25aa2ebef69b96a66152c3925ec') + +package() { + # Install initcpio hook and install script + install -d -m 755 ${pkgdir}/usr/lib/initcpio/{hooks,install} + install -m 644 ${srcdir}/fbsplash.hook ${pkgdir}/usr/lib/initcpio/hooks/fbsplash + install -m 644 ${srcdir}/fbsplash.install ${pkgdir}/usr/lib/initcpio/install/fbsplash + + # Install image generation script + install -d -m 755 ${pkgdir}/usr/bin + install -m 755 ${srcdir}/mkfbsplash ${pkgdir}/usr/bin/ +} + diff --git a/fbsplash.hook b/fbsplash.hook new file mode 100644 index 000000000000..592a30fb133d --- /dev/null +++ b/fbsplash.hook @@ -0,0 +1,13 @@ +#! /usr/bin/bash + +# Copies the splash image into the framebuffer device +run_hook() { + local SPLASH_IMAGE="/etc/splash.fb" + + if [ -f "${SPLASH_IMAGE}" ]; then + dd if=${SPLASH_IMAGE} of=/dev/fb0 2> /dev/null + else + echo "Cannot find ${SPLASH_IMAGE}." + echo "Did you include it in the \"BINARIES=...\" of your /etc/mkinitcpio.conf?" + fi +} diff --git a/fbsplash.install b/fbsplash.install new file mode 100644 index 000000000000..21cb9839f712 --- /dev/null +++ b/fbsplash.install @@ -0,0 +1,11 @@ +#! /usr/bin/bash + +build() { + add_runscript +} + +help() { + cat <<HELPEOF +This hook shows a simple splash screen. +HELPEOF +} diff --git a/mkfbsplash b/mkfbsplash new file mode 100755 index 000000000000..805db47bb84e --- /dev/null +++ b/mkfbsplash @@ -0,0 +1,75 @@ +#! /usr/bin/bash +# +# This file is part of mkinitcpio-fbsplash. +# +# mkinitcpio-fbsplash is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# mkinitcpio-fbsplash is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with mkinitcpio-fbsplash. If not, see <http://www.gnu.org/licenses/>. +# +################################################################################ + +IMAGE= +FB_DEV="/dev/fb0" +OUT_FILE="/etc/splash.fb" +SCRIPT_NAME="$(basename $0)" +DESC="${SCRIPT_NAME} - Generates a framebuffer boot splash from an image file." +USAGE="Usage: + ${SCRIPT_NAME} <image_file> [options]" +OPTIONS="Options: + --dev, -d <framebuffer_device> Specifies the framebuffer device to be used. + Deftaults to ${FB_DEV}. + --file, -f, -o <output_file> Specifies the output file to be written to. + Defaults to ${OUT_FILE}." + +while (($#)); do + case $1 in + "--dev"|"-d") FB_DEV="$2" + shift + ;; + "--file"|"-f"|"-o") OUT_FILE="$2" + shift + ;; + "--help"|"-h") echo -e "${DESC}\n" + echo -e "${USAGE}\n" + echo "${OPTIONS}" + exit 0 + ;; + *) if [ -z "${IMAGE}" ]; then + IMAGE="$1" + else + echo "Unknown parameter: $1" >&2 + echo "${USAGE}" >&2 + exit 1 + fi + esac + shift +done + +if [ -z "${IMAGE}" ]; then + echo "${USAGE}" >&2 + exit 2 +elif [ ! -f "${IMAGE}" ]; then + echo "Selected image does not exist." >&2 + exit 3 +fi + +if [ ${EUID} -ne 0 ]; then + echo "You need to be root to run this script" >&2 + exit 4 +fi + +TEMP=$(mktemp) +clear +/usr/bin/fbv -c -i -d 1 "${IMAGE}" +/usr/bin/cp "${FB_DEV}" "${TEMP}" +/usr/bin/mv -i "${TEMP}" "${OUT_FILE}" +/usr/bin/rm -f "${TEMP}" |