mirror of
https://github.com/ggrandou/abootimg.git
synced 2024-11-23 09:53:32 +08:00
more sanity-checks for initrd scripts
This commit is contained in:
parent
9b8c83da5e
commit
81350194c5
10
pack-initrd
10
pack-initrd
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user