From 710b6a41ec0041c6a08d647a82f167df6b1a3ba5 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 30 Jul 2013 11:41:16 -0700 Subject: [PATCH] builder/amazon/chroot: use the attached device path --- builder/amazon/chroot/builder.go | 4 ++++ builder/amazon/chroot/step_attach_volume.go | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/builder/amazon/chroot/builder.go b/builder/amazon/chroot/builder.go index cf8848903..ceb4a5c76 100644 --- a/builder/amazon/chroot/builder.go +++ b/builder/amazon/chroot/builder.go @@ -63,6 +63,10 @@ func (b *Builder) Prepare(raws ...interface{}) error { b.config.DevicePath = "/dev/sdh" } + if b.config.AttachedDevicePath == "" { + b.config.AttachedDevicePath = "/dev/xvdh" + } + if b.config.MountCommand == "" { b.config.MountCommand = "mount" } diff --git a/builder/amazon/chroot/step_attach_volume.go b/builder/amazon/chroot/step_attach_volume.go index cf5f89e3e..69d96988e 100644 --- a/builder/amazon/chroot/step_attach_volume.go +++ b/builder/amazon/chroot/step_attach_volume.go @@ -69,7 +69,7 @@ func (s *StepAttachVolume) Run(state map[string]interface{}) multistep.StepActio return multistep.ActionHalt } - state["device"] = device + state["device"] = config.AttachedDevicePath return multistep.ActionContinue }