packer-cn/builder/vsphere/examples/macos/setup/iso-setup.sh

28 lines
556 B
Bash
Raw Normal View History

2018-03-04 06:24:36 -05:00
#!/bin/sh
set -eux
mkdir -p out/pkgroot
rm -rf /out/pkgroot/*
mkdir -p out/scripts
rm -rf /out/scripts/*
cp postinstall out/scripts/
pkgbuild \
--identifier io.packer.install \
--root out/pkgroot \
--scripts out/scripts \
out/postinstall.pkg
mkdir -p out/iso
rm -rf out/iso/*
cp setup.sh out/iso/
2018-05-22 19:50:53 -04:00
chmod +x out/iso/setup.sh
2018-03-04 06:24:36 -05:00
productbuild --package out/postinstall.pkg out/iso/postinstall.pkg
2018-05-22 19:50:53 -04:00
rm -f out/setup.iso
2018-03-04 06:24:36 -05:00
hdiutil makehybrid -iso -joliet -default-volume-name setup -o out/setup.iso out/iso
cd out
shasum -a 256 setup.iso >sha256sums