Skip to content

Commit

Permalink
Add helper script
Browse files Browse the repository at this point in the history
Signed-off-by: Shaka Huang <[email protected]>
  • Loading branch information
shakalaca committed Jul 14, 2015
1 parent 669ec76 commit f2f50c9
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bin/extract_boot.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

./unpackbootimg -i boot.img -o boot

23 changes: 23 additions & 0 deletions bin/pack_boot.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit f2f50c9

Please sign in to comment.