]> git.pld-linux.org Git - projects/geninitrd.git/blame - mod-bootsplash.sh
Timeout here is not a good idea. rootfs cannot be mounted and kernel oopses due to...
[projects/geninitrd.git] / mod-bootsplash.sh
CommitLineData
f12972bc 1#!/bin/sh
f12972bc 2# geninitrd mod: bootsplash
6e49b0b1 3BOOT_SPLASH=${BOOT_SPLASH:-no}
f12972bc
ER
4
5# requires bootsplash package to operate
f12972bc
ER
6
7# setup geninitrd module
8# @access public
9setup_mod_bootsplash() {
2c43306c
ER
10 bootsplash_geninitramfs=$(find_tool /bin/splash.bin)
11 if [ ! -x "$bootsplash_geninitramfs" ]; then
12 BOOT_SPLASH=no
13 fi
14
f12972bc
ER
15 # NOTE: this check must be also in fbsplash module as the order of module load may change
16 if is_yes "$FB_SPLASH" && is_yes "$BOOT_SPLASH"; then
17 warn "bootsplash and fbsplash are exclusive!"
18 fi
19}
20
21# generate initrd fragment
22# @access public
23initrd_gen_bootsplash() {
1b481849
ER
24 if ! is_yes "$BOOT_SPLASH"; then
25 return
26 fi
f12972bc
ER
27 local target="$1"
28
02ba8ab7 29 verbose "Generating bootsplash"
f12972bc
ER
30
31 if [ ! -x /bin/splash.bin ]; then
32 warn "Failed to execute /bin/splash.bin. Is bootsplash package installed?"
33 return
34 fi
35
36 if [ -r /etc/sysconfig/bootsplash ]; then
37 . /etc/sysconfig/bootsplash
38 fi
39
40 if [ -z "$THEME" ]; then
41 warn "Please configure your /etc/sysconfig/bootsplash first."
42 warn "Generating bootsplashes skipped."
43 return
44 fi
45
46 if [ -z "$BOOT_SPLASH_RESOLUTIONS" ]; then
47 warn "No BOOT_SPLASH_RESOLUTIONS specified in /etc/sysconfig/bootsplash."
48 warn "Not adding bootsplash to initrd."
49 fi
50
2c43306c 51 local res
f12972bc
ER
52 for res in $BOOT_SPLASH_RESOLUTIONS; do
53 if [ -f "/etc/bootsplash/themes/$THEME/config/bootsplash-$res.cfg" ]; then
2c43306c 54 $bootsplash_geninitramfs -s -f "/etc/bootsplash/themes/$THEME/config/bootsplash-$res.cfg" >> "$target" && \
02ba8ab7 55 verbose "Added $res $THEME theme to initrd."
f12972bc
ER
56 else
57 warn "/etc/bootsplash/themes/$THEME/config/bootsplash-$res.cfg doesn't exist, skipped"
58 fi
59 done
60}
This page took 0.927802 seconds and 4 git commands to generate.