# Installation and Configuration
mkdir -p src/
cd src
# clone official repository
git clone https://github.com/hashicorp/packer.git
cd packer
# build and get dependencies
go build
# generate plugin.go
go generate
# build for openbsd/amd64 and save file as packer.out
gox -os="openbsd" -arch="amd64" -output="packer.out"
# Create a new Builder
# create a new tree
mkdir -p builder/openbsd
touch builder/openbsd/artifact.go
touch builder/openbsd/builder.go
touch builder/openbsd/step_create_disk.go
touch builder/openbsd/step_run.go
touch builder/openbsd/step_shutdown.go
Generate config.hcl2.go with mapstructure-to-hcl2 -type Config
Example:
- https://github.com/hashicorp/packer/commit/7e36cfcff1e09470a3919d9fea08a7cd151fe960#diff-8b376821c8cce968f22c7f23ffd2ec32