tizen: bootscript: rpi4: Update recovery.img under backup partition 60/322060/2
authorJaehoon Chung <jh80.chung@samsung.com>
Wed, 2 Apr 2025 08:41:49 +0000 (17:41 +0900)
committerJaehoon Chung <jh80.chung@samsung.com>
Fri, 4 Apr 2025 01:35:54 +0000 (10:35 +0900)
To prevent the broken recovery image, create recovery.img.64/32 under
backup partition. During TFM, it will be using for flashing.

Change-Id: Iab910bb9d063af86428f8873b80dfb86fc0a501e
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
tizen/bootscript/tizen-boot-rpi4.scr

index 6e7c495880636e023bed87a572be7f955f06bd9b..d9eaf12ab996aa8ce6feb942a2059a52d8b2e2a6 100644 (file)
@@ -108,6 +108,25 @@ if test -n "${ramdiskpart}"; then;
        # Load it
        $devtype dev $devnum;
        $devtype read $ramdisk_addr_r $ramdisk_start $ramdisk_size;
+       part number $devtype $devnum backup backuppart
+
+       # Check Backup Partition is existing
+       if test "${bootmode}" = "flash" && env exists use_backup && env exists backuppart; then;
+               if test "${cpu}" = "armv8"; then;
+                       setenv backup_file recovery.img.64
+               else
+                       setenv backup_file recovery.img.32
+               fi
+               echo "Using the ${backup_file} from backup partition"
+               if test -e $devtype $devnum:$backuppart $backup_file; then;
+                       load $devtype $devnum:$backuppart  $ramdisk_addr_r $backup_file;
+               else
+                       #Copy ramdisk-recovery -> recovery.img.64 or rcovery.img.32
+                       setexpr file_size $ramdisk_size * 200
+                       # Load it
+                       ext4write $devtype $devnum:$backuppart $ramdisk_addr_r $backup_file $file_size;
+               fi
+       fi
        # Set to ramdisk_size with real partition size. (Need to multiply block-size 0x200)
        setexpr ramdisk_size $ramdisk_size * 200
 fi