From: Jaehoon Chung Date: Wed, 2 Apr 2025 08:41:49 +0000 (+0900) Subject: tizen: bootscript: rpi4: Use recovery.img under backup partition X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fheads%2Ftizen_8.0;p=platform%2Fkernel%2Fu-boot.git 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: If8788e4614741b69eef9f13c769a081bf0737857 Signed-off-by: Jaehoon Chung --- 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