6 if [ "$(id -u)" != "0" ]; then
7 echo "You should run this script as root (sudo)."
11 export DISTRIBUTION='fedora'
16 export ROOTFS="/var/lib/lxc/${CONTAINER}/rootfs"
17 export WORKING_DIR="/tmp/${CONTAINER}"
19 export LOG=$(readlink -f .)/log/${CONTAINER}.log
21 mkdir -p $(dirname $LOG)
22 echo '############################################' > ${LOG}
23 echo "# Beginning build at $(date)" >> ${LOG}
27 if [ -f ${PACKAGE} ]; then
28 warn "The box '${PACKAGE}' already exists, skipping..."
33 debug "Creating ${WORKING_DIR}"
34 mkdir -p ${WORKING_DIR}
36 info "Building box to '${PACKAGE}'..."
38 ./common/download.sh ${DISTRIBUTION} ${RELEASE} ${ARCH} ${CONTAINER}
39 ./fedora/install-extras.sh ${CONTAINER}
40 ./common/prepare-vagrant-user.sh ${DISTRIBUTION} ${CONTAINER}
41 ./fedora/clean.sh ${CONTAINER}
42 ./common/package.sh ${CONTAINER} ${PACKAGE}
44 info "Finished building '${PACKAGE}'!"
45 log "Run \`sudo lxc-destroy -n ${CONTAINER}\` or \`make clean\` to remove the container that was created along the way"