OSDN Git Service

[add] : i686/alter-stable
[alterlinux/alterlinux-pkgbuilds.git] / alter-stable / i686 / plymouth / sd-plymouth.initcpio_install
1 #!/bin/bash
2 # /etc/initcpio/install/sd-plymouth — mkinitcpio/systemd hook for plymouth
3
4 build() {
5         add_dir /dev/pts
6         add_dir /usr/share/plymouth/themes
7         add_dir /run/plymouth
8
9         DATADIR="/usr/share"
10         PLYMOUTH_LOGO_FILE="${DATADIR}/plymouth/arch-logo.png"
11         PLYMOUTH_THEME_NAME="$(/usr/bin/plymouth-set-default-theme)"
12         PLYMOUTH_MODULE_NAME="$(grep "ModuleName *= *" ${DATADIR}/plymouth/themes/${PLYMOUTH_THEME_NAME}/${PLYMOUTH_THEME_NAME}.plymouth | sed 's/ModuleName *= *//')"
13         PLYMOUTH_PLUGIN_PATH="$(plymouth --get-splash-plugin-path)"
14
15         add_binary /usr/bin/plymouthd
16         add_binary /usr/bin/plymouth
17
18         add_file ${DATADIR}/plymouth/themes/text/text.plymouth
19         add_binary ${PLYMOUTH_PLUGIN_PATH}/text.so
20         add_file ${DATADIR}/plymouth/themes/details/details.plymouth
21         add_binary ${PLYMOUTH_PLUGIN_PATH}/details.so
22
23         add_file "${PLYMOUTH_LOGO_FILE}"
24         add_file /etc/os-release
25         add_file /etc/plymouth/plymouthd.conf
26         add_file ${DATADIR}/plymouth/plymouthd.defaults
27
28         if [ ! -f ${PLYMOUTH_PLUGIN_PATH}/${PLYMOUTH_MODULE_NAME}.so ]; then
29                 echo "The default plymouth plugin (${PLYMOUTH_MODULE_NAME}) doesn't exist" > /dev/stderr
30                 exit 1
31         fi
32
33         add_binary ${PLYMOUTH_PLUGIN_PATH}/${PLYMOUTH_MODULE_NAME}.so
34
35         add_binary ${PLYMOUTH_PLUGIN_PATH}/renderers/drm.so
36         add_binary ${PLYMOUTH_PLUGIN_PATH}/renderers/frame-buffer.so
37
38         if [ -d ${DATADIR}/plymouth/themes/${PLYMOUTH_THEME_NAME} ]; then
39                 add_full_dir ${DATADIR}/plymouth/themes/${PLYMOUTH_THEME_NAME}
40         fi
41         
42         add_udev_rule 70-uaccess.rules
43         add_udev_rule 71-seat.rules
44
45         map add_systemd_unit \
46                 systemd-ask-password-plymouth.path \
47                 systemd-ask-password-plymouth.service \
48                 plymouth-halt.service \
49                 plymouth-kexec.service \
50                 plymouth-poweroff.service \
51                 plymouth-quit-wait.service \
52                 plymouth-quit.service \
53                 plymouth-read-write.service \
54                 plymouth-reboot.service \
55                 plymouth-start.service \
56                 plymouth-switch-root.service
57 }
58
59 help() {
60         cat <<HELPEOF
61 This hook includes plymouth in a systemd-based initramfs image.
62 HELPEOF
63 }