From: Darren Hart <dvhart@linux.intel.com>
To: openembedded-core@lists.openembedded.org,
Richard Purdie <richard.purdie@linuxfoundation.org>,
Khem Raj <raj.khem@gmail.com>,
Tom Zanussi <tom.zanussi@intel.com>,
Kishore Bodke <kishore.k.bodke@intel.com>,
Saul Wold <sgw@linux.intel.com>
Subject: [PATCH 3/5] init-install: Clean up partition alignment
Date: Tue, 3 Jul 2012 21:34:00 -0700 [thread overview]
Message-ID: <8740075dcc688c9b06a7b52d8afe558da583c66c.1341376182.git.dvhart@linux.intel.com> (raw)
In-Reply-To: <cover.1341376182.git.dvhart@linux.intel.com>
In-Reply-To: <cover.1341376182.git.dvhart@linux.intel.com>
The current partitioning scheme leaves a 1MB gap between all the
generated partitions by adding a 1 to the end of the last partition to
use as the start of the next. parted is smart enough to not overlap
start and end positions of the same value. This avoids the 1 MB gaps.
Rather than pad the disk with 1MB in the beginning and cut it off at the
MB boundary on the end, we can use 0% and 100% to allow parted to do the
required math and use as much of the disk as possible.
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
---
.../initrdscripts/files/init-install.sh | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/meta/recipes-core/initrdscripts/files/init-install.sh b/meta/recipes-core/initrdscripts/files/init-install.sh
index 8d21dd1..0ac4949 100644
--- a/meta/recipes-core/initrdscripts/files/init-install.sh
+++ b/meta/recipes-core/initrdscripts/files/init-install.sh
@@ -84,9 +84,9 @@ disk_size=$(parted /dev/${device} unit mb print | grep Disk | cut -d" " -f 3 | s
swap_size=$((disk_size*swap_ratio/100))
rootfs_size=$((disk_size-boot_size-swap_size))
-rootfs_start=$((boot_size + 1))
+rootfs_start=$((boot_size))
rootfs_end=$((rootfs_start+rootfs_size))
-swap_start=$((rootfs_end+1))
+swap_start=$((rootfs_end))
# MMC devices are special in a couple of ways
# 1) they use a partition prefix character 'p'
@@ -113,13 +113,13 @@ echo "Creating new partition table on /dev/${device} ..."
parted /dev/${device} mklabel msdos
echo "Creating boot partition on $bootfs"
-parted /dev/${device} mkpart primary 1 $boot_size
+parted /dev/${device} mkpart primary 0% $boot_size
echo "Creating rootfs partition on $rootfs"
parted /dev/${device} mkpart primary $rootfs_start $rootfs_end
echo "Creating swap partition on $swap"
-parted /dev/${device} mkpart primary $swap_start $disk_size
+parted /dev/${device} mkpart primary $swap_start 100%
parted /dev/${device} print
--
1.7.5.4
next prev parent reply other threads:[~2012-07-04 4:45 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-04 4:33 [PATCH 0/5] Live installer fixes and EFI support Darren Hart
2012-07-04 4:33 ` [PATCH 1/5] init-install: Use swap_ratio in the calulation of swap_size Darren Hart
2012-07-04 4:33 ` [PATCH 2/5] init-install: Correct ext2->ext3 typo in logging Darren Hart
2012-07-04 4:34 ` Darren Hart [this message]
2012-07-04 4:34 ` [PATCH 4/5] grub-efi: Do not use help2man Darren Hart
2012-07-04 4:34 ` [PATCH 5/5] EFI: Make installer EFI aware Darren Hart
2012-07-06 17:18 ` Saul Wold
2012-07-09 17:03 ` [PATCH 0/5] Live installer fixes and EFI support Saul Wold
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8740075dcc688c9b06a7b52d8afe558da583c66c.1341376182.git.dvhart@linux.intel.com \
--to=dvhart@linux.intel.com \
--cc=kishore.k.bodke@intel.com \
--cc=openembedded-core@lists.openembedded.org \
--cc=raj.khem@gmail.com \
--cc=richard.purdie@linuxfoundation.org \
--cc=sgw@linux.intel.com \
--cc=tom.zanussi@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox