From 443b9d336ca395a5895541ff7e94c8808b62a6d4 Mon Sep 17 00:00:00 2001 From: Robert Nelson Date: Fri, 24 Aug 2012 10:00:34 -0500 Subject: [PATCH] calculate boot partition size Signed-off-by: Robert Nelson --- mk_mmc.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/mk_mmc.sh b/mk_mmc.sh index 6715c23..98f7e0a 100755 --- a/mk_mmc.sh +++ b/mk_mmc.sh @@ -1104,9 +1104,9 @@ function dd_to_drive { echo "Using parted to create BOOT Partition" echo "-----------------------------" if [ "x${boot_fstype}" == "xfat" ] ; then - parted --script ${PARTED_ALIGN} ${MMC} mkpart primary fat16 ${boot_startmb} 100 + parted --script ${PARTED_ALIGN} ${MMC} mkpart primary fat16 ${boot_startmb} ${boot_endmb} else - parted --script ${PARTED_ALIGN} ${MMC} mkpart primary ext2 ${boot_startmb} 100 + parted --script ${PARTED_ALIGN} ${MMC} mkpart primary ext2 ${boot_startmb} ${boot_endmb} fi } @@ -1114,9 +1114,9 @@ function no_boot_on_drive { echo "Using parted to create BOOT Partition" echo "-----------------------------" if [ "x${boot_fstype}" == "xfat" ] ; then - parted --script ${PARTED_ALIGN} ${MMC} mkpart primary fat16 ${boot_startmb} 100 + parted --script ${PARTED_ALIGN} ${MMC} mkpart primary fat16 ${boot_startmb} ${boot_endmb} else - parted --script ${PARTED_ALIGN} ${MMC} mkpart primary ext2 ${boot_startmb} 100 + parted --script ${PARTED_ALIGN} ${MMC} mkpart primary ext2 ${boot_startmb} ${boot_endmb} fi } @@ -1139,9 +1139,11 @@ function create_partitions { omap_fatfs_boot_part ;; dd_to_drive) + let boot_endmb=${boot_startmb}+${boot_partition_size} dd_to_drive ;; *) + let boot_endmb=${boot_startmb}+${boot_partition_size} no_boot_on_drive ;; esac @@ -1416,6 +1418,7 @@ function check_uboot_type { unset smsc95xx_mem unset dd_seek unset dd_bs + boot_partition_size="50" case "${UBOOT_TYPE}" in beagle_bx)