|
|
@ -1,8 +1,8 @@ |
|
|
|
#!/bin/sh |
|
|
|
#!/bin/bash |
|
|
|
|
|
|
|
bp3_find() { |
|
|
|
if ls /dev/mmc* 1> /dev/null 2>&1 && for f in /dev/mmcblk?; do sgdisk -p $f | grep $1; done 1> /dev/null 2>&1 ; then |
|
|
|
export bp3=$(for f in /dev/mmcblk?; do sgdisk -p $f | grep $1 | awk '{print $1}'; done) |
|
|
|
export bp3=($(for f in /dev/mmcblk?; do sgdisk -p $f | grep $1; done)) |
|
|
|
export part=$(ls /dev/mmcblk*p$bp3) |
|
|
|
elif grep $1 /sys/class/mtd/mtd*/name 1> /dev/null 2>&1 ; then |
|
|
|
export bp3=$(dirname `grep $1 /sys/class/mtd/mtd*/name`) |
|
|
@ -42,7 +42,7 @@ bp3_israw() { |
|
|
|
if [ "$ver" = "BP30" ]; then |
|
|
|
export md5=$(dd if=$part bs=1 skip=4 count=32) |
|
|
|
export bp3_size=$(echo `dd if=$part bs=1 skip=36 count=8`) |
|
|
|
export cal=$(dd if=$part bs=1 skip=44 count=$bp3_size | md5sum) |
|
|
|
export cal=($(dd if=$part bs=1 skip=44 count=$bp3_size | md5sum)) |
|
|
|
if [ "$md5" = "$cal" ]; then |
|
|
|
dd if=$part of=bp3.bin bs=1 skip=44 count=$bp3_size |
|
|
|
return 0 |
|
|
|