From 9debeafbf6a5b7273014c2c8e79eefeeff78d70c Mon Sep 17 00:00:00 2001 From: Michael Aldridge Date: Tue, 29 Aug 2017 22:42:40 -0700 Subject: [PATCH] mkrootfs.sh.in: support arbitrary filenames --- mkrootfs.sh.in | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mkrootfs.sh.in b/mkrootfs.sh.in index 4aa1241..eb6bd80 100644 --- a/mkrootfs.sh.in +++ b/mkrootfs.sh.in @@ -62,6 +62,7 @@ Options -h Show this help -r Set XBPS repository (may be set multiple times) -x Use threads to compress the image (dynamic if unset) + -o Filename to write the ROOTFS archive to -V Show version _EOF } @@ -72,13 +73,14 @@ _EOF # Boilerplate option parsing. This script supports the bare minimum # needed to build an image. -while getopts "C:c:h:r:x:V" opt; do +while getopts "C:c:h:r:x:o:V" opt; do case $opt in C) XBPS_CONFFILE="-C $OPTARG";; c) XBPS_CACHEDIR="--cachedir=$OPTARG";; h) usage; exit 0;; r) XBPS_REPOSITORY="$XBPS_REPOSITORY --repository=$OPTARG";; x) COMPRESSOR_THREADS="$OPTARG" ;; + o) FILENAME="$OPTARG" ;; V) echo "$PROGNAME @@MKLIVE_VERSION@@"; exit 0;; esac done @@ -206,7 +208,7 @@ rm -rf "$ROOTFS/var/cache/*" 2>/dev/null # Finally we can compress the tarball, the name will include the # architecture and the date on which the tarball was built. -tarball=void-${XBPS_TARGET_ARCH}-ROOTFS-$(date '+%Y%m%d').tar.xz +tarball=${FILENAME-void-${XBPS_TARGET_ARCH}-ROOTFS-$(date '+%Y%m%d').tar.xz} run_cmd "tar -cp --posix --xattrs -C $ROOTFS . | xz -T${COMPRESSOR_THREADS:-0} -9 > $tarball " # Now that we have the tarball we don't need the rootfs anymore, so we