]> git.pld-linux.org Git - projects/geninitrd.git/blob - mod-condecor.sh
no need to mess with magic values, let the "magic" be value
[projects/geninitrd.git] / mod-condecor.sh
1 #!/bin/sh
2 CONDECOR_RCSID='$Revision$ $Date::                            $'
3
4 # geninitrd mod: condecor
5 FB_CON_DECOR=${FB_CON_DECOR:-no}
6
7 # requires splashutils package to operate
8
9 # setup geninitrd module
10 # @access       public
11 setup_mod_condecor() {
12         condecor_geninitramfs=$(find_tool /usr/sbin/splash_geninitramfs /usr/bin/splash_geninitramfs)
13         if [ ! -x "$condecor_geninitramfs" ]; then
14                 FB_CON_DECOR=no
15         fi
16
17         if is_yes "$FB_CON_DECOR" && [ "$INITRDFS" != "initramfs" ]; then
18                 warn "Using fbcondecor requires INITRDFS=initramfs; skipping fbcondecor generation"
19                 FB_CON_DECOR=no
20         fi
21 }
22
23 # generate initrd fragment
24 # @access       public
25 initrd_gen_fbcondecor() {
26         if ! is_yes "$FB_CON_DECOR"; then
27                 return
28         fi
29         debug "Generating fbcondecor"
30
31         if [ -r /etc/sysconfig/splash ]; then
32                 . /etc/sysconfig/splash
33         fi
34
35         if [ -z "$SPLASH_THEME" ]; then
36                 warn "Please configure your /etc/sysconfig/splash first."
37                 warn "Generating of splashes skipped."
38                 return
39         fi
40
41         if [ -z "$FB_SPLASH_RESOLUTIONS" ]; then
42                 warn "No FB_SPLASH_RESOLUTIONS specified in /etc/sysconfig/splash."
43                 warn "Not adding fbcondecor to initramfs."
44                 return
45         fi
46
47         local res
48         for res in $FB_SPLASH_RESOLUTIONS; do
49                 if [ -f "/etc/splash/$SPLASH_THEME/$res.cfg" ]; then
50                         $condecor_geninitramfs -c $DESTDIR -r $res $SPLASH_THEME && \
51                         debug "Added $res $SPLASH_THEME theme to initramfs."
52                 else
53                         warn "/etc/splash/$SPLASH_THEME/$res.cfg doesn't exist, skipped"
54                 fi
55         done
56 }
This page took 0.046095 seconds and 3 git commands to generate.