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