Fix fw_tool.sh for darwin compatability

Added Darwin stat -f fix in fw_tool.sh. thanks @mwhdc
This commit is contained in:
Alfonso Gamboa
2022-07-02 00:32:11 -07:00
parent 973cc4d8e7
commit f4245747f3
2 changed files with 62 additions and 54 deletions

View File

@@ -2,6 +2,8 @@
#custom for V2
set -x
ACTION=$1
KERNEL_OFFSET=$((64))
@@ -22,7 +24,12 @@ if [ "$ACTION" = "unpack" ]; then
dd if=${DEMO_IN} of=$OUT_DIR/driver.bin skip=$DRIVER_OFFSET count=$(($APPFS_OFFSET-$DRIVER_OFFSET)) bs=1
md5sum $OUT_DIR/driver.bin
if [ "$(uname -s)" = "Darwin" ]; then
IMAGE_END=$(($(stat -f %z ${DEMO_IN})))
else
IMAGE_END=$(($(stat -c %s ${DEMO_IN})))
fi
dd if=${DEMO_IN} of=$OUT_DIR/appfs.bin skip=$APPFS_OFFSET count=$(($IMAGE_END-$APPFS_OFFSET)) bs=1
md5sum $OUT_DIR/appfs.bin