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