Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 9 Feb 2015 10:42:28 +0000 (UTC)
From:      Glen Barber <gjb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r278449 - head/release
Message-ID:  <201502091042.t19AgS9J066654@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: gjb
Date: Mon Feb  9 10:42:27 2015
New Revision: 278449
URL: https://svnweb.freebsd.org/changeset/base/278449

Log:
  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

Modified:
  head/release/Makefile
  head/release/Makefile.vm

Modified: head/release/Makefile
==============================================================================
--- head/release/Makefile	Mon Feb  9 10:38:52 2015	(r278448)
+++ head/release/Makefile	Mon Feb  9 10:42:27 2015	(r278449)
@@ -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

Modified: head/release/Makefile.vm
==============================================================================
--- head/release/Makefile.vm	Mon Feb  9 10:38:52 2015	(r278448)
+++ head/release/Makefile.vm	Mon Feb  9 10:42:27 2015	(r278449)
@@ -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}* > \



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201502091042.t19AgS9J066654>