HardenedBSD/release/tools/gce-package.sh
Glen Barber dc1c45001a Add a CLOUDPACKAGE variable to contain a list of targets for
post-install packaging cloud provider images.

Add a 'gce-package.sh' script to generate the final output
image ready for upload to the GCE platform.  Right now, this
is the only image that has a specific output format (GNU-tar),
and this implementation is expected to be temporary.

This is not directly connected to the other release targets.

MFC after:	1 week
X-MFC-with:	r279249, r279250
Sponsored by:	The FreeBSD Foundation
2015-02-24 22:27:02 +00:00

48 lines
788 B
Bash
Executable File

#!/bin/sh
#
# $FreeBSD$
#
# Script to handle packaging cloud images for GCE.
#
# XXX:
# This script only exists to help in automating image creation,
# and reimplementing this is intended (in other words, this is
# temporary).
usage() {
echo "Usage:"
echo "$(basename ${0}) -D <destdir> -I <input_file> -S <src_tree>"
exit 1
}
main() {
while getopts "D:I:W:" opt; do
case ${opt} in
D)
DESTDIR="${OPTARG}"
;;
I)
INFILE="${OPTARG}"
;;
S)
WORLDDIR="${OPTARG}"
;;
*)
usage
;;
esac
done
shift $(( ${OPTIND} - 1 ))
if [ -z "${DESTDIR}" -o -z "${INFILE}" -o -z "${WORLDDIR}" ]; then
usage
fi
OUTFILE="$(make -C ${WORLDDIR}/release -V OSRELEASE).tar.gz"
cd ${DESTDIR} && tar --format=gnutar -zcf ${OUTFILE} ${INFILE}
}
main "$@"