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