Browse Source

MEN-5221: Keep the UUID of the original first partition

This simply writes the GPT UUID of the boot partition to be the same as the UUID
of the first partition in the original disk image.

Changelog: Keep the UUID of the original first partition on the boot partition
of the converted image when the partition table is GPT.

Signed-off-by: Ole Petter <ole.orhagen@northern.tech>
change-dependabot-prefix
Ole Petter 3 years ago
parent
commit
aed2dbd4e7
No known key found for this signature in database GPG Key ID: 399DBE0F4D4B02EB
  1. 4
      mender-convert-package

4
mender-convert-package

@ -256,6 +256,10 @@ if [ "${partition_scheme}" == "gpt" ]; then
log_info "Writing GPT partition table"
run_and_log_cmd "${PARTED} -s ${img_path} mklabel gpt"
run_and_log_cmd "${PARTED} -s ${img_path} unit s mkpart ESP fat32 ${boot_part_start} ${boot_part_end}"
# Keep the uuid of the original gpt table for the boot partition
boot_partuuid=$(disk_get_part_value "${disk_image}" 1 UUID)
log_info "Updating GPT partition uuid of the boot partition in image: ${img_path} to ${boot_partuuid}"
run_and_log_cmd "sgdisk -u ${MENDER_BOOT_PART_NUMBER}:${boot_partuuid} '${img_path}'"
else
log_info "Writing DOS (MBR) partition table"
run_and_log_cmd "${PARTED} -s ${img_path} mklabel msdos"

Loading…
Cancel
Save