Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 8 Apr 2014 00:53:31 +0000 (UTC)
From:      Glen Barber <gjb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r264245 - in stable/10: release share/man/man7
Message-ID:  <201404080053.s380rVas016103@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: gjb
Date: Tue Apr  8 00:53:31 2014
New Revision: 264245
URL: http://svnweb.freebsd.org/changeset/base/264245

Log:
  MFC r264027, r264028, r264029, r264030, r264046, r264073:
  
  r264027:
    Add a new release build variable, WITH_COMPRESSED_IMAGES.
  
    When set to a non-empty value, the installation medium is
    compressed as part of the 'install' target in the release/
    directory.
  
  r264028:
    Clean up trailing whitespace in release/Makefile.
  
  r264029:
    Fix logic error.
  
  r264030:
    If WITH_COMPRESSED_IMAGES is set, add the compressed images
    to the CLEANFILES list.
  
  r264046:
    Use xz(1) instead of gzip(1) to compress release images
    when WITH_COMPRESSED_IMAGES is used.
  
  r264073:
    Allow overriding xz(1) path.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  stable/10/release/Makefile
  stable/10/release/release.conf.sample
  stable/10/release/release.sh
  stable/10/share/man/man7/release.7
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/release/Makefile
==============================================================================
--- stable/10/release/Makefile	Mon Apr  7 22:49:41 2014	(r264244)
+++ stable/10/release/Makefile	Tue Apr  8 00:53:31 2014	(r264245)
@@ -1,7 +1,7 @@
 # $FreeBSD$
 #
 # Makefile for building releases and release media.
-# 
+#
 # User-driven targets:
 #  cdrom: Builds release CD-ROM media (disc1.iso)
 #  dvdrom: Builds release DVD-ROM media (dvd1.iso)
@@ -13,7 +13,7 @@
 #
 # Variables affecting the build process:
 #  WORLDDIR: location of src tree -- must have built world and default kernel
-#            (by default, the directory above this one) 
+#            (by default, the directory above this one)
 #  PORTSDIR: location of ports tree to distribute (default: /usr/ports)
 #  DOCDIR:   location of doc tree (default: /usr/doc)
 #  NOPKG:    if set, do not distribute third-party packages
@@ -21,13 +21,16 @@
 #  NOSRC:    if set, do not distribute source tree
 #  NODOC:    if set, do not generate release documentation
 #  WITH_DVD: if set, generate dvd1.iso
-#  TARGET/TARGET_ARCH: architecture of built release 
+#  WITH_COMPRESSED_IMAGES: if set, compress installation images with xz(1)
+#		(uncompressed images are not removed)
+#  TARGET/TARGET_ARCH: architecture of built release
 #
 
 WORLDDIR?=	${.CURDIR}/..
 PORTSDIR?=	/usr/ports
 DOCDIR?=	/usr/doc
 RELNOTES_LANG?= en_US.ISO8859-1
+XZCMD?=		/usr/bin/xz
 
 .if !defined(TARGET) || empty(TARGET)
 TARGET=		${MACHINE}
@@ -63,7 +66,7 @@ NODOC= true
 NOPORTS= true
 .endif
 
-EXTRA_PACKAGES= 
+EXTRA_PACKAGES=
 .if !defined(NOPORTS)
 EXTRA_PACKAGES+= ports.txz
 .endif
@@ -92,6 +95,11 @@ IMAGES+=	mini-memstick.img
 .endif
 
 CLEANFILES=	packagesystem *.txz MANIFEST system ${IMAGES}
+.if defined(WITH_COMPRESSED_IMAGES) && !empty(WITH_COMPRESSED_IMAGES)
+. for I in ${IMAGES}
+CLEANFILES+=	${I}.xz
+. endfor
+.endif
 CLEANDIRS=	dist ftp release bootonly dvd
 beforeclean:
 	chflags -R noschg .
@@ -251,6 +259,9 @@ install:
 	cp -a ftp ${DESTDIR}/
 .for I in ${IMAGES}
 	cp -p ${I} ${DESTDIR}/${OSRELEASE}-${I}
+. if defined(WITH_COMPRESSED_IMAGES) && !empty(WITH_COMPRESSED_IMAGES)
+	${XZCMD} -k ${DESTDIR}/${OSRELEASE}-${I}
+. endif
 .endfor
 	cd ${DESTDIR} && sha256 ${OSRELEASE}* > ${DESTDIR}/CHECKSUM.SHA256
 	cd ${DESTDIR} && md5 ${OSRELEASE}* > ${DESTDIR}/CHECKSUM.MD5

Modified: stable/10/release/release.conf.sample
==============================================================================
--- stable/10/release/release.conf.sample	Mon Apr  7 22:49:41 2014	(r264244)
+++ stable/10/release/release.conf.sample	Tue Apr  8 00:53:31 2014	(r264245)
@@ -46,6 +46,7 @@ PORTBRANCH="ports/head@rHEAD"
 #NODOC=
 #NOPORTS=
 #WITH_DVD=
+#WITH_COMPRESSED_IMAGES=
 
 ## Set when building embedded images.
 #EMBEDDEDBUILD=

Modified: stable/10/release/release.sh
==============================================================================
--- stable/10/release/release.sh	Mon Apr  7 22:49:41 2014	(r264244)
+++ stable/10/release/release.sh	Tue Apr  8 00:53:31 2014	(r264245)
@@ -83,6 +83,7 @@ NOPORTS=
 
 # Set to non-empty value to build dvd1.iso as part of the release.
 WITH_DVD=
+WITH_COMPRESSED_IMAGES=
 
 usage() {
 	echo "Usage: $0 [-c release.conf]"
@@ -128,6 +129,7 @@ if [ -n "${EMBEDDEDBUILD}" ]; then
 		exit 1
 	fi
 	WITH_DVD=
+	WITH_COMPRESSED_IMAGES=
 	NODOC=yes
 fi
 
@@ -262,4 +264,4 @@ eval chroot ${CHROOTDIR} make -C /usr/sr
 eval chroot ${CHROOTDIR} make -C /usr/src/release ${RELEASE_RMAKEFLAGS} \
 	release
 eval chroot ${CHROOTDIR} make -C /usr/src/release ${RELEASE_RMAKEFLAGS} \
-	install DESTDIR=/R
+	install DESTDIR=/R WITH_COMPRESSED_IMAGES=${WITH_COMPRESSED_IMAGES}

Modified: stable/10/share/man/man7/release.7
==============================================================================
--- stable/10/share/man/man7/release.7	Mon Apr  7 22:49:41 2014	(r264244)
+++ stable/10/share/man/man7/release.7	Tue Apr  8 00:53:31 2014	(r264245)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd March 5, 2014
+.Dd April 2, 2014
 .Dt RELEASE 7
 .Os
 .Sh NAME
@@ -250,6 +250,12 @@ Setting this also sets
 Set to a non-empty value to include the
 .Cm dvdrom
 target.
+.It Va WITH_COMPRESSED_IMAGES
+Set to a non-empty value to compress the release images with
+.Xr xz 1 .
+The original
+.Pq uncompressed
+images are not removed.
 .It Va VCSCMD
 The command run to obtain the source trees.
 Defaults to



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