Skip to content

Commit

Permalink
scripts: image creation scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
zkrx committed Oct 16, 2016
1 parent 77c5a51 commit 6db7e2a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions image/create_img.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
if [ $# -ne 1 ]; then
echo "$0: usage: $0 <bin size in bytes>"
exit 1
fi

echo "Creating total flash image (mtd0.dmp.uboot_new)"
cp u-boot-DS211j_x16cs0size128_flash.bin mtd0.dmp.uboot_new
dd if=mtd0.dmp.orig of=mtd0.dmp.uboot_new seek=$1 skip=$1 bs=1

echo "Exporting partition #1 (mtd0.dmp.part1)"
dd if=mtd0.dmp.uboot_new of=mtd0.dmp.part1 bs=1 count=524288

echo "Diffing input/output (there should be NO diff output!)"
diff <(xxd u-boot-DS211j_x16cs0size128_flash.bin) <(xxd -l $1 mtd0.dmp.part1)

echo "Image ready!"
Binary file added image/mtd0.dmp.orig
Binary file not shown.

0 comments on commit 6db7e2a

Please sign in to comment.