Enable multi-threaded xz(1) compression, after r278433.
Allow multi-threaded xz(1) to be turned off by specifying NO_XZTHREADS, and allow number of threads to be overridden by specifying XZ_THREADS=N. MFC after: 1 week X-MFC-needs: r278433 Sponsored by: The FreeBSD Foundation
This commit is contained in:
parent
7bdb2409ca
commit
7ffa77fa95
@ -33,6 +33,9 @@
|
||||
# with xz(1) (extremely time consuming)
|
||||
# WITH_CLOUDWARE: if set, build cloud hosting disk images with the release
|
||||
# TARGET/TARGET_ARCH: architecture of built release
|
||||
# XZ_FLAGS: Additional arguments to pass to xz(1)
|
||||
# XZ_THREADS: Number of xz(1) threads to use
|
||||
# NO_XZTHREADS: Disable multi-threaded xz(1) compression
|
||||
#
|
||||
|
||||
WORLDDIR?= ${.CURDIR}/..
|
||||
@ -40,6 +43,8 @@ PORTSDIR?= /usr/ports
|
||||
DOCDIR?= /usr/doc
|
||||
RELNOTES_LANG?= en_US.ISO8859-1
|
||||
XZCMD?= /usr/bin/xz
|
||||
XZ_FLAGS?=
|
||||
XZ_THREADS?=
|
||||
|
||||
.if !defined(TARGET) || empty(TARGET)
|
||||
TARGET= ${MACHINE}
|
||||
@ -58,6 +63,15 @@ DISTDIR= dist
|
||||
FREEBSD_VERSION!= awk '/^\#define __FreeBSD_version/ {print $$3}' \
|
||||
${.CURDIR}/../sys/sys/param.h
|
||||
|
||||
.if !defined(NO_XZTHREADS) && empty(XZ_THREADS)
|
||||
XZ_THREADS= 0
|
||||
.else
|
||||
XZ_THREADS= ${XZ_THREADS}
|
||||
.endif
|
||||
.if !empty(XZ_THREADS)
|
||||
XZ_FLAGS+= -T ${XZ_THREADS}
|
||||
.endif
|
||||
|
||||
# Define OSRELEASE by using newvars.sh
|
||||
.if !defined(OSRELEASE) || empty(OSRELEASE)
|
||||
.for _V in TYPE BRANCH REVISION
|
||||
@ -299,7 +313,7 @@ release-install:
|
||||
.for I in ${IMAGES}
|
||||
cp -p ${I} ${DESTDIR}/${OSRELEASE}-${I}
|
||||
. if defined(WITH_COMPRESSED_IMAGES) && !empty(WITH_COMPRESSED_IMAGES)
|
||||
${XZCMD} -k ${DESTDIR}/${OSRELEASE}-${I}
|
||||
${XZCMD} ${XZ_FLAGS} -k ${DESTDIR}/${OSRELEASE}-${I}
|
||||
. endif
|
||||
.endfor
|
||||
cd ${DESTDIR} && sha256 ${OSRELEASE}* > ${DESTDIR}/CHECKSUM.SHA256
|
||||
|
@ -101,7 +101,7 @@ vm-install:
|
||||
# the DESTDIR.
|
||||
. for FORMAT in ${VMFORMATS}
|
||||
# Don't keep the originals. There is a copy in ${.OBJDIR} if needed.
|
||||
${XZCMD} ${DESTDIR}/vmimages/${OSRELEASE}.${FORMAT}
|
||||
${XZCMD} ${XZ_FLAGS} ${DESTDIR}/vmimages/${OSRELEASE}.${FORMAT}
|
||||
. endfor
|
||||
. endif
|
||||
cd ${DESTDIR}/vmimages && sha256 ${OSRELEASE}* > \
|
||||
|
Loading…
Reference in New Issue
Block a user