From b02344fc75955663536096230b565663fc85ca4e Mon Sep 17 00:00:00 2001 From: Jaehoon Chung Date: Wed, 2 Apr 2025 17:41:49 +0900 Subject: [PATCH] tizen: bootscript: rpi4: Use recovery.img under backup partition 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 --- tizen/bootscript/tizen-boot-rpi4.scr | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tizen/bootscript/tizen-boot-rpi4.scr b/tizen/bootscript/tizen-boot-rpi4.scr index b284cea662..00bd660021 100644 --- a/tizen/bootscript/tizen-boot-rpi4.scr +++ b/tizen/bootscript/tizen-boot-rpi4.scr @@ -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 -- 2.34.1