scripts: tizen: rpi4: add the additional option to flash A/B partition 56/276356/1
authorJaehoon Chung <jh80.chung@samsung.com>
Wed, 15 Jun 2022 02:01:13 +0000 (11:01 +0900)
committerJaehoon Chung <jh80.chung@samsung.com>
Wed, 15 Jun 2022 02:01:13 +0000 (11:01 +0900)
Add additional option as '-ab'.
If it's used, it will be flashed to both A/B partitions.
Otherwise, it will be flashed to A partition by default.
Actaully, some developers don't need to update B partiton.

Change-Id: I584be9e1be388b9f6bc247d105e406dd66d86ec0
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
scripts/tizen/sd_fusing_rpi4.sh

index 9b22eb0..bd7dfe1 100755 (executable)
@@ -10,6 +10,7 @@ declare -i FUSING_BINARY_NUM=0
 
 declare CONV_ASCII=""
 declare -i FUS_ENTRY_NUM=0
+declare -i ab_option=0
 
 # binary name | part number | bs | label | fs type
 declare -a PART_TABLE=(
@@ -140,6 +141,9 @@ function fusing_image () {
 }
 
 function fusing_image_to_b () {
+       if [ $ab_option == 0 ] ; then
+               return
+       fi
        local -r fusing_img=$1
 
        # get binary info using basename
@@ -392,7 +396,10 @@ function mkpart_3 () {
 
 function show_usage () {
        echo "- Usage:"
-       echo "  sudo ./sd_fusing*.sh -d <device> [-b <path> <path> ..] [--format]"
+       echo "  sudo ./sd_fusing*.sh -d <device> [-b <path> <path> ..] [--format] [-ab]"
+       echo "  -d  : device ndoe "
+       echo "  -b  : binary "
+       echo "  -ab : If want to update Image about B Partition, use -ab option"
 }
 
 function check_partition_format () {
@@ -513,6 +520,10 @@ while test $# -ne 0; do
                binary_option=1
                shift
                ;;
+       -ab)
+               ab_option=1
+               shift
+               ;;
        *)
                if [ $binary_option == 1 ];then
                        add_fusing_binary $option