From 9712cfee50abc337787af65d452b59408c979f39 Mon Sep 17 00:00:00 2001 From: Robert Nelson Date: Fri, 18 Nov 2011 16:16:22 -0600 Subject: [PATCH] cleanup: redefine uboot_in_boot_partition function Signed-off-by: Robert Nelson --- mk_mmc.sh | 40 +++++++++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/mk_mmc.sh b/mk_mmc.sh index ecf8193..e656d70 100755 --- a/mk_mmc.sh +++ b/mk_mmc.sh @@ -77,12 +77,6 @@ function find_issue { check_root #Software Qwerks -#fdisk 2.18.x/2.19.x, dos no longer default -unset FDISK_DOS - -if test $(fdisk -v | grep -o -E '2\.[0-9]+' | cut -d'.' -f2) -ge 18 ; then - FDISK_DOS="-c=dos -u=cylinders" -fi #Check for gnu-fdisk #FIXME: GNU Fdisk seems to halt at "Using /dev/xx" when trying to script it.. @@ -635,7 +629,17 @@ function unmount_all_drive_partitions { parted --script ${MMC} mklabel msdos } -function uboot_in_fat { +function uboot_in_boot_partition { + echo "" + echo "Using fdisk to create BOOT Partition" + echo "-----------------------------" + + #With util-linux, 2.18.x/2.19.x, fdisk no longer has dos/cylinders mode on by default + unset FDISK_DOS + + if test $(fdisk -v | grep -o -E '2\.[0-9]+' | cut -d'.' -f2) -ge 18 ; then + FDISK_DOS="-c=dos -u=cylinders" + fi fdisk ${FDISK_DOS} ${MMC} << END n @@ -649,16 +653,22 @@ p w END -sync - -parted --script ${MMC} set 1 boot on + sync -echo "" -echo "Formating Boot Partition" -echo "" + echo "Setting Boot Partition's Boot Flag" + echo "-----------------------------" + parted --script ${MMC} set 1 boot on -mkfs.vfat -F 16 ${MMC}${PARTITION_PREFIX}1 -n ${BOOT_LABEL} +if [ "$FDISK_DEBUG" ];then + echo "Debug: Partition 1 layout:" + echo "-----------------------------" + fdisk -l ${MMC} + echo "-----------------------------" +fi + echo "Formating Boot Partition" + echo "-----------------------------" + mkfs.vfat -F 16 ${MMC}${PARTITION_PREFIX}1 -n ${BOOT_LABEL} } function dd_uboot { @@ -683,7 +693,7 @@ function create_partitions { if [ "${DO_UBOOT_DD}" ] ; then dd_uboot else - uboot_in_fat + uboot_in_boot_partition fi mkdir ${TEMPDIR}/disk