builder/amazon/chroot: default volumes dir is relative
This commit is contained in:
parent
07ed22b4fa
commit
743682d352
|
@ -72,7 +72,7 @@ func (b *Builder) Prepare(raws ...interface{}) error {
|
|||
}
|
||||
|
||||
if b.config.MountPath == "" {
|
||||
b.config.MountPath = "/var/packer-amazon-chroot/volumes/{{.Device}}"
|
||||
b.config.MountPath = "packer-amazon-chroot-volumes/{{.Device}}"
|
||||
}
|
||||
|
||||
if b.config.UnmountCommand == "" {
|
||||
|
|
|
@ -36,7 +36,16 @@ func (s *StepMountDevice) Run(state map[string]interface{}) multistep.StepAction
|
|||
Device: filepath.Base(device),
|
||||
})
|
||||
|
||||
var err error
|
||||
mountPath := mountPathRaw.String()
|
||||
mountPath, err = filepath.Abs(mountPath)
|
||||
if err != nil {
|
||||
err := fmt.Errorf("Error preparing mount directory: %s", err)
|
||||
state["error"] = err
|
||||
ui.Error(err.Error())
|
||||
return multistep.ActionHalt
|
||||
}
|
||||
|
||||
log.Printf("Mount path: %s", mountPath)
|
||||
|
||||
if err := os.MkdirAll(mountPath, 0755); err != nil {
|
||||
|
|
Loading…
Reference in New Issue