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