From e4ab7802ab28556d7d4b56dd6fcad4b3bd36d980 Mon Sep 17 00:00:00 2001 From: Junghoon Kim Date: Wed, 26 Jul 2017 14:22:33 +0900 Subject: [PATCH] scripts: sd_fusing_rpi3.sh: add inform partition support To implement Tizen upgrade solution, reboot parameter should be delivered into u-boot so that u-boot can jump to proper partition. But, new SoC on RPI3 does not support any specific registers (e.g., INFORM register of Exynos) to store reboot parameter upon SW reset. Add inform partition and make "reboot-param.bin" file for passing reboot parameter. Change-Id: Ic98df1b4ad4aeab9152d3ad5007b97a0e20d8be7 Signed-off-by: Junghoon Kim --- scripts/tizen/sd_fusing_rpi3.sh | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/scripts/tizen/sd_fusing_rpi3.sh b/scripts/tizen/sd_fusing_rpi3.sh index 766307d..040713e 100755 --- a/scripts/tizen/sd_fusing_rpi3.sh +++ b/scripts/tizen/sd_fusing_rpi3.sh @@ -143,13 +143,14 @@ function mkpart_3 () { local -r MODULE_SZ=20 local -r RAMDISK_SZ=8 local -r RAMDISK_RECOVERY_SZ=12 + local -r INFORM_SZ=8 if [ $sfdisk_new == 1 ]; then local -r EXTEND_SZ=8 else local -r EXTEND_SZ=4 fi - let "USER_SZ = $SIZE_MB - $BOOT_SZ - $ROOTFS_SZ - $DATA_SZ - $MODULE_SZ - $RAMDISK_SZ - $RAMDISK_RECOVERY_SZ - $EXTEND_SZ" + let "USER_SZ = $SIZE_MB - $BOOT_SZ - $ROOTFS_SZ - $DATA_SZ - $MODULE_SZ - $RAMDISK_SZ - $RAMDISK_RECOVERY_SZ - $INFORM_SZ - $EXTEND_SZ" local -r BOOT=boot local -r ROOTFS=rootfs @@ -158,6 +159,7 @@ function mkpart_3 () { local -r MODULE=modules local -r RAMDISK=ramdisk local -r RAMDISK_RECOVERY=ramdisk-recovery + local -r INFORM=inform if [[ $USER_SZ -le 100 ]] then @@ -176,6 +178,7 @@ function mkpart_3 () { echo " "$MODULE" " $DISK"6 " $MODULE_SZ "MB" echo " "$RAMDISK" " $DISK"7 " $RAMDISK_SZ "MB" echo " "$RAMDISK_RECOVERY" " $DISK"8 " $RAMDISK_RECOVERY_SZ "MB" + echo " "$INFORM" " $DISK"9 " $INFORM_SZ "MB" local MOUNT_LIST=`mount | grep $DISK | awk '{print $1}'` for mnt in $MOUNT_LIST @@ -196,6 +199,7 @@ function mkpart_3 () { ,${MODULE_SZ}MiB,,- ,${RAMDISK_SZ}MiB,,- ,${RAMDISK_RECOVERY_SZ}MiB,,- + ,${INFORM_SZ}MiB,,- __EOF__ else sfdisk --in-order --Linux --unit M $DISK <<-__EOF__ @@ -207,6 +211,7 @@ function mkpart_3 () { ,$MODULE_SZ,,- ,$RAMDISK_SZ,,- ,$RAMDISK_RECOVERY_SZ,,- + ,$INFORM_SZ,,- __EOF__ fi @@ -217,6 +222,16 @@ function mkpart_3 () { mkfs.ext4 -q ${DISK}6 -L $MODULE -F mkfs.ext4 -q ${DISK}7 -L $RAMDISK -F mkfs.ext4 -q ${DISK}8 -L $RAMDISK_RECOVERY -F + mkfs.ext4 -q ${DISK}9 -L $INFORM -F + + # create "reboot-param.bin" file in inform partition for passing reboot parameter + # It should be done only once upon partition format. + umount ${DISK}9 + mkdir mnt_tmp + mount -t ext4 ${DISK}9 ./mnt_tmp + touch ./mnt_tmp/reboot-param.bin + umount ./mnt_tmp + rmdir mnt_tmp } function show_usage () { -- 2.7.4