]>
Commit | Line | Data |
---|---|---|
f12972bc ER |
1 | #!/bin/sh |
2 | # | |
3 | # geninitrd mod: bootsplash | |
4 | ||
5 | # requires bootsplash package to operate | |
6 | BOOT_SPLASH=no | |
7 | ||
8 | # setup geninitrd module | |
9 | # @access public | |
10 | setup_mod_bootsplash() { | |
11 | # NOTE: this check must be also in fbsplash module as the order of module load may change | |
12 | if is_yes "$FB_SPLASH" && is_yes "$BOOT_SPLASH"; then | |
13 | warn "bootsplash and fbsplash are exclusive!" | |
14 | fi | |
15 | } | |
16 | ||
17 | # generate initrd fragment | |
18 | # @access public | |
19 | initrd_gen_bootsplash() { | |
20 | local target="$1" | |
21 | ||
22 | debug "Generating bootsplash" | |
23 | ||
24 | if [ ! -x /bin/splash.bin ]; then | |
25 | warn "Failed to execute /bin/splash.bin. Is bootsplash package installed?" | |
26 | return | |
27 | fi | |
28 | ||
29 | if [ -r /etc/sysconfig/bootsplash ]; then | |
30 | . /etc/sysconfig/bootsplash | |
31 | fi | |
32 | ||
33 | if [ -z "$THEME" ]; then | |
34 | warn "Please configure your /etc/sysconfig/bootsplash first." | |
35 | warn "Generating bootsplashes skipped." | |
36 | return | |
37 | fi | |
38 | ||
39 | if [ -z "$BOOT_SPLASH_RESOLUTIONS" ]; then | |
40 | warn "No BOOT_SPLASH_RESOLUTIONS specified in /etc/sysconfig/bootsplash." | |
41 | warn "Not adding bootsplash to initrd." | |
42 | fi | |
43 | ||
44 | for res in $BOOT_SPLASH_RESOLUTIONS; do | |
45 | if [ -f "/etc/bootsplash/themes/$THEME/config/bootsplash-$res.cfg" ]; then | |
46 | /bin/splash.bin -s -f "/etc/bootsplash/themes/$THEME/config/bootsplash-$res.cfg" >> "$target" && \ | |
47 | debug "Added $res $THEME theme to initrd." | |
48 | else | |
49 | warn "/etc/bootsplash/themes/$THEME/config/bootsplash-$res.cfg doesn't exist, skipped" | |
50 | fi | |
51 | done | |
52 | } |