scripts: sd_fusing_rpi4: add skip-resize option
authorJaehoon Chung <jh80.chung@samsung.com>
Fri, 11 Nov 2022 05:29:37 +0000 (14:29 +0900)
committerJaehoon Chung <jh80.chung@samsung.com>
Tue, 17 Oct 2023 04:19:39 +0000 (13:19 +0900)
Add skip-resize option to test A/B update.

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

index bd904ad..1b60fcc 100755 (executable)
@@ -2,6 +2,7 @@
 
 declare FORMAT=""
 declare DEVICE=""
+declare SKIP=0
 declare -i OLD_DD=0
 
 # Binaires array for fusing
@@ -425,6 +426,24 @@ function mkpart_3 () {
        mkfs.ext4 -q ${PART19} -L $RESERVED2 -F
 }
 
+function skip_resize () {
+       if [ "${SKIP}" == "0" ]; then
+               return 0;
+       fi
+
+       if [ ! -d mnt_tmp ] ; then
+               mkdir mnt_tmp
+       fi
+
+       mount -t ext4 ${DEVICE}3 ./mnt_tmp
+       touch ./mnt_tmp/var/.resizefs_done
+
+       echo "Rootfs resize will be skipped..."
+       sync
+       umount ./mnt_tmp
+       rmdir mnt_tmp
+}
+
 function show_usage () {
        echo "- Usage:"
        echo "  sudo ./sd_fusing*.sh -d <device> [-b <path> <path> ..] [--format] [--update [b] ]"
@@ -512,7 +531,7 @@ function check_device () {
 
 function print_logo () {
        echo ""
-       echo "Raspberry Pi4 downloader, version 1.0.9"
+       echo "Raspberry Pi4 downloader, version 1.0.10"
        echo ""
 }
 
@@ -562,6 +581,10 @@ while test $# -ne 0; do
                fi
                shift
                ;;
+       --skip-resize)
+               SKIP=1
+               shift
+               ;;
        *)
                if [ $binary_option == 1 ];then
                        add_fusing_binary $option
@@ -578,3 +601,4 @@ check_device
 check_partition_format
 check_ddversion
 fuse_image
+skip_resize