diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2015-04-21 14:01:54 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-04-27 15:20:38 +0100 |
commit | 4d5c8758107467ca873f635b5b46ebc38d7f0b7d (patch) | |
tree | 4b218b6d2e57c42c492d4ef3e777f18a9d1446e1 /scripts | |
parent | 216d26aac2c78ddde4532713b5f0bfa560a346b9 (diff) | |
download | poky-4d5c8758107467ca873f635b5b46ebc38d7f0b7d.tar.gz |
mkefidisk.sh: use script mode when running parted
This avoids parted showing prompts and thus effectively hanging the
script in in the case of initially malformed disks.
(From OE-Core rev: 8f6eb9a86ce64b4c534342fe315069eb4064de88)
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/contrib/mkefidisk.sh | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/scripts/contrib/mkefidisk.sh b/scripts/contrib/mkefidisk.sh index b96b7d4f7d..74cf40d551 100755 --- a/scripts/contrib/mkefidisk.sh +++ b/scripts/contrib/mkefidisk.sh | |||
@@ -218,11 +218,11 @@ mkdir $BOOTFS_MNT || die "Failed to create $BOOTFS_MNT" | |||
218 | # | 218 | # |
219 | # Partition $DEVICE | 219 | # Partition $DEVICE |
220 | # | 220 | # |
221 | DEVICE_SIZE=$(parted $DEVICE unit mb print | grep ^Disk | cut -d" " -f 3 | sed -e "s/MB//") | 221 | DEVICE_SIZE=$(parted -s $DEVICE unit mb print | grep ^Disk | cut -d" " -f 3 | sed -e "s/MB//") |
222 | # If the device size is not reported there may not be a valid label | 222 | # If the device size is not reported there may not be a valid label |
223 | if [ "$DEVICE_SIZE" = "" ] ; then | 223 | if [ "$DEVICE_SIZE" = "" ] ; then |
224 | parted $DEVICE mklabel msdos || die "Failed to create MSDOS partition table" | 224 | parted -s $DEVICE mklabel msdos || die "Failed to create MSDOS partition table" |
225 | DEVICE_SIZE=$(parted $DEVICE unit mb print | grep ^Disk | cut -d" " -f 3 | sed -e "s/MB//") | 225 | DEVICE_SIZE=$(parted -s $DEVICE unit mb print | grep ^Disk | cut -d" " -f 3 | sed -e "s/MB//") |
226 | fi | 226 | fi |
227 | SWAP_SIZE=$((DEVICE_SIZE*SWAP_RATIO/100)) | 227 | SWAP_SIZE=$((DEVICE_SIZE*SWAP_RATIO/100)) |
228 | ROOTFS_SIZE=$((DEVICE_SIZE-BOOT_SIZE-SWAP_SIZE)) | 228 | ROOTFS_SIZE=$((DEVICE_SIZE-BOOT_SIZE-SWAP_SIZE)) |
@@ -262,22 +262,22 @@ debug "Deleting partition table on $DEVICE" | |||
262 | dd if=/dev/zero of=$DEVICE bs=512 count=2 >$OUT 2>&1 || die "Failed to zero beginning of $DEVICE" | 262 | dd if=/dev/zero of=$DEVICE bs=512 count=2 >$OUT 2>&1 || die "Failed to zero beginning of $DEVICE" |
263 | 263 | ||
264 | debug "Creating new partition table (MSDOS) on $DEVICE" | 264 | debug "Creating new partition table (MSDOS) on $DEVICE" |
265 | parted $DEVICE mklabel msdos >$OUT 2>&1 || die "Failed to create MSDOS partition table" | 265 | parted -s $DEVICE mklabel msdos >$OUT 2>&1 || die "Failed to create MSDOS partition table" |
266 | 266 | ||
267 | debug "Creating boot partition on $BOOTFS" | 267 | debug "Creating boot partition on $BOOTFS" |
268 | parted $DEVICE mkpart primary 0% $BOOT_SIZE >$OUT 2>&1 || die "Failed to create BOOT partition" | 268 | parted -s $DEVICE mkpart primary 0% $BOOT_SIZE >$OUT 2>&1 || die "Failed to create BOOT partition" |
269 | 269 | ||
270 | debug "Enabling boot flag on $BOOTFS" | 270 | debug "Enabling boot flag on $BOOTFS" |
271 | parted $DEVICE set 1 boot on >$OUT 2>&1 || die "Failed to enable boot flag" | 271 | parted -s $DEVICE set 1 boot on >$OUT 2>&1 || die "Failed to enable boot flag" |
272 | 272 | ||
273 | debug "Creating ROOTFS partition on $ROOTFS" | 273 | debug "Creating ROOTFS partition on $ROOTFS" |
274 | parted $DEVICE mkpart primary $ROOTFS_START $ROOTFS_END >$OUT 2>&1 || die "Failed to create ROOTFS partition" | 274 | parted -s $DEVICE mkpart primary $ROOTFS_START $ROOTFS_END >$OUT 2>&1 || die "Failed to create ROOTFS partition" |
275 | 275 | ||
276 | debug "Creating swap partition on $SWAP" | 276 | debug "Creating swap partition on $SWAP" |
277 | parted $DEVICE mkpart primary $SWAP_START 100% >$OUT 2>&1 || die "Failed to create SWAP partition" | 277 | parted -s $DEVICE mkpart primary $SWAP_START 100% >$OUT 2>&1 || die "Failed to create SWAP partition" |
278 | 278 | ||
279 | if [ $DEBUG -eq 1 ]; then | 279 | if [ $DEBUG -eq 1 ]; then |
280 | parted $DEVICE print | 280 | parted -s $DEVICE print |
281 | fi | 281 | fi |
282 | 282 | ||
283 | 283 | ||