|
|
|
|
@ -37,6 +37,7 @@ type Config struct {
|
|
|
|
|
SourceAmi string `mapstructure:"source_ami"`
|
|
|
|
|
RootVolumeSize int64 `mapstructure:"root_volume_size"`
|
|
|
|
|
MountOptions []string `mapstructure:"mount_options"`
|
|
|
|
|
MountPartition int `mapstructure:"mount_partition"`
|
|
|
|
|
|
|
|
|
|
ctx interpolate.Context
|
|
|
|
|
}
|
|
|
|
|
@ -97,6 +98,10 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, error) {
|
|
|
|
|
b.config.MountPath = "/mnt/packer-amazon-chroot-volumes/{{.Device}}"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if b.config.MountPartition == 0 {
|
|
|
|
|
b.config.MountPartition = 1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Accumulate any errors
|
|
|
|
|
var errs *packer.MultiError
|
|
|
|
|
errs = packer.MultiErrorAppend(errs, b.config.AccessConfig.Prepare(&b.config.ctx)...)
|
|
|
|
|
@ -169,7 +174,8 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
|
|
|
|
|
&StepAttachVolume{},
|
|
|
|
|
&StepEarlyUnflock{},
|
|
|
|
|
&StepMountDevice{
|
|
|
|
|
MountOptions: b.config.MountOptions,
|
|
|
|
|
MountOptions: b.config.MountOptions,
|
|
|
|
|
MountPartition: b.config.MountPartition,
|
|
|
|
|
},
|
|
|
|
|
&StepMountExtra{},
|
|
|
|
|
&StepCopyFiles{},
|
|
|
|
|
|