diff options
author | Pellegrino Prevete | 2022-11-19 20:51:25 +0000 |
---|---|---|
committer | Pellegrino Prevete | 2022-11-19 20:51:25 +0000 |
commit | 5db7f6942648b5a331d5c96f22f232d6dc4664a6 (patch) | |
tree | b2701bf11724265485506c59f67b1aff53dd23ee /sd-plymouth.initcpio_install | |
download | aur-plymouth-sigfile.tar.gz |
initial build
Diffstat (limited to 'sd-plymouth.initcpio_install')
-rw-r--r-- | sd-plymouth.initcpio_install | 92 |
1 files changed, 92 insertions, 0 deletions
diff --git a/sd-plymouth.initcpio_install b/sd-plymouth.initcpio_install new file mode 100644 index 000000000000..9944f8979dd5 --- /dev/null +++ b/sd-plymouth.initcpio_install @@ -0,0 +1,92 @@ +#!/bin/bash +# /etc/initcpio/install/sd-plymouth — mkinitcpio/systemd hook for plymouth + +build() { + add_dir /dev/pts + add_dir /usr/share/plymouth/themes + add_dir /run/plymouth + + DATADIR="/usr/share/plymouth" + PLYMOUTH_LOGO_FILE="${DATADIR}/arch-logo.png" + PLYMOUTH_THEME_NAME="$(/usr/bin/plymouth-set-default-theme)" + PLYMOUTH_THEME_DIR="${DATADIR}/themes/${PLYMOUTH_THEME_NAME}" + PLYMOUTH_IMAGE_DIR=$(grep "ImageDir *= *" ${PLYMOUTH_THEME_DIR}/${PLYMOUTH_THEME_NAME}.plymouth | sed 's/ImageDir *= *//') + PLYMOUTH_PLUGIN_PATH="$(plymouth --get-splash-plugin-path)" + PLYMOUTH_MODULE_NAME="$(grep "ModuleName *= *" ${PLYMOUTH_THEME_DIR}/${PLYMOUTH_THEME_NAME}.plymouth | sed 's/ModuleName *= *//')" + + add_binary /usr/bin/plymouthd + add_binary /usr/bin/plymouth + add_binary /usr/lib/plymouth/plymouthd-fd-escrow + + add_file ${DATADIR}/themes/text/text.plymouth + add_binary ${PLYMOUTH_PLUGIN_PATH}/text.so + add_file ${DATADIR}/themes/details/details.plymouth + add_binary ${PLYMOUTH_PLUGIN_PATH}/details.so + + add_file "${PLYMOUTH_LOGO_FILE}" + add_file /etc/os-release + add_file /etc/plymouth/plymouthd.conf + add_file ${DATADIR}/plymouthd.defaults + + + if [ -f "/usr/share/fonts/TTF/DejaVuSans.ttf" -o -f "/usr/share/fonts/cantarell/Cantarell-Thin.otf" ]; then + add_binary ${PLYMOUTH_PLUGIN_PATH}/label.so + add_file "/etc/fonts/fonts.conf" + fi + + if [ -f "/usr/share/fonts/TTF/DejaVuSans.ttf" ]; then + add_file "/usr/share/fonts/TTF/DejaVuSans.ttf" + if [ -f "/etc/fonts/conf.d/57-dejavu-sans.conf" ]; then + add_file "/etc/fonts/conf.d/57-dejavu-sans.conf" + fi + fi + + if [ -f "/usr/share/fonts/cantarell/Cantarell-Thin.otf" ]; then + add_file "/usr/share/fonts/cantarell/Cantarell-Thin.otf" + add_file "/usr/share/fonts/cantarell/Cantarell-Regular.otf" + if [ -f "/etc/fonts/conf.d/60-latin.conf" ]; then + add_file "/etc/fonts/conf.d/60-latin.conf" + fi + fi + + if [ ! -f ${PLYMOUTH_PLUGIN_PATH}/${PLYMOUTH_MODULE_NAME}.so ]; then + echo "The default plymouth plugin (${PLYMOUTH_MODULE_NAME}) doesn't exist" > /dev/stderr + exit 1 + fi + + add_binary ${PLYMOUTH_PLUGIN_PATH}/${PLYMOUTH_MODULE_NAME}.so + + add_binary ${PLYMOUTH_PLUGIN_PATH}/renderers/drm.so + add_binary ${PLYMOUTH_PLUGIN_PATH}/renderers/frame-buffer.so + + if [ -d ${PLYMOUTH_THEME_DIR} ]; then + add_full_dir ${PLYMOUTH_THEME_DIR} + fi + + if [ "${PLYMOUTH_IMAGE_DIR}" != "${PLYMOUTH_THEME_DIR}" -a -d ${PLYMOUTH_IMAGE_DIR} ]; then + add_full_dir ${PLYMOUTH_IMAGE_DIR} + fi + + add_udev_rule 70-uaccess.rules + add_udev_rule 71-seat.rules + + map add_systemd_unit \ + systemd-ask-password-plymouth.path \ + systemd-ask-password-plymouth.service \ + plymouth-halt.service \ + plymouth-kexec.service \ + plymouth-poweroff.service \ + plymouth-quit-wait.service \ + plymouth-quit.service \ + plymouth-read-write.service \ + plymouth-reboot.service \ + plymouth-start.service \ + plymouth-switch-root-initramfs.service \ + plymouth-switch-root.service +} + +help() { + cat <<HELPEOF +This hook includes plymouth in a systemd-based initramfs image. +HELPEOF +} |