scripts: tizen: rpi4: support to flash only B partiton 08/276508/1
authorJaehoon Chung <jh80.chung@samsung.com>
Fri, 17 Jun 2022 11:12:05 +0000 (20:12 +0900)
committerJaehoon Chung <jh80.chung@samsung.com>
Fri, 17 Jun 2022 11:14:34 +0000 (20:14 +0900)
If wants to update only B partition, "update" option can be used with b.
e.g) ./sd_fusing_rip4 -d <..> -b <..> --update b

Otherwise, it will be flashed to both partition.

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

index c763969..73843fc 100755 (executable)
@@ -98,6 +98,10 @@ function check_ddversion () {
 }
 
 function fusing_image () {
+       if [ $ab_option == 2 ] ; then
+               echo "Skip to update Partitoin A"
+               return
+       fi
        local -r fusing_img=$1
 
        # get binary info using basename
@@ -141,7 +145,8 @@ function fusing_image () {
 }
 
 function fusing_image_to_b () {
-       if [ $ab_option == 0 ] ; then
+       if [ $ab_option == 0 ]  ; then
+               echo "Skip to update Partitoin B"
                return
        fi
        local -r fusing_img=$1
@@ -410,10 +415,11 @@ function mkpart_3 () {
 
 function show_usage () {
        echo "- Usage:"
-       echo "  sudo ./sd_fusing*.sh -d <device> [-b <path> <path> ..] [--format] [-ab]"
+       echo "  sudo ./sd_fusing*.sh -d <device> [-b <path> <path> ..] [--format] [--update [b] ]"
        echo "  -d  : device ndoe "
        echo "  -b  : binary "
-       echo "  -ab : If want to update Image about B Partition, use -ab option"
+       echo "  --update : If want to update Image about B Partition, use --update option with b"
+       echo "             Otherwise, it will be updated to both partition"
 }
 
 function check_partition_format () {
@@ -534,8 +540,12 @@ while test $# -ne 0; do
                binary_option=1
                shift
                ;;
-       -ab)
-               ab_option=1
+       --update)
+               if [ "$1" == "b" ] ; then
+                       ab_option=2
+               else
+                       ab_option=1
+               fi
                shift
                ;;
        *)