From bac1bf01d7ec28d587489da46a946b473b7af878 Mon Sep 17 00:00:00 2001 From: Junghoon Kim Date: Thu, 14 Sep 2017 20:57:24 +0900 Subject: [PATCH] rpi: tizen-boot: modify the parameter check logic Modify the parameter check logic to support all cases of reboot commands including "reboot", "reboot fota", "reboot recovery", and undefined reboot parameter. Change-Id: I00c7cec03bdd8d9364bda3e8c7142a76ed9b4bd9 Signed-off-by: Junghoon Kim --- board/raspberrypi/rpi/tizen-boot.scr | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/board/raspberrypi/rpi/tizen-boot.scr b/board/raspberrypi/rpi/tizen-boot.scr index 437763c..e0a303c 100644 --- a/board/raspberrypi/rpi/tizen-boot.scr +++ b/board/raspberrypi/rpi/tizen-boot.scr @@ -12,14 +12,17 @@ rebootparamfile=reboot-param.bin rebootparam_addr=0x3a62b000 # 0x72677075 is ascii code for representing string "upgr" upgrade_val=72677075 -# 0x6d726f6e is ascii code for representing string "norm" -normal_val=6d726f6e - -ramdisksize=800000 +# 0x72766372 is ascii code for representing string "rcvr" +recovery_val=72766372 +# 0x6665646e is ascii code for representing string "ndef" +nodef_val=6665646e # Normal ramdisk : partition 7 # Ramdisk Recovery : Partition 8 ramdiskdev=0 +ramdiskpart=7 +ramdisksize=800000 +bootmode=ramdisk # Device that included the image. bootdev=mmc @@ -28,19 +31,15 @@ if test -e $bootdev $mmcbootdev:$mmcinformpart $rebootparamfile; then; ext4load $bootdev $mmcbootdev:$mmcinformpart $rebootparam_addr $rebootparamfile; if itest.l *${rebootparam_addr} == ${upgrade_val}; then; ramdiskpart=8 - bootmode=upgrade ramdisksize=c00000 - elif itest.l *${rebootparam_addr} == ${normal_val}; then; - ramdiskpart=7 - bootmode=ramdisk - else + bootmode=fota + elif itest.l *${rebootparam_addr} == ${recovery_val}; then; + ramdiskpart=8 + ramdisksize=c00000 + bootmode=recovery + elif itest.l *${rebootparam_addr} == ${nodef_val}; then; echo "This reboot parameter is not supported..."; - ramdiskpart=7 - bootmode=ramdisk fi -else - ramdiskpart=7 - bootmode=ramdisk fi # boot from ram0 if there is sbin -- 2.7.4