summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorDarren Hart <dvhart@linux.intel.com>2013-03-19 15:15:06 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-03-22 16:54:38 +0000
commitacc5f0d94b05378a6f68667742775f84dfdc7fe2 (patch)
treeac28cf757f9ce8b4460e5c035df8eb4e5d115e51 /scripts
parent663c39dc1e350449427be0156e1267d3ef95d59d (diff)
downloadpoky-acc5f0d94b05378a6f68667742775f84dfdc7fe2.tar.gz
mkefidisk: Use msdos partition tables
While GPT works fine when writing to actual media, it cannot be reliably used for distributing disk images as it requires the backup table to be on the last block on the device, which of course varies from device to device. Use MSDOS tables instead. Use mkfs to label the filesystems as msdos tables do not support partition labeling. (From OE-Core rev: 049ea1e0a6a1017a5020de38bd7ce93515bd62f4) Signed-off-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/contrib/mkefidisk.sh16
1 files changed, 7 insertions, 9 deletions
diff --git a/scripts/contrib/mkefidisk.sh b/scripts/contrib/mkefidisk.sh
index 6ff12af523..acadd49774 100755
--- a/scripts/contrib/mkefidisk.sh
+++ b/scripts/contrib/mkefidisk.sh
@@ -156,20 +156,18 @@ echo "*****************"
156echo "Deleting partition table on $DEVICE ..." 156echo "Deleting partition table on $DEVICE ..."
157dd if=/dev/zero of=$DEVICE bs=512 count=2 157dd if=/dev/zero of=$DEVICE bs=512 count=2
158 158
159echo "Creating new partition table (GPT) on $DEVICE ..." 159# Use MSDOS by default as GPT cannot be reliably distributed in disk image form
160parted $DEVICE mklabel gpt 160# as it requires the backup table to be on the last block of the device, which
161# of course varies from device to device.
162echo "Creating new partition table (MSDOS) on $DEVICE ..."
163parted $DEVICE mklabel msdos
161 164
162echo "Creating boot partition on $BOOTFS" 165echo "Creating boot partition on $BOOTFS"
163parted $DEVICE mkpart primary 0% $BOOT_SIZE 166parted $DEVICE mkpart primary 0% $BOOT_SIZE
164 167
165# GPT doesn't have a real boot flag, parted will change the GUID to EFI System
166# Partition, which is what we want
167echo "Enabling boot flag on $BOOTFS" 168echo "Enabling boot flag on $BOOTFS"
168parted $DEVICE set 1 boot on 169parted $DEVICE set 1 boot on
169 170
170echo "Labeling $BOOTFS as EFI System Partition"
171parted $DEVICE name 1 "EFI System Partition"
172
173echo "Creating ROOTFS partition on $ROOTFS" 171echo "Creating ROOTFS partition on $ROOTFS"
174parted $DEVICE mkpart primary $ROOTFS_START $ROOTFS_END 172parted $DEVICE mkpart primary $ROOTFS_START $ROOTFS_END
175 173
@@ -184,10 +182,10 @@ parted $DEVICE print
184# 182#
185echo "" 183echo ""
186echo "Formatting $BOOTFS as vfat..." 184echo "Formatting $BOOTFS as vfat..."
187mkfs.vfat $BOOTFS 185mkfs.vfat $BOOTFS -n "efi"
188 186
189echo "Formatting $ROOTFS as ext3..." 187echo "Formatting $ROOTFS as ext3..."
190mkfs.ext3 $ROOTFS 188mkfs.ext3 $ROOTFS -L "root"
191 189
192echo "Formatting swap partition...($SWAP)" 190echo "Formatting swap partition...($SWAP)"
193mkswap $SWAP 191mkswap $SWAP