M7350/bootable/scripts/tools/releasetools/zip_firmware.sh
2024-09-09 08:57:42 +00:00

32 lines
650 B
Bash
Executable File

#!/bin/bash
UPDATE_ZIP=update.zip
FIRMWARE_PATH=firmware
UPDATE_INFO_FILE=firmware/image/update_info
# zip firmware
if [ -d ${FIRMWARE_PATH} ]; then
# update files mode
find firmware/image -name "*" | awk '{printf("/%s 0%o\n", $0, 0664)}' > ${UPDATE_INFO_FILE}
sed -i 's/\(.*\.\(bin\|tlv\|txt\)\) 0664/\1 0775/g' ${UPDATE_INFO_FILE}
zip -ry ${UPDATE_ZIP} ${FIRMWARE_PATH}
fi
# zip sbl1.mbn
if [ -f sbl1.mbn ]; then
zip -ry ${UPDATE_ZIP} sbl1.mbn
fi
# zip appsboot.mbn
if [ -f appsboot.mbn ]; then
zip -ry ${UPDATE_ZIP} appsboot.mbn
fi
# zip NON-HLOS.ubi
if [ -f NON-HLOS.ubi ]; then
zip -ry ${UPDATE_ZIP} NON-HLOS.ubi
fi
exit $?