]> git.pld-linux.org Git - projects/geninitrd.git/blob - mod-fbsplash.sh
Allow more than 10 md devices.
[projects/geninitrd.git] / mod-fbsplash.sh
1 #!/bin/sh
2 #
3 # geninitrd mod: fbsplash
4 FB_SPLASH=${FB_SPLASH:-no}
5
6 # requires splashutils package to operate
7
8 # setup geninitrd module
9 # @access       public
10 setup_mod_fbsplash() {
11         fbsplash_geninitramfs=$(find_tool /usr/sbin/splash_geninitramfs /usr/bin/splash_geninitramfs)
12         if [ ! -x "$fbsplash_geninitramfs" ]; then
13                 FB_SPLASH=no
14                 return
15         fi
16
17         if is_yes "$FB_SPLASH" && [ "$INITRDFS" != "initramfs" ]; then
18                 warn "Using fbsplash requires INITRDFS=initramfs; skipping fbsplash generation"
19                 FB_SPLASH=no
20         fi
21
22         # NOTE: this check must be also in bootsplash module as the order of module load may change
23         if is_yes "$FB_SPLASH"  && is_yes "$BOOT_SPLASH"; then
24                 warn "bootsplash and fbsplash are exclusive!"
25         fi
26 }
27
28 # find modules for for fbsplash
29 # @access       public
30 find_modules_fbsplash() {
31         if ! is_yes "$FB_SPLASH"; then
32                 return
33         fi
34
35         find_module "-evdev"
36 }
37
38 # generate initrd fragment
39 # @access       public
40 initrd_gen_fbsplash() {
41         debug "Generating fbsplash"
42
43         if [ -r /etc/sysconfig/fbsplash ]; then
44                 . /etc/sysconfig/fbsplash
45         fi
46
47         if [ -z "$SPLASH_THEME" ]; then
48                 warn "Please configure your /etc/sysconfig/fbsplash first."
49                 warn "Generating fbsplashes skipped."
50                 return
51         fi
52
53         if [ -z "$FB_SPLASH_RESOLUTIONS" ]; then
54                 warn "No FB_SPLASH_RESOLUTIONS specified in /etc/sysconfig/fbsplash."
55                 warn "Not adding fbsplash to initramfs."
56                 return
57         fi
58
59         local res
60         for res in $FB_SPLASH_RESOLUTIONS; do
61                 if [ -f "/etc/splash/$SPLASH_THEME/$res.cfg" ]; then
62                         $fbsplash_geninitramfs -c $DESTDIR -r $res $SPLASH_THEME && \
63                         debug "Added $res $SPLASH_THEME theme to initramfs."
64                 else
65                         warn "/etc/splash/$SPLASH_THEME/$res.cfg doesn't exist, skipped"
66                 fi
67         done
68 }
This page took 0.025716 seconds and 3 git commands to generate.