diff options
Diffstat (limited to 'scripts/make-boot-splash-raw')
-rwxr-xr-x | scripts/make-boot-splash-raw | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/scripts/make-boot-splash-raw b/scripts/make-boot-splash-raw new file mode 100755 index 0000000..e453b55 --- /dev/null +++ b/scripts/make-boot-splash-raw @@ -0,0 +1,49 @@ +#!/bin/sh +# -*- Mode: shell-script -*- +# Copyright (C) 2002 by Chmouel Boudjnah <chmouel@mandrakesoft.com> +# Redistribution of this file is permitted under the terms of the GNU +# Public License (GPL) +# $Id$ + +: ${splash_dir=/usr/share/bootsplash} +: ${splash_cfg=/etc/bootsplash} + +[ $# = 3 ] || { echo "usage: $0 <initrd> <resolution> <theme>"; exit 1; } + +initrd_file=$1 +resolution=$2 +THEME=$3 + +if [[ -f $splash_cfg/themes/$THEME/config/bootsplash-$resolution.cfg ]];then + config=$splash_cfg/themes/$THEME/config/bootsplash-$resolution.cfg +fi + +if [[ -z $config ]];then + echo "Can't find a config file for resolution $resolution"; + exit 1; +fi + +# warly: we cannot use file command which is in /usr/bin/ +# initrd_type=`zcat /boot/initrd-2.6.14-2mdk.ramfs.img | file -` + +if `/bin/zcat $initrd_file 2> /dev/null | /bin/cpio -t &> /dev/null`; then + tmp_dir=`mktemp -d` + pushd $tmp_dir &> /dev/null + /bin/zcat $initrd_file 2>/dev/null | /bin/cpio -id 2>/dev/null + if [[ -x /sbin/splash ]]; then + /sbin/splash -s -f $config > $tmp_dir/bootsplash + else + if [[ -f $tmp_dir/bootsplash ]]; then + rm -f $tmp_dir/bootsplash + fi + fi + /bin/find . -print | cpio --quiet -c -o 2> /dev/null | gzip -c > $initrd_file + popd &> /dev/null + rm -rf $tmp_dir +else + $splash_dir/scripts/remove-boot-splash $initrd_file + + if [[ -x /sbin/splash ]]; then + /sbin/splash -s -f $config >> $initrd_file + fi +fi |