3 # Add config file, splash-functions and the helper
4 add_file /etc/conf.d/splash
5 add_file /sbin/splash-functions.sh
6 add_binary /sbin/fbcondecor_helper
8 # Get in configuration, parameters and functions
10 . /sbin/splash-functions.sh
12 # Unmount any stale cache tmpfs
17 if [[ $SPLASH_DAEMON = early ]]; then
18 # Add stuff needed to run splash_start function (except optional evdev module)
20 add_binary $spl_daemon
21 if [[ -e /etc/rc.d/functions.d/fbsplash-extras.sh ]]; then
22 . /etc/rc.d/functions.d/fbsplash-extras.sh
23 # Add files from a prepared cache (faking sysinit)
24 splash_cache_prep_initcpio && add_full_dir $spl_cachedir
28 # List file paths contained in given Fbsplash theme cfg files
29 # (Only file paths containing at least one slash will be found by this.)
30 fbsplash_list_paths() {
33 # convert all whitespace into single blanks
34 s,[[:space:]]+, ,g ; t L1
36 # drop comments, grouping directives and blank lines
38 # get a filepath or drop
39 s,.*[ =]([^ ]*/[^ ]+).*,\1, ; t ; d
40 ' "$@" | /usr/bin/sort -u
43 # Check if arg is a theme cfg file path
45 [[ $1 =~ ^/etc/splash/[^/]+/[0-9]+x[0-9]+\.cfg$ ]]
48 # Add all files referenced by path in given theme cfg files
49 # args: <theme-root-dir> <cfg-file>...
50 fbsplash_add_files_from_cfgs() {
51 local file theme_dir=$1; shift
53 if [[ $file == /* ]]; then
55 else # Path may be relative to /etc/splash or theme-dir
57 for file in /etc/splash/$file "$theme_dir"/$file; do
58 [[ -f $file ]] && { add_file $file; found=1; }
60 (( found )) || error "Theme '${theme_dir##*/}': File not found: '$file'"
62 done < <( fbsplash_list_paths "$@" )
65 # Add common files (may be referenced in cfg by plain file name)
67 for file in /etc/splash/*; do
68 [[ -f $file ]] && add_file "$file"
73 for theme in $SPLASH_THEMES; do
74 if [[ -d /etc/splash/$theme && $theme != */* ]]; then
75 add_full_dir /etc/splash/$theme
77 for file in /etc/splash/$theme/*.cfg; do
78 [[ -f $file ]] && fbsplash_is_cfg "$file" && files+=( $file )
80 fbsplash_add_files_from_cfgs /etc/splash/$theme "${files[@]}"
81 elif [[ -f /etc/splash/$theme ]] && fbsplash_is_cfg /etc/splash/$theme; then
82 file=/etc/splash/$theme; theme=${theme%/*}
84 fbsplash_add_files_from_cfgs /etc/splash/$theme $file
85 # Add all non-cfg files from theme dir (may be referenced by plain file name)
86 for file in /etc/splash/$theme/*; do
87 [[ -f $file ]] && ! fbsplash_is_cfg "$file" && add_file "$file"
90 error "Theme invalid or not found: '$theme'"
99 This hook adds the FBconDecor helper and Fbsplash themes and maybe the
100 Fbsplash daemon as specified in /etc/conf.d/splash.