--- mkinitrd.orig	2009-10-26 10:53:04.000000000 +0000
+++ mkinitrd	2009-10-26 10:54:11.000000000 +0000
@@ -86,6 +86,7 @@
 IMAGESIZE=8000
 PRESCSIMODS="sd_mod"
 fstab="/etc/fstab"
+theme=""
 
 vg_list=""
 net_list="$NET_LIST"
@@ -123,7 +124,7 @@
     $cmd "       [--force-ide-probe] [--force-scsi-probe | --omit-scsi-modules]"
     $cmd "       [--image-version] [--force-raid-probe | --omit-raid-modules]"
     $cmd "       [--with=<module>] [--force-lvm-probe | --omit-lvm-modules]"
-    $cmd "       [--builtin=<module>] [--net-dev=<interface>] [--with-fips]"
+    $cmd "       [--builtin=<module>] [--net-dev=<interface>] [--theme=<theme dir>] [--with-fips]"
     $cmd "       [--without-usb] [--without-multipath] [--without-dmraid]"
     $cmd "       [--fstab=<fstab>] [--nocompress] <initrd-image> <kernel-version>"
     $cmd ""
@@ -908,6 +909,15 @@
 
 while [ $# -gt 0 ]; do
     case $1 in
+        --theme*)
+            if [ "$1" != "${1##--theme=}" ]; then
+                theme=${1##--theme=}
+            else
+                theme=$2
+                shift
+            fi
+            ;;
+            
         --fstab*)
             if [ "$1" != "${1##--fstab=}" ]; then
                 fstab=${1##--fstab=}
@@ -1547,6 +1557,9 @@
 mknod $MNTIMAGE/dev/console c 5 1
 mknod $MNTIMAGE/dev/ptmx c 5 2
 mknod $MNTIMAGE/dev/rtc c 10 135
+if [ "$theme" ]; then
+    mknod $MNTIMAGE/dev/fb0 c 29 0
+fi
 if [ "$(uname -m)" == "ia64" ]; then
     mknod $MNTIMAGE/dev/efirtc c 10 136
 fi
@@ -1757,6 +1770,36 @@
     emit "mknod /dev/ttyS$i c 4 $(($i + 64))"
 done
 
+if [ "$theme" -a -f /usr/bin/fbi ]; then
+    cp -a `modprobe --set-version $kernel --show-depends softcursor 2>/dev/null | awk '/^insmod / { print $2; }' | tail -1` $MNTIMAGE/lib
+    cp -a `modprobe --set-version $kernel --show-depends bitblit 2>/dev/null | awk '/^insmod / { print $2; }' | tail -1` $MNTIMAGE/lib
+    cp -a `modprobe --set-version $kernel --show-depends tileblit 2>/dev/null | awk '/^insmod / { print $2; }' | tail -1` $MNTIMAGE/lib
+    cp -a `modprobe --set-version $kernel --show-depends font 2>/dev/null | awk '/^insmod / { print $2; }' | tail -1` $MNTIMAGE/lib
+    cp -a `modprobe --set-version $kernel --show-depends fbcon 2>/dev/null | awk '/^insmod / { print $2; }' | tail -1` $MNTIMAGE/lib
+    cp -a "$theme"/* $MNTIMAGE/etc
+    cp -a /usr/bin/fbi $MNTIMAGE/bin
+    gunzip < /lib/kbd/consolefonts/lat1-16.psfu.gz > $MNTIMAGE/etc/lat1-16.psfu
+    images=""
+    count=0
+    for i in `ls "$theme"`
+    do
+        images="$images /etc/$i"
+        count=$(( $count + 1 ))
+    done
+    timeout=""
+    if test $count -gt 1; then
+        timeout="-t 0"
+    fi
+
+    emit "mknod /dev/fb0 c 29 0"
+    emit "insmod /lib/softcursor.ko"
+    emit "insmod /lib/bitblit.ko"
+    emit "insmod /lib/tileblit.ko"
+    emit "insmod /lib/font.ko"
+    emit "insmod /lib/fbcon.ko"
+    emit "/bin/fbi $timeout -f /etc/lat1-16.psfu -q $images"
+fi
+
 emit "echo Setting up hotplug."
 emit "hotplug"
 
