eval sync
}
+function initialize_parameter () {
+ # create "reboot-param.bin" file in inform partition for passing reboot parameter
+ # It should be done only once upon partition format.
+ local -r DISK=$DEVICE
+ local -r PART9=/dev/`lsblk ${DISK} -o TYPE,KNAME | grep part | awk '{ print $2 }' | grep -G "[a-z]9\$"`
+
+ if [ -d mnt_tmp ]; then
+ echo "Remove the existing mnt_tmp directory!!"
+ rm -rf mnt_tmp
+ fi
+ mkdir mnt_tmp
+ mount -t ext4 ${PART9} ./mnt_tmp
+ echo "norm" > ./mnt_tmp/reboot-param.bin
+ echo "norm" > ./mnt_tmp/reboot-param.info
+ echo "a" > ./mnt_tmp/partition-ab.info
+ echo "1" > ./mnt_tmp/partition-ab-cloned.info
+ echo "0" > ./mnt_tmp/upgrade-status.info
+
+ # To check the status of partition. (default "ok")
+ echo "ok" > ./mnt_tmp/partition-a-status.info
+ echo "ok" > ./mnt_tmp/partition-b-status.info
+
+ sync
+ umount ./mnt_tmp
+ rmdir mnt_tmp
+}
+
function fuse_image () {
if [ "$FUSING_BINARY_NUM" == 0 ]; then
return
fi
+ # Clear preivous values before flashing image
+ initialize_parameter
+
for ((fuse_idx = 0 ; fuse_idx < $FUSING_BINARY_NUM ; fuse_idx++))
do
local filename=${FUSING_BINARY_ARRAY[fuse_idx]}
local -r PART9=/dev/`lsblk ${DISK} -o TYPE,KNAME | grep part | awk '{ print $2 }' | grep -G "[a-z]9\$"`
mkfs.ext4 -q ${PART9} -L $INFORM -F -O ^metadata_csum
- # create "reboot-param.bin" file in inform partition for passing reboot parameter
- # It should be done only once upon partition format.
- if [ -d mnt_tmp ]; then
- echo "Remove the existing mnt_tmp directory!!"
- rm -rf mnt_tmp
- fi
- mkdir mnt_tmp
- mount -t ext4 ${PART9} ./mnt_tmp
- echo "norm" > ./mnt_tmp/reboot-param.bin
- echo "norm" > ./mnt_tmp/reboot-param.info
- echo "a" > ./mnt_tmp/partition-ab.info
- echo "1" > ./mnt_tmp/partition-ab-cloned.info
- echo "0" > ./mnt_tmp/upgrade-status.info
-
- # To check the status of partition. (default "ok")
- echo "ok" > ./mnt_tmp/partition-a-status.info
- echo "ok" > ./mnt_tmp/partition-b-status.info
-
- sync
- umount ./mnt_tmp
- rmdir mnt_tmp
+ # initialize value of parameters
+ initialize_parameter
local -r PART17=/dev/`lsblk ${DISK} -o TYPE,KNAME | grep part | awk '{ print $2 }' | grep -G "[a-z]17\$"`
mkfs.ext4 -q ${PART17} -L $RESERVED0 -F
function print_logo () {
echo ""
- echo "Raspberry Pi4 downloader, version 1.0.8"
+ echo "Raspberry Pi4 downloader, version 1.0.9"
echo ""
}