From: Jaehoon Chung Date: Fri, 10 Jun 2022 09:18:05 +0000 (+0900) Subject: scripts: tizen: sd_fusing_rpi4: support gpt label X-Git-Tag: accepted/tizen/unified/20221108.163909~45 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fd9e9c8e04a02153d6d46df3326f1ccec499d87d;p=platform%2Fkernel%2Fu-boot.git scripts: tizen: sd_fusing_rpi4: support gpt label Support gpt label to use PARTLABEL. This patch is based on what SRPOL had been shared. Change-Id: I0d1221493e78d43a38bfe712d96622b7f216edaf Signed-off-by: Jaehoon Chung --- diff --git a/scripts/tizen/sd_fusing_rpi4.sh b/scripts/tizen/sd_fusing_rpi4.sh index 5bfb31e..325ec83 100755 --- a/scripts/tizen/sd_fusing_rpi4.sh +++ b/scripts/tizen/sd_fusing_rpi4.sh @@ -323,22 +323,29 @@ function mkpart_3 () { sfdisk --delete $DISK fi + SCRIPT="" + for ((idx=0; idx < $PART_TABLE_ROW; idx++)); do + NR=${PART_TABLE[idx * ${PART_TABLE_COL} + 1]} + eval "PART_LABEL_NR_${NR}=${PART_TABLE[idx * ${PART_TABLE_COL} + 3]}" + done + sfdisk $DISK <<-__EOF__ - 4MiB,${BOOT_SZ}MiB,0xE,* - 8MiB,${ROOTFS_SZ}MiB,,- - 8MiB,${DATA_SZ}MiB,,- - 8MiB,,E,- - ,${USER_SZ}MiB,,- - ,${MODULE_SZ}MiB,,- - ,${RAMDISK_SZ}MiB,,- - ,${RAMDISK_RECOVERY_SZ}MiB,,- - ,${INFORM_SZ}MiB,,- - ,${HAL_SZ}MiB,,- - ,${ROOTFS_SZ}MiB,,- - ,${MODULE_SZ}MiB,,- - ,${RAMDISK_SZ}MiB,,- - ,${RAMDISK_RECOVERY_SZ}MiB,,- - ,${RESERVED2_SZ}MiB,,- + label: gpt + ${DEVICE}1 : start=4MiB, size=${BOOT_SZ}MiB, type= C12A7328-F81F-11D2-BA4B-00A0C93EC93B, name=${PART_LABEL_NR_1} + ${DEVICE}2 : size=${ROOTFS_SZ}MiB, name=${PART_LABEL_NR_2} + ${DEVICE}3 : size=${DATA_SZ}MiB, name=${PART_LABEL_NR_3} + ${DEVICE}4 : size=${EXTEND_SZ}MiB, name=none + ${DEVICE}5 : size=${USER_SZ}MiB, name=${PART_LABEL_NR_5} + ${DEVICE}6 : size=${MODULE_SZ}MiB, name=${PART_LABEL_NR_6} + ${DEVICE}7 : size=${RAMDISK_SZ}MiB, name=${PART_LABEL_NR_7} + ${DEVICE}8 : size=${RAMDISK_RECOVERY_SZ}MiB, name=${PART_LABEL_NR_8} + ${DEVICE}9 : size=${INFORM_SZ}MiB, name=inform + ${DEVICE}10: size=${HAL_SZ}MiB, name=${PART_LABEL_NR_10} + ${DEVICE}11: size=${ROOTFS_SZ}MiB, name=${PART_LABEL_NR_11} + ${DEVICE}12: size=${MODULE_SZ}MiB, name=${PART_LABEL_NR_12} + ${DEVICE}13: size=${RAMDISK_SZ}MiB, name=${PART_LABEL_NR_13} + ${DEVICE}14: size=${RAMDISK_RECOVERY_SZ}MiB, name=${PART_LABEL_NR_14} + ${DEVICE}15: size=${RESERVED2_SZ}MiB, name=reserved2 __EOF__ else # calculate start positions for alignment for extended partitions