]> git.pld-linux.org Git - projects/geninitrd.git/blame - mod-fbsplash.sh
- cosmetics and setup like other mods
[projects/geninitrd.git] / mod-fbsplash.sh
CommitLineData
bf6d9c64
ER
1#!/bin/sh
2#
3# geninitrd mod: fbsplash
6e49b0b1 4FB_SPLASH=${FB_SPLASH:-no}
bf6d9c64
ER
5
6# requires splashutils package to operate
bf6d9c64
ER
7
8# setup geninitrd module
9# @access public
10setup_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
30find_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
40initrd_gen_fbsplash() {
41 debug "Generating fbsplash"
42
bf6d9c64
ER
43 if [ -r /etc/sysconfig/fbsplash ]; then
44 . /etc/sysconfig/fbsplash
45 fi
46
47 if [ -z "$SPLASH_THEME" ]; then
48 warn "Please configure your /etc/sysconfig/fbsplash first."
49 warn "Generating fbsplashes skipped."
50 return
51 fi
52
53 if [ -z "$FB_SPLASH_RESOLUTIONS" ]; then
54 warn "No FB_SPLASH_RESOLUTIONS specified in /etc/sysconfig/fbsplash."
55 warn "Not adding fbsplash to initramfs."
56 return
57 fi
58
2c43306c 59 local res
bf6d9c64
ER
60 for res in $FB_SPLASH_RESOLUTIONS; do
61 if [ -f "/etc/splash/$SPLASH_THEME/$res.cfg" ]; then
2c43306c 62 $fbsplash_geninitramfs -c $DESTDIR -r $res $SPLASH_THEME && \
bf6d9c64
ER
63 debug "Added $res $SPLASH_THEME theme to initramfs."
64 else
65 warn "/etc/splash/$SPLASH_THEME/$res.cfg doesn't exist, skipped"
66 fi
67 done
68}
This page took 0.037024 seconds and 4 git commands to generate.