mkplatformfs.sh: add option to disable compression
This commit is contained in:
parent
65f88c6d6f
commit
d3505ba860
|
@ -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)
|
||||||
|
-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
|
||||||
_EOF
|
_EOF
|
||||||
|
@ -71,8 +72,9 @@ _EOF
|
||||||
# ########################################
|
# ########################################
|
||||||
|
|
||||||
BASEPKG=base-system
|
BASEPKG=base-system
|
||||||
|
COMPRESSION="y"
|
||||||
|
|
||||||
while getopts "b:p:k:c:C:r:x:hV" opt; do
|
while getopts "b:p:k:c:C:r:x:nhV" opt; do
|
||||||
case $opt in
|
case $opt in
|
||||||
b) BASEPKG="$OPTARG" ;;
|
b) BASEPKG="$OPTARG" ;;
|
||||||
p) EXTRA_PKGS="$OPTARG" ;;
|
p) EXTRA_PKGS="$OPTARG" ;;
|
||||||
|
@ -81,6 +83,7 @@ while getopts "b:p:k:c:C:r:x:hV" 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" ;;
|
||||||
|
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 ;;
|
||||||
esac
|
esac
|
||||||
|
@ -207,17 +210,23 @@ cleanup_chroot
|
||||||
# only for it to be out of date, we remove it now.
|
# only for it to be out of date, we remove it now.
|
||||||
rm -rf "$ROOTFS/var/cache/*" 2>/dev/null
|
rm -rf "$ROOTFS/var/cache/*" 2>/dev/null
|
||||||
|
|
||||||
# Finally we can compress the tarball, the name will include the
|
# Compress the tarball or just print out the path?
|
||||||
# platform and the date on which the tarball was built.
|
if [ "$COMPRESSION" = "y" ]; then
|
||||||
tarball=void-${PLATFORM}-PLATFORMFS-$(date '+%Y%m%d').tar.xz
|
# Finally we can compress the tarball, the name will include the
|
||||||
run_cmd "tar -cp --posix --xattrs -C $ROOTFS . | xz -T${COMPRESSOR_THREADS:-0} -9 > $tarball "
|
# platform and the date on which the tarball was built.
|
||||||
|
tarball=void-${PLATFORM}-PLATFORMFS-$(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
|
# Now that we have the tarball we don't need the rootfs anymore, so we
|
||||||
# can get rid of it.
|
# can get rid of it.
|
||||||
rm -rf "$ROOTFS"
|
rm -rf "$ROOTFS"
|
||||||
|
|
||||||
# Last thing to do before closing out is to let the user know that
|
# Last thing to do before closing out is to let the user know that
|
||||||
# this succeeded. This also ensures that there's something visible
|
# this succeeded. This also ensures that there's something visible
|
||||||
# that the user can look for at the end of the script, which can make
|
# that the user can look for at the end of the script, which can make
|
||||||
# it easier to see what's going on if something above failed.
|
# it easier to see what's going on if something above failed.
|
||||||
info_msg "Successfully created $tarball ($PLATFORM)"
|
info_msg "Successfully created $tarball ($PLATFORM)"
|
||||||
|
else
|
||||||
|
# User requested just printing out the path to the rootfs, here it comes.
|
||||||
|
info_msg "Successfully created rootfs under $ROOTFS"
|
||||||
|
fi
|
||||||
|
|
Loading…
Reference in New Issue