Add a new release build variable, WITH_COMPRESSED_IMAGES.

When set to a non-empty value, the installation medium is
compressed with gzip(1) as part of the 'install' target in
the release/ directory.

With gzip(1) compression, downloadable image are reduced in
size quite significantly.  Build test against head@263927
shows the following:

 bootonly.iso:		64% smaller
 disc1.iso:		44% smaller
 memstick.img:		47% smaller
 mini-memstick.img:	65% smaller
 dvd1.iso:		untested

This option is off by default, I would eventually like to
turn it on by default, and remove the '-k' flag to gzip(1)
so only compressed images are published on FTP.

Requested by:	wkoszek
MFC After:	1 week
Sponsored by:	The FreeBSD Foundation
This commit is contained in:
Glen Barber 2014-04-01 22:41:26 +00:00
parent 038fc7c630
commit cbc0e08a7b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=264027
4 changed files with 15 additions and 1 deletions

View file

@ -21,6 +21,8 @@
# NOSRC: if set, do not distribute source tree
# NODOC: if set, do not generate release documentation
# WITH_DVD: if set, generate dvd1.iso
# WITH_COMPRESSED_IMAGES: if set, compress installation images with gzip(1)
# (uncompressed images are not removed)
# TARGET/TARGET_ARCH: architecture of built release
#
@ -251,6 +253,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)
gzip -k ${DESTDIR}/${OSRELEASE}-${I}
. endif
.endfor
cd ${DESTDIR} && sha256 ${OSRELEASE}* > ${DESTDIR}/CHECKSUM.SHA256
cd ${DESTDIR} && md5 ${OSRELEASE}* > ${DESTDIR}/CHECKSUM.MD5

View file

@ -46,6 +46,7 @@ PORTBRANCH="ports/head@rHEAD"
#NODOC=
#NOPORTS=
#WITH_DVD=
#WITH_COMPRESSED_IMAGES=
## Set when building embedded images.
#EMBEDDEDBUILD=

View file

@ -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/src ${RELEASE_KMAKEFLAGS} buildkernel
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}

View file

@ -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 gzip 1 .
The original
.Pq uncompressed
images are not removed.
.It Va VCSCMD
The command run to obtain the source trees.
Defaults to