Commit 743682d3 authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

builder/amazon/chroot: default volumes dir is relative

parent 07ed22b4
...@@ -72,7 +72,7 @@ func (b *Builder) Prepare(raws ...interface{}) error { ...@@ -72,7 +72,7 @@ func (b *Builder) Prepare(raws ...interface{}) error {
} }
if b.config.MountPath == "" { 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 == "" { if b.config.UnmountCommand == "" {
......
...@@ -36,7 +36,16 @@ func (s *StepMountDevice) Run(state map[string]interface{}) multistep.StepAction ...@@ -36,7 +36,16 @@ func (s *StepMountDevice) Run(state map[string]interface{}) multistep.StepAction
Device: filepath.Base(device), Device: filepath.Base(device),
}) })
var err error
mountPath := mountPathRaw.String() 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) log.Printf("Mount path: %s", mountPath)
if err := os.MkdirAll(mountPath, 0755); err != nil { if err := os.MkdirAll(mountPath, 0755); err != nil {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment