From d3c65ee77dac4a18b90efb1a45363d1377641328 Mon Sep 17 00:00:00 2001 From: Sargun Dhillon Date: Fri, 22 Feb 2019 17:26:58 -0800 Subject: [PATCH] builder/amazon/chroot: Fix building PV images with mount_partition Right now, if we have a source image that's PV, and try to build an image with mount_partition set to not 0, it does not get picked up. This is because under PV we only had a filesystem, not partitions, but you can convert a PV image to an HVM image during build time. --- builder/amazon/chroot/step_mount_device.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builder/amazon/chroot/step_mount_device.go b/builder/amazon/chroot/step_mount_device.go index 38ec62164..a05a0fdea 100644 --- a/builder/amazon/chroot/step_mount_device.go +++ b/builder/amazon/chroot/step_mount_device.go @@ -42,7 +42,7 @@ func (s *StepMountDevice) Run(_ context.Context, state multistep.StateBag) multi wrappedCommand := state.Get("wrappedCommand").(CommandWrapper) var virtualizationType string - if config.FromScratch { + if config.FromScratch || config.AMIVirtType != "" { virtualizationType = config.AMIVirtType } else { image := state.Get("source_image").(*ec2.Image)