From: Jaehoon Chung Date: Wed, 12 Oct 2022 01:25:57 +0000 (+0900) Subject: scripts: sd_fusing_rpi4: add initialize_parameter function X-Git-Tag: accepted/tizen/unified/20221108.163909~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5ce6b6a7297987484648b390f8ab508ac22d69ba;p=platform%2Fkernel%2Fu-boot.git scripts: sd_fusing_rpi4: add initialize_parameter function Add initialize_parameter function to clear previous values. When flash the image without format, its value is remaining with previous value. Change-Id: I59b684bfa4ba851325902d8f769ce0c2efe67d85 Signed-off-by: Jaehoon Chung --- diff --git a/scripts/tizen/sd_fusing_rpi4.sh b/scripts/tizen/sd_fusing_rpi4.sh index 9f7144351a..bd904ad143 100755 --- a/scripts/tizen/sd_fusing_rpi4.sh +++ b/scripts/tizen/sd_fusing_rpi4.sh @@ -201,12 +201,42 @@ function fuse_image_tarball () { 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]} @@ -382,27 +412,8 @@ function mkpart_3 () { 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 @@ -501,7 +512,7 @@ function check_device () { function print_logo () { echo "" - echo "Raspberry Pi4 downloader, version 1.0.8" + echo "Raspberry Pi4 downloader, version 1.0.9" echo "" }