diff options
Diffstat (limited to 'scripts/make-boot-splash-raw')
-rwxr-xr-x | scripts/make-boot-splash-raw | 40 |
1 files changed, 11 insertions, 29 deletions
diff --git a/scripts/make-boot-splash-raw b/scripts/make-boot-splash-raw index 5b03e2d..6ebeaa8 100755 --- a/scripts/make-boot-splash-raw +++ b/scripts/make-boot-splash-raw @@ -8,55 +8,37 @@ : ${splash_dir=/usr/share/bootsplash} : ${splash_cfg=/etc/bootsplash} -[ $# = 3 ] || { echo "usage: $0 <initrd> <resolution> <theme>"; exit 1; } +[ $# = 2 ] || { echo "usage: $0 <initrd> <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 +THEME=$2 # 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` - /bin/zcat $initrd_file | cpio-filter --exclude 'bootsplash|etc/splashy|usr/share/splashy/themes' > $tmp_dir/initrd - if [ -x /sbin/splashy ]; then - (echo /etc/splashy/themes ; echo /usr/share/splashy/themes ; /usr/sbin/splashy_find_files ) \ - | perl -MFile::Basename -ne 'm,^/(etc/splashy/.*|usr/share/splashy/.*), and print $1 . "\n" . dirname($1) . "\n"' \ + /bin/zcat $initrd_file | cpio-filter --exclude 'usr/share/plymouth|usr/lib/plymouth|usr/lib64/plymouth' > $tmp_dir/initrd + if [ -x /usr/libexec/plymouth/plymouth-populate-initrd ]; then + /usr/libexec/plymouth/plymouth-populate-initrd -t $tmp_dir/initrd + + (echo /; echo /usr/share/plymouth ; echo /usr/lib/plymouth ; echo /usr/lib64/plymouth ) \ + | perl -MFile::Basename -ne 'm,^/(usr/share/plymouth/.*|usr/lib/plymouth/.*|usr/lib64/plymouth/.*), and print $1 . "\n" . dirname($1) . "\n"' \ | sort -u | (cd / ; cpio -o -c -L --quiet -O $tmp_dir/initrd --append) - elif [[ -x /sbin/splash ]]; then - /sbin/splash -s -f $config > $tmp_dir/bootsplash - echo bootsplash | (cd $tmp_dir ; cpio -o -c --quiet -O $tmp_dir/initrd --append) fi gzip -c $tmp_dir/initrd > $initrd_file rm -rf $tmp_dir else $splash_dir/scripts/remove-boot-splash $initrd_file - if [ -x /sbin/splashy ]; then + if [ -x /usr/libexec/plymouth/plymouth-populate-initrd ]; then tmp_initrd=`mktemp` tmp_dir=`mktemp -d` gzip -dc $initrd_file > $tmp_initrd mount -o loop $tmp_initrd $tmp_dir - rm -rf $tmp_dir/etc/splashy - for f in `/usr/sbin/splashy_find_files | egrep ^/etc/splashy\|/usr/share/splashy/themes`; do - d=`dirname $f` - mkdir -p $tmp_dir$d - cp -aL $f $tmp_dir$d - done + rm -rf $tmp_dir/usr/share/plymouth $tmp_dir/usr/lib*/plymouth + /usr/libexec/plymouth/plymouth-populate-initrd -t $tmp_dir umount $tmp_dir gzip -c $tmp_initrd > $initrd_file rm -f $tmp_initrd - elif [[ -x /sbin/splash ]]; then - /sbin/splash -s -f $config >> $initrd_file - fi fi |