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