sd-plymouth.initcpio_install 2.0 KB

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