diff --git a/bin/extract_boot.sh b/bin/extract_boot.sh new file mode 100755 index 0000000..4ae3abf --- /dev/null +++ b/bin/extract_boot.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +./unpackbootimg -i boot.img -o boot + diff --git a/bin/pack_boot.sh b/bin/pack_boot.sh new file mode 100755 index 0000000..db7d12b --- /dev/null +++ b/bin/pack_boot.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +if [ -f boot.img ]; then + rm boot.img +fi + +if [ -d boot/ramdisk ]; then + cd boot + rm -f ramdisk.* + find . -name "*~" -exec rm -f {} \; + + if [ "$(uname)" == "Darwin" ]; then + mkbootfs ramdisk | gzip > ramdisk.cpio.gz + else + cd ramdisk + find | fakeroot cpio -H newc -o 2>/dev/null >../ramdisk.cpio + cd .. + gzip -n -9 ramdisk.cpio + fi + cd .. +fi + +./mkbootimg --kernel boot/zImage --ramdisk boot/ramdisk.cpio.gz --second boot/second.bin --cmdline "$(cat boot/cmdline)" -o boot.img