aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnssi Hannula <anssi@mageia.org>2011-12-19 04:49:59 +0000
committerAnssi Hannula <anssi@mageia.org>2011-12-19 04:49:59 +0000
commit9239922792d02aa6e2d2908ad99c3c81e7403492 (patch)
tree47e8c50f2ebeb14206d3052aa5f415a2c4ef0ac8
parentaaef57ddb7b50e81216877270ce7d6fc5d19052e (diff)
don't truncate initrd if plymouth-populate-initrd fails
-rwxr-xr-xscripts/make-boot-splash-raw9
1 files changed, 9 insertions, 0 deletions
diff --git a/scripts/make-boot-splash-raw b/scripts/make-boot-splash-raw
index 71a1c32..64823e4 100755
--- a/scripts/make-boot-splash-raw
+++ b/scripts/make-boot-splash-raw
@@ -21,6 +21,10 @@ if `/bin/zcat $initrd_file 2> /dev/null | /bin/cpio -t &> /dev/null`; then
/bin/zcat $initrd_file 2> /dev/null | cpio-filter --exclude 'usr/share/plymouth|usr/lib/plymouth|usr/lib64/plymouth|bin/plymouth|lib/libply|usr/lib/libply|lib64/libply|usr/lib64/libply' > $tmp_dir/initrd
mkdir $tmp_dir/plymouth
/usr/libexec/plymouth/plymouth-populate-initrd -t $tmp_dir/plymouth
+ if [ $? -ne 0 ]; then
+ rm -rf $tmp_dir
+ exit 1
+ fi
cd $tmp_dir/plymouth
@@ -45,7 +49,12 @@ else
mount -o loop $tmp_initrd $tmp_dir 2> /dev/null
rm -rf $tmp_dir/usr/share/plymouth $tmp_dir/usr/lib*/plymouth
/usr/libexec/plymouth/plymouth-populate-initrd -t $tmp_dir
+ rc=$?
umount $tmp_dir 2>/dev/null
+ if [ $rc -ne 0 ]; then
+ rm -f $tmp_initrd
+ exit 1
+ fi
gzip -9 -c $tmp_initrd > $initrd_file 2>/dev/null
rm -f $tmp_initrd
fi