diff options
author | Seung-Woo Kim <sw0312.kim@samsung.com> | 2019-11-15 19:46:40 +0900 |
---|---|---|
committer | Jaehoon Chung <jh80.chung@samsung.com> | 2020-10-20 15:13:48 +0900 |
commit | f8f39ca02fa410e6dd17a9dcbcf2a96bdbb3694d (patch) | |
tree | 8305fb694fdb9719972c5845fcfdaf12d51cab1b /scripts | |
parent | 7459626e74e2e80d028536103560b314cf6af4de (diff) | |
download | u-boot-f8f39ca02fa410e6dd17a9dcbcf2a96bdbb3694d.tar.gz u-boot-f8f39ca02fa410e6dd17a9dcbcf2a96bdbb3694d.tar.bz2 u-boot-f8f39ca02fa410e6dd17a9dcbcf2a96bdbb3694d.zip |
scripts: tizen: sd_fusing_rpi3: Fix start position of extended partitions
Older version sfdisk than 2.26 does not align the start and end
of partitions to block, and it breaks the size of paritions less
than requested. Fix start position of extended partitions by
calculation to guarantee the requested size.
Change-Id: I6d5bae06e4cd871075259d406d349c4ac63fab40
Ref: http://man7.org/linux/man-pages/man8/sfdisk.8.html
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/tizen/sd_fusing_rpi3.sh | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/scripts/tizen/sd_fusing_rpi3.sh b/scripts/tizen/sd_fusing_rpi3.sh index 343c5e5a8a..f368e15bf9 100755 --- a/scripts/tizen/sd_fusing_rpi3.sh +++ b/scripts/tizen/sd_fusing_rpi3.sh @@ -148,7 +148,7 @@ function mkpart_3 () { if [ $sfdisk_new == 1 ]; then local -r EXTEND_SZ=8 else - local -r EXTEND_SZ=4 + local -r EXTEND_SZ=10 fi let "USER_SZ = $SIZE_MB - $BOOT_SZ - $ROOTFS_SZ - $DATA_SZ - $MODULE_SZ - $RAMDISK_SZ - $RAMDISK_RECOVERY_SZ - $INFORM_SZ - $EXTEND_SZ" @@ -203,16 +203,23 @@ function mkpart_3 () { ,${INFORM_SZ}MiB,,- __EOF__ else + # calculate start positions for alignment for extended partitions + let "USER_START = 4 + $BOOT_SZ + $ROOTFS_SZ + $DATA_SZ + 1" + let "MODULE_START = $USER_START + $USER_SZ + 1" + let "RAMDISK_START = $MODULE_START + $MODULE_SZ + 1" + let "RAMDISK_RECOVERY_START = $RAMDISK_START + $RAMDISK_SZ + 1" + let "INFORM_START = $RAMDISK_RECOVERY_START + $RAMDISK_RECOVERY_SZ + 1" + sfdisk --in-order --Linux --unit M $DISK <<-__EOF__ 4,$BOOT_SZ,0xE,* ,$ROOTFS_SZ,,- ,$DATA_SZ,,- ,,E,- - ,$USER_SZ,,- - ,$MODULE_SZ,,- - ,$RAMDISK_SZ,,- - ,$RAMDISK_RECOVERY_SZ,,- - ,$INFORM_SZ,,- + $USER_START,$USER_SZ,,- + $MODULE_START,$MODULE_SZ,,- + $RAMDISK_START,$RAMDISK_SZ,,- + $RAMDISK_RECOVERY_START,$RAMDISK_RECOVERY_SZ,,- + $INFORM_START,$INFORM_SZ,,- __EOF__ fi |