2014-03-08 02:34:09 +00:00
|
|
|
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
|
2014-03-08 05:34:51 +00:00
|
|
|
source common/ui.sh
|
2014-03-08 02:34:09 +00:00
|
|
|
|
2014-03-08 05:34:51 +00:00
|
|
|
info "Packaging '${CONTAINER}' to '${PACKAGE}'..."
|
2014-03-08 13:42:28 +00:00
|
|
|
|
|
|
|
debug 'Stopping container'
|
|
|
|
lxc-stop -n ${CONTAINER} &>/dev/null || true
|
|
|
|
|
|
|
|
debug "Removing previous rootfs tarbal"
|
|
|
|
rm -f ${WORKING_DIR}/rootfs.tar.gz
|
|
|
|
|
|
|
|
log "Compressing container's rootfs"
|
|
|
|
cd $(dirname ${ROOTFS})
|
|
|
|
tar --numeric-owner -czf ${WORKING_DIR}/rootfs.tar.gz ./rootfs/*
|
|
|
|
|
|
|
|
# Prepare package contents
|
|
|
|
cd ${WORKING_DIR}
|
|
|
|
|
|
|
|
warn 'TODO: Package!'
|