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