From 9dc55ee56c9a9e25a7f7edf42499187bd31c0fc0 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 30 Jul 2013 12:18:19 -0700 Subject: [PATCH] builder/amazon/chroot: special case bind fstype --- builder/amazon/chroot/step_mount_extra.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/builder/amazon/chroot/step_mount_extra.go b/builder/amazon/chroot/step_mount_extra.go index be27708d1..3434059ff 100644 --- a/builder/amazon/chroot/step_mount_extra.go +++ b/builder/amazon/chroot/step_mount_extra.go @@ -35,12 +35,17 @@ func (s *StepMountExtra) Run(state map[string]interface{}) multistep.StepAction return multistep.ActionHalt } + flags := "-t " + mountInfo[0] + if mountInfo[0] == "bind" { + flags = "--bind" + } + ui.Message(fmt.Sprintf("Mounting: %s", mountInfo[2])) stderr := new(bytes.Buffer) mountCommand := fmt.Sprintf( - "%s -t %s %s %s", + "%s %s %s %s", config.MountCommand, - mountInfo[0], + flags, mountInfo[1], innerPath) cmd := exec.Command("/bin/sh", "-c", mountCommand)