summarylogtreecommitdiffstats
path: root/plymouth.initcpio_install
blob: 2bd0a2ffbe45cf994f8c40f88071d9e796af4781 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#!/bin/bash
# /etc/initcpio/install/plymouth — mkinitcpio 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_file /usr/lib/udev/rules.d/70-uaccess.rules
	add_file /usr/lib/udev/rules.d/71-seat.rules

	# suppress a warning in glib (which the label control uses)
	# about uid 0 by building a dummy NSS stack (LP #649917)
	add_file /etc/passwd
	add_file /etc/nsswitch.conf
	add_binary "$(readlink -e /lib/libnss_files.so.2)"
	add_file /lib/libnss_files.so.2

	add_runscript
}

help() {
	cat <<HELPEOF
This hook includes plymouth in the initramfs image.
HELPEOF
}