--- /dev/null
+Dracut gensplash module
+-----------------------
+
+INDEX
+
+0. Introduction
+1. Hostonly vs Generic
+2. Configuration and kernel parameters
+
+~
+
+0. Introduction
+
+gensplash is based on Genkernel code and that's why it's Gentoo-specific. It
+requires splashutils to work. To set up theme you may edit /etc/conf.d/splash
+or set DRACUT_GENSPLASH_THEME and DRACUT_GENSPLASH_RES variables. Your theme
+has to exist in /etc/splash and for every given resolution has to exist config
+in theme's directory, e.g. there's 1024x768.cfg in /etc/splash/natural_gentoo.
+List of resolutions is comma-separated.
+
+NOTE: The module will be rewritten to be distro-neutral. Its name will change
+to fbsplash.
+
+
+1. Hostonly vs Generic
+
+All available themes are installed only if no --hostonly is specified and no
+DRACUT_GENSPLASH_THEME and DRACUT_GENSPLASH_RES are set. Otherwise those vars
+are checked and if not set then config /etc/conf.d/splash is read.
+
+
+2. Configuration and kernel parameters
+
+Example set up by environment variables:
+ DRACUT_GENSPLASH_THEME=natural_gentoo
+ DRACUT_GENSPLASH_RES=1024x768,1024x600
+
+Example kernel arguments:
+ splash=silent,theme:natural_gentoo console=tty1 quiet
+
+You may easily set up the module using Genkernel with arguments:
+ --gensplash=<theme>:<res1>,<res2>,...
--- /dev/null
+#!/bin/bash
+
+# TODO: splash_geninitramfs
+# TODO: /usr/share/splashutils/initrd.splash
+exit 255
--- /dev/null
+#!/bin/sh
+
+CDROOT=0
+. /lib/gensplash-lib.sh
+splash verbose
--- /dev/null
+#!/bin/sh
+
+CDROOT=0
+. /lib/gensplash-lib.sh
+splash set_msg 'Switching to new root'
--- /dev/null
+#!/bin/sh
+
+if ! getarg rd_NO_SPLASH; then
+ [ -c /dev/null ] || mknod /dev/null c 1 3
+ [ -c /dev/console ] || mknod /dev/console c 5 1
+ [ -c /dev/tty0 ] || mknod /dev/tty0 c 4 0
+
+ info "Starting Gentoo Splash"
+
+ /lib/udev/console_init tty0
+ CDROOT=0
+ . /lib/gensplash-lib.sh
+ splash init
+fi
--- /dev/null
+#!/bin/bash
+
+call_splash_geninitramfs() {
+ local out ret
+
+ out=$(splash_geninitramfs -c "$1" ${@:2} 2>&1)
+ ret=$?
+
+ if [[ ${out} ]]; then
+ local IFS='
+'
+ for line in ${out}; do
+ if [[ ${line} =~ ^Warning ]]; then
+ dwarning "${line}"
+ else
+ derror "${line}"
+ (( ret == 0 )) && ret=1
+ fi
+ done
+ fi
+
+ return ${ret}
+}
+
+
+type -P splash_geninitramfs >/dev/null || exit 1
+
+opts=''
+
+if [[ ${DRACUT_GENSPLASH_THEME} ]]; then
+ # Variables from the environment
+ # They're supposed to be set up by e.g. Genkernel in basis of cmdline args.
+ # If user set them he/she would expect to be included only given theme
+ # rather then all even if we're building generic initramfs.
+ SPLASH_THEME=${DRACUT_GENSPLASH_THEME}
+ SPLASH_RES=${DRACUT_GENSPLASH_RES}
+elif [[ ${hostonly} ]]; then
+ # Settings from config only in hostonly
+ [[ -e /etc/conf.d/splash ]] && source /etc/conf.d/splash
+ [[ ! ${SPLASH_THEME} ]] && SPLASH_THEME=default
+ [[ ${SPLASH_RES} ]] && opts+=" -r ${SPLASH_RES}"
+else
+ # generic
+ SPLASH_THEME=--all
+fi
+
+dinfo "Installing Gentoo Splash (using the ${SPLASH_THEME} theme)"
+
+pushd "${initdir}" >/dev/null
+mv dev dev.old
+call_splash_geninitramfs "${initdir}" ${opts} ${SPLASH_THEME} || {
+ derror "Could not build splash"
+ exit 1
+}
+rm -rf dev
+mv dev.old dev
+popd >/dev/null
+
+dracut_install chvt
+inst /usr/share/splashutils/initrd.splash /lib/gensplash-lib.sh
+inst_hook pre-pivot 90 "${moddir}"/gensplash-newroot.sh
+inst_hook pre-trigger 10 "${moddir}"/gensplash-pretrigger.sh
+inst_hook emergency 50 "${moddir}"/gensplash-emergency.sh