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