more sanity-checks for initrd scripts

This commit is contained in:
Heiko Stuebner 2011-02-22 20:42:08 +01:00 committed by Gilles Grandou
parent 9b8c83da5e
commit 81350194c5
2 changed files with 15 additions and 0 deletions

View File

@ -4,5 +4,15 @@
initrd=${1:-initrd.img}
ramdisk=${2:-ramdisk}
if [ ! -d $ramdisk ]; then
echo "$ramdisk does not exist."
exit 1
fi
if [ -f $initrd ]; then
echo "$initrd already exist."
exit 1
fi
( cd $ramdisk; find | sort | cpio --quiet -o -H newc ) | gzip > $initrd

View File

@ -4,6 +4,11 @@
initrd=${1:-initrd.img}
ramdisk=${2:-ramdisk}
if [ ! -f $initrd ]; then
echo "$initrd does not exist."
exit 1
fi
if [ -d $ramdisk ]; then
echo "$ramdisk already exists."
exit 1