summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarren Hart <dvhart@linux.intel.com>2012-07-03 16:21:57 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-07-09 16:58:58 +0100
commit7af1525794fd91e8fca32221ec98f88c4cc3b0f0 (patch)
treefbc420ebc7624703d70f547f3ae3bbc73e4a5d8e
parent6f932f80bb54a2509c71c7110fa9c660bfe382fa (diff)
downloadpoky-7af1525794fd91e8fca32221ec98f88c4cc3b0f0.tar.gz
init-install: Clean up partition alignment
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. (From OE-Core rev: 8aac6ecc5194c734dfd3d677017ab3ea045b2339) Signed-off-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-core/initrdscripts/files/init-install.sh8
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 8d21dd1f58..0ac4949355 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
84swap_size=$((disk_size*swap_ratio/100)) 84swap_size=$((disk_size*swap_ratio/100))
85rootfs_size=$((disk_size-boot_size-swap_size)) 85rootfs_size=$((disk_size-boot_size-swap_size))
86 86
87rootfs_start=$((boot_size + 1)) 87rootfs_start=$((boot_size))
88rootfs_end=$((rootfs_start+rootfs_size)) 88rootfs_end=$((rootfs_start+rootfs_size))
89swap_start=$((rootfs_end+1)) 89swap_start=$((rootfs_end))
90 90
91# MMC devices are special in a couple of ways 91# MMC devices are special in a couple of ways
92# 1) they use a partition prefix character 'p' 92# 1) they use a partition prefix character 'p'
@@ -113,13 +113,13 @@ echo "Creating new partition table on /dev/${device} ..."
113parted /dev/${device} mklabel msdos 113parted /dev/${device} mklabel msdos
114 114
115echo "Creating boot partition on $bootfs" 115echo "Creating boot partition on $bootfs"
116parted /dev/${device} mkpart primary 1 $boot_size 116parted /dev/${device} mkpart primary 0% $boot_size
117 117
118echo "Creating rootfs partition on $rootfs" 118echo "Creating rootfs partition on $rootfs"
119parted /dev/${device} mkpart primary $rootfs_start $rootfs_end 119parted /dev/${device} mkpart primary $rootfs_start $rootfs_end
120 120
121echo "Creating swap partition on $swap" 121echo "Creating swap partition on $swap"
122parted /dev/${device} mkpart primary $swap_start $disk_size 122parted /dev/${device} mkpart primary $swap_start 100%
123 123
124parted /dev/${device} print 124parted /dev/${device} print
125 125