Unified · Split
| @@ -62,6 +62,7 @@ Options · 61 unmodified lines | |||
| 62 | -h Show this help | 62 | -h Show this help |
| 63 | -r <repo> Set XBPS repository (may be set multiple times) | 63 | -r <repo> Set XBPS repository (may be set multiple times) |
| 64 | -x <num> Use <num> threads to compress the image (dynamic if unset) | 64 | -x <num> Use <num> threads to compress the image (dynamic if unset) |
| 65 | -o <file> Filename to write the ROOTFS archive to | ||
| 65 | -V Show version | 66 | -V Show version |
| 66 | _EOF | 67 | _EOF |
| 67 | } | 68 | } |
| @@ -72,13 +73,14 @@ _EOF · 4 unmodified lines | |||
| 72 | 73 | ||
| 73 | # Boilerplate option parsing. This script supports the bare minimum | 74 | # Boilerplate option parsing. This script supports the bare minimum |
| 74 | # needed to build an image. | 75 | # needed to build an image. |
| 75 | while getopts "C:c:h:r:x:V" opt; do | 76 | while getopts "C:c:h:r:x:o:V" opt; do |
| 76 | case $opt in | 77 | case $opt in |
| 77 | C) XBPS_CONFFILE="-C $OPTARG";; | 78 | C) XBPS_CONFFILE="-C $OPTARG";; |
| 78 | c) XBPS_CACHEDIR="--cachedir=$OPTARG";; | 79 | c) XBPS_CACHEDIR="--cachedir=$OPTARG";; |
| 79 | h) usage; exit 0;; | 80 | h) usage; exit 0;; |
| 80 | r) XBPS_REPOSITORY="$XBPS_REPOSITORY --repository=$OPTARG";; | 81 | r) XBPS_REPOSITORY="$XBPS_REPOSITORY --repository=$OPTARG";; |
| 81 | x) COMPRESSOR_THREADS="$OPTARG" ;; | 82 | x) COMPRESSOR_THREADS="$OPTARG" ;; |
| 83 | o) FILENAME="$OPTARG" ;; | ||
| 82 | V) echo "$PROGNAME @@MKLIVE_VERSION@@"; exit 0;; | 84 | V) echo "$PROGNAME @@MKLIVE_VERSION@@"; exit 0;; |
| 83 | esac | 85 | esac |
| 84 | done | 86 | done |
| @@ -206,7 +208,7 @@ rm -rf "$ROOTFS/var/cache/*" 2>/dev/null · 121 unmodified lines | |||
| 206 | 208 | ||
| 207 | # Finally we can compress the tarball, the name will include the | 209 | # Finally we can compress the tarball, the name will include the |
| 208 | # architecture and the date on which the tarball was built. | 210 | # architecture and the date on which the tarball was built. |
| 209 | tarball=void-${XBPS_TARGET_ARCH}-ROOTFS-$(date '+%Y%m%d').tar.xz | 211 | tarball=${FILENAME-void-${XBPS_TARGET_ARCH}-ROOTFS-$(date '+%Y%m%d').tar.xz} |
| 210 | run_cmd "tar -cp --posix --xattrs -C $ROOTFS . | xz -T${COMPRESSOR_THREADS:-0} -9 > $tarball " | 212 | run_cmd "tar -cp --posix --xattrs -C $ROOTFS . | xz -T${COMPRESSOR_THREADS:-0} -9 > $tarball " |
| 211 | 213 | ||
| 212 | # Now that we have the tarball we don't need the rootfs anymore, so we | 214 | # Now that we have the tarball we don't need the rootfs anymore, so we |