tizen: bootscript: rpi4: Use recovery.img under backup partition 97/322497/2 tizen_9.0
authorJaehoon Chung <jh80.chung@samsung.com>
Wed, 2 Apr 2025 08:41:49 +0000 (17:41 +0900)
committerJaehoon Chung <jh80.chung@samsung.com>
Fri, 11 Apr 2025 06:13:27 +0000 (15:13 +0900)
To prevent the broken recovery image, use recovery.img.64/32 under
backup partition. During TFM, it will be using for flashing.

If there is no backup file, original file will be used.

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

index b284cea662ae155ebe982e09e3c3201818eefcd4..00bd66002190f06d3b8b730f6b45477eb7543205 100644 (file)
@@ -108,6 +108,22 @@ 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
+               if test -e $devtype $devnum:$backuppart $backup_file; then;
+                       echo "Using the ${backup_file} from backup partition"
+                       load $devtype $devnum:$backuppart  $ramdisk_addr_r $backup_file;
+               else
+                       echo "There is no ${backup_file}..Using original recovery image"
+               fi
+       fi
        # Set to ramdisk_size with real partition size. (Need to multiply block-size 0x200)
        setexpr ramdisk_size $ramdisk_size * 200
 fi