Add -o <outfile> to mkplatformfs.sh for feature parity

This commit is contained in:
Adam Gausmann 2020-02-14 12:23:37 -06:00 committed by Michael Aldridge
parent 4ffa689706
commit 3c12c74de0

View File

@ -61,6 +61,7 @@ Options
-C <file> Full path to the XBPS configuration file -C <file> Full path to the XBPS configuration file
-r <repo> Set XBPS repository (may be set multiple times) -r <repo> Set XBPS repository (may be set multiple times)
-x <num> Use <num> threads to compress the image (dynamic if unset) -x <num> Use <num> threads to compress the image (dynamic if unset)
-o <file> Filename to write the PLATFORMFS archive to
-n Do not compress the image, instead print out the rootfs directory -n Do not compress the image, instead print out the rootfs directory
-h Show this help -h Show this help
-V Show version -V Show version
@ -74,7 +75,7 @@ _EOF
BASEPKG=base-system BASEPKG=base-system
COMPRESSION="y" COMPRESSION="y"
while getopts "b:p:k:c:C:r:x:nhV" opt; do while getopts "b:p:k:c:C:r:x:o:nhV" opt; do
case $opt in case $opt in
b) BASEPKG="$OPTARG" ;; b) BASEPKG="$OPTARG" ;;
p) EXTRA_PKGS="$OPTARG" ;; p) EXTRA_PKGS="$OPTARG" ;;
@ -83,6 +84,7 @@ while getopts "b:p:k:c:C:r:x:nhV" opt; do
C) XBPS_CONFFILE="-C $OPTARG" ;; C) XBPS_CONFFILE="-C $OPTARG" ;;
r) XBPS_REPOSITORY="$XBPS_REPOSITORY --repository=$OPTARG" ;; r) XBPS_REPOSITORY="$XBPS_REPOSITORY --repository=$OPTARG" ;;
x) COMPRESSOR_THREADS="$OPTARG" ;; x) COMPRESSOR_THREADS="$OPTARG" ;;
o) FILENAME="$OPTARG" ;;
n) COMPRESSION="n" ;; n) COMPRESSION="n" ;;
h) usage; exit 0 ;; h) usage; exit 0 ;;
V) echo "$PROGNAME @@MKLIVE_VERSION@@"; exit 0 ;; V) echo "$PROGNAME @@MKLIVE_VERSION@@"; exit 0 ;;
@ -222,7 +224,7 @@ fi
if [ "$COMPRESSION" = "y" ]; then if [ "$COMPRESSION" = "y" ]; then
# Finally we can compress the tarball, the name will include the # Finally we can compress the tarball, the name will include the
# platform and the date on which the tarball was built. # platform and the date on which the tarball was built.
tarball=void-${PLATFORM}-PLATFORMFS-$(date '+%Y%m%d').tar.xz tarball=${FILENAME:-void-${PLATFORM}-PLATFORMFS-$(date '+%Y%m%d').tar.xz}
run_cmd "tar -cp --posix --xattrs -C $ROOTFS . | xz -T${COMPRESSOR_THREADS:-0} -9 > $tarball " 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 # Now that we have the tarball we don't need the rootfs anymore, so we