added tools to pack/unpack ramdisks

This commit is contained in:
Gilles Grandou 2010-11-26 23:13:33 +01:00
parent 5230e5fb08
commit 40817afd9b
2 changed files with 23 additions and 0 deletions

8
pack-initrd Executable file
View File

@ -0,0 +1,8 @@
#!/bin/sh
#
initrd=${1:-initrd.img}
ramdisk=${2:-ramdisk}
( cd $ramdisk; find | sort | cpio --quiet -o -H newc ) | gzip > $initrd

15
unpack-initrd Executable file
View File

@ -0,0 +1,15 @@
#!/bin/sh
#
initrd=${1:-initrd.img}
ramdisk=${2:-ramdisk}
if [ -d $ramdisk ]; then
echo "$ramdisk already exists."
exit 1
fi
mkdir -p $ramdisk
zcat $initrd | ( cd $ramdisk; cpio -i )