]> git.pld-linux.org Git - projects/geninitrd.git/blame - mod-fbsplash.sh
- allow configuration for USE_xxx from sysconfig/geninitrd. lp#364812
[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() {
11 if is_yes "$FB_SPLASH" && [ "$INITRDFS" != "initramfs" ]; then
12 warn "Using fbsplash requires INITRDFS=initramfs; skipping fbsplash generation"
13 FB_SPLASH=no
14 fi
15
16 # NOTE: this check must be also in bootsplash module as the order of module load may change
17 if is_yes "$FB_SPLASH" && is_yes "$BOOT_SPLASH"; then
18 warn "bootsplash and fbsplash are exclusive!"
19 fi
20}
21
22# find modules for for fbsplash
23# @access public
24find_modules_fbsplash() {
25 if ! is_yes "$FB_SPLASH"; then
26 return
27 fi
28
29 find_module "-evdev"
30}
31
32# generate initrd fragment
33# @access public
34initrd_gen_fbsplash() {
35 debug "Generating fbsplash"
36
37 if [ ! -x /usr/bin/splash_geninitramfs -a ! -x /usr/sbin/splash_geninitramfs ]; then
38 warn "Failed to find splash_geninitramfs. Is splashutils package installed?"
39 return
40 fi
41 local splash_geninitramfs_bin=/usr/sbin/splash_geninitramfs
42 [ -f /usr/bin/splash_geninitramfs ] && splash_geninitramfs_bin=/usr/bin/splash_geninitramfs
43
44 if [ -r /etc/sysconfig/fbsplash ]; then
45 . /etc/sysconfig/fbsplash
46 fi
47
48 if [ -z "$SPLASH_THEME" ]; then
49 warn "Please configure your /etc/sysconfig/fbsplash first."
50 warn "Generating fbsplashes skipped."
51 return
52 fi
53
54 if [ -z "$FB_SPLASH_RESOLUTIONS" ]; then
55 warn "No FB_SPLASH_RESOLUTIONS specified in /etc/sysconfig/fbsplash."
56 warn "Not adding fbsplash to initramfs."
57 return
58 fi
59
60 for res in $FB_SPLASH_RESOLUTIONS; do
61 if [ -f "/etc/splash/$SPLASH_THEME/$res.cfg" ]; then
62 $splash_geninitramfs_bin -c $DESTDIR -r $res $SPLASH_THEME && \
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.074626 seconds and 4 git commands to generate.