mirror of
https://github.com/flatcar/scripts.git
synced 2026-05-04 19:56:32 +02:00
clean up install_gpt args to use number of sectors
Change-Id: I7d17db3cb522a52ec2dac688f4bf83fb5ae6a2d1 related CL: http://codereview.chromium.org/3031049/show TEST=(1)Manually built an image using build_image script, which exercised "build_gpt.sh"; (2) manually built a Qemu VM image using "image_to_vm.sh" and verified the VM is bootable (up to login screen); (3) manually built a dev recovery image using "mod_image_for_dev_recovery.sh" and verified image functions properly for dev recovery purpose Review URL: http://codereview.chromium.org/3050039
This commit is contained in:
parent
5e7a52f6b2
commit
0d5f948934
@ -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}
|
||||
|
||||
@ -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}"
|
||||
|
||||
@ -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 \
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user