From ce305f03f5c8c640e6107a3bf829d32699b02f0e Mon Sep 17 00:00:00 2001 From: Ben Gras Date: Thu, 26 Sep 2013 13:42:31 +0200 Subject: [PATCH] arm_sdimage.sh: use native minix partition util . make filesystems on primary partitions so it's a bit easier for the minix partitioning tool . so sfdisk isn't required as an external tool Change-Id: I023b448fbd49453563c57a7439b30337fce3c030 --- releasetools/arm_sdimage.sh | 55 +++++++++------------------------ releasetools/gen_cmdline.txt.sh | 2 +- 2 files changed, 16 insertions(+), 41 deletions(-) diff --git a/releasetools/arm_sdimage.sh b/releasetools/arm_sdimage.sh index 9bdebca6b..cc74873dc 100755 --- a/releasetools/arm_sdimage.sh +++ b/releasetools/arm_sdimage.sh @@ -51,7 +51,7 @@ fi export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:$PATH -for needed in sfdisk mcopy dd wget mkfs.vfat +for needed in mcopy dd wget mkfs.vfat do if ! which $needed 2>&1 > /dev/null then @@ -95,22 +95,19 @@ sh ${BUILDSH} -V SLOPPY_FLIST=yes -V MKBINUTILS=yes -V MKGCCCMDS=yes -j ${JOBS} # All sized are written in 512 byte blocks # # we create a disk image of about 2 gig's -# for alignement reasons, prefer sizes which are multiples of 4096 bytes -# -: ${IMG_SIZE= $(( 2*(2**30) / 512))} -: ${FAT_SIZE= $(( 10*(2**20) / 512))} -: ${ROOT_SIZE=$(( 64*(2**20) / 512))} -: ${HOME_SIZE=$(( 128*(2**20) / 512))} -: ${USR_SIZE= $((1536*(2**20) / 512))} +: ${IMG_SIZE=$(( 2*(2**30) / 512))} +: ${FAT_SIZE=$(( 10*(2**20) / 512))} +: ${ROOT_SIZE=$(( 64*(2**20) / 512))} +: ${HOME_SIZE=$(( 128*(2**20) / 512))} +: ${USR_SIZE=$(( 1536*(2**20) / 512))} # # create a fstab entry in /etc this is normally done during the # setup phase on x86 # cat >${FSTAB} </d # dd if=/dev/zero of=${IMG} bs=512 count=1 seek=$(($IMG_SIZE -1)) -# # Do some math to determine the start addresses of the partitions. -# Ensure the start of the partitions are always aligned, the end will -# always be as we assume the sizes are multiples of 4096 bytes, which -# is always true as soon as you have an integer multiple of 1MB. -# +# Don't leave holes so the 'partition' invocation later is easy. FAT_START=2048 -EXTENDED_START=$(($FAT_START + $FAT_SIZE)) -EXTENDED_START=$(($EXTENDED_START + 8 - ($EXTENDED_START % 8))) -ROOT_START=$(($EXTENDED_START + 1)) -ROOT_START=$(($ROOT_START + 8 - ($ROOT_START % 8))) -HOME_START=$(($ROOT_START + $ROOT_SIZE + 1)) -HOME_START=$(($HOME_START + 8 - ($HOME_START % 8))) -USR_START=$(($HOME_START + $HOME_SIZE + 1)) -USR_START=$(($USR_START + 8 - ($USR_START % 8))) -EXTENDED_SIZE=$(($USR_START + $USR_SIZE - $EXTENDED_START)) +ROOT_START=$(($FAT_START + $FAT_SIZE)) +HOME_START=$(($ROOT_START + $ROOT_SIZE)) +USR_START=$(($HOME_START + $HOME_SIZE)) -# -# Generate the partitions using sfdisk to partition the -# -sfdisk -L --force --no-reread -q ${IMG} 1>/dev/null <