diff --git a/build_gpt.sh b/build_gpt.sh index 8247f65c68..84888a902c 100755 --- a/build_gpt.sh +++ b/build_gpt.sh @@ -119,8 +119,8 @@ fi # Create the GPT. This has the side-effect of setting some global vars # describing the partition table entries (see the comments in the source). -install_gpt $OUTDEV $ROOTFS_IMG $STATEFUL_IMG $PMBRCODE $ESP_IMG \ - false $FLAGS_rootfs_partition_size +install_gpt $OUTDEV $(numsectors $ROOTFS_IMG) $(numsectors $STATEFUL_IMG) \ + $PMBRCODE $(numsectors $ESP_IMG) false $FLAGS_rootfs_partition_size if [[ "$ARCH" = "arm" ]]; then # assume /dev/mmcblk1. we could not get this from ${OUTDEV} diff --git a/image_to_vm.sh b/image_to_vm.sh index ac8f648c99..f1b977705b 100755 --- a/image_to_vm.sh +++ b/image_to_vm.sh @@ -229,8 +229,9 @@ sudo dd if=/dev/zero of="${TEMP_IMG}" bs=1 count=1 \ seek=$((${FLAGS_vdisk_size} * 1024 * 1024 - 1)) # Set up the partition table -install_gpt "${TEMP_IMG}" "${TEMP_ROOTFS}" "${TEMP_STATE}" \ - "${TEMP_PMBR}" "${TEMP_ESP}" false ${FLAGS_rootfs_partition_size} +install_gpt "${TEMP_IMG}" "$(numsectors $TEMP_ROOTFS)" \ + "$(numsectors $TEMP_STATE)" "${TEMP_PMBR}" "$(numsectors $TEMP_ESP)" \ + false ${FLAGS_rootfs_partition_size} # Copy into the partition parts of the file dd if="${TEMP_ROOTFS}" of="${TEMP_IMG}" conv=notrunc bs=512 \ seek="${START_ROOTFS_A}" diff --git a/mod_image_for_dev_recovery.sh b/mod_image_for_dev_recovery.sh index 1a13047ea4..3ff2161335 100755 --- a/mod_image_for_dev_recovery.sh +++ b/mod_image_for_dev_recovery.sh @@ -115,8 +115,9 @@ update_partition_table() { dd if="${FLAGS_dev_install_shim}" of="${TEMP_PMBR}" bs=512 count=1 # Set up a new partition table - install_gpt "${TEMP_IMG}" "${TEMP_ROOTFS}" "${TEMP_STATE}" "${TEMP_PMBR}" \ - "${TEMP_ESP}" false $(roundup $(numsectors ${TEMP_ROOTFS})) + install_gpt "${TEMP_IMG}" "$(numsectors $TEMP_ROOTFS)" \ + "$(numsectors $TEMP_STATE)" "${TEMP_PMBR}" "$(numsectors $TEMP_ESP)" \ + false $(roundup $(numsectors ${TEMP_ROOTFS})) # Copy into the partition parts of the file dd if="${TEMP_ROOTFS}" of="${TEMP_IMG}" conv=notrunc bs=512 \