Add support for CDBUILDEXTRA which acts like CDEXTRA to add extra items

to the CD-ROM image.
Make CDEXTRA and CDBUILDEXTRA be able to contain lists of files and directories
which are added in turn.
Add support for CDEXTRA_SKIP which contains a list of fnmatch(3) items to
skip during the copy. This is _very_ useful for skipping CVS dirs for example.
CDBUILDEXTRA and CDEXTRA_SKIP are to be used in Makefiles creating the images,
CDEXTRA remains to be used from build.sh.
Update documentation and build.sh help text to show that -C can be used to
specify a list of files and directories rather than just a single dir.
This commit is contained in:
sborrill 2007-11-23 16:19:28 +00:00
parent 18558073a1
commit 14df52fe64
4 changed files with 60 additions and 36 deletions

View File

@ -634,15 +634,18 @@ BUILDING
-B buildid
Set the value of BUILDID to buildid. This will also append the
build idenfitier to the name of the ``make'' wrapper script so
build identifier to the name of the ``make'' wrapper script so
that the resulting name is of the form
``nbmake-MACHINE-BUILDID''.
-C cddir Set the value of CDEXTRA to cddir. If a relative path is spec-
ified, it will be converted to an absolute path before being
used. When combined with ``iso-image'' or
``iso-image-source'', it will cause the contents of cddir to be
added to the CD-ROM image.
-C cdextras
Set the value of CDEXTRA to cdextras which is a space-separated
list of files or directories which will be added in order to
the CD-ROM image when used in conjunction with ``iso-image'' or
``iso-image-source''. Files will be added to the root of the
CD-ROM image, whereas directories will be copied recursively.
If relative paths are specified, they will be converted to
absolute paths before being used.
-D dest Set the value of DESTDIR to dest. If a relative path is speci-
fied, it will be converted to an absolute path before being

View File

@ -1,5 +1,5 @@
#! /usr/bin/env sh
# $NetBSD: build.sh,v 1.178 2007/11/20 01:33:32 uebayasi Exp $
# $NetBSD: build.sh,v 1.179 2007/11/23 16:19:28 sborrill Exp $
#
# Copyright (c) 2001-2005 The NetBSD Foundation, Inc.
# All rights reserved.
@ -499,7 +499,7 @@ usage()
fi
cat <<_usage_
Usage: ${progname} [-EnorUux] [-a arch] [-B buildid] [-C cddir] [-D dest]
Usage: ${progname} [-EnorUux] [-a arch] [-B buildid] [-C cdextras] [-D dest]
[-j njob] [-M obj] [-m mach] [-N noisy] [-O obj] [-R release]
[-T tools] [-V var=[value]] [-w wrapper] [-X x11src] [-Z var]
operation [...]
@ -525,13 +525,13 @@ Usage: ${progname} [-EnorUux] [-a arch] [-B buildid] [-C cddir] [-D dest]
syspkgs Create syspkgs in RELEASEDIR/MACHINE/binary/syspkgs.
iso-image Create CD-ROM image in RELEASEDIR/iso.
iso-image-source Create CD-ROM image with source in RELEASEDIR/iso.
iso-dir=cddir Add the contents of \`cddir' to a CD-ROM image.
iso-dir=cdextras Add the contents of \`cdextras' to a CD-ROM image.
params Display various make(1) parameters.
Options:
-a arch Set MACHINE_ARCH to arch. [Default: deduced from MACHINE]
-B buildId Set BUILDID to buildId.
-C cddir Set CDEXTRA to cddir.
-C cdextras Set CDEXTRA to cdextras
-D dest Set DESTDIR to dest. [Default: destdir.MACHINE]
-E Set "expert" mode; disables various safety checks.
Should not be used without expert knowledge of the build system.
@ -1096,7 +1096,7 @@ createmakewrapper()
eval cat <<EOF ${makewrapout}
#! ${HOST_SH}
# Set proper variables to allow easy "make" building of a NetBSD subtree.
# Generated from: \$NetBSD: build.sh,v 1.178 2007/11/20 01:33:32 uebayasi Exp $
# Generated from: \$NetBSD: build.sh,v 1.179 2007/11/23 16:19:28 sborrill Exp $
# with these arguments: ${_args}
#

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile.bootcd,v 1.12 2007/11/20 16:12:50 sborrill Exp $
# $NetBSD: Makefile.bootcd,v 1.13 2007/11/23 16:19:28 sborrill Exp $
#
# Makefile snipped to create a CD/DVD ISO
#
@ -15,7 +15,12 @@
# CDRELEASE Set to 'true' to include $RELEASEDIR/$MACHINE on the CD
# CDRELEASE_NOISOS Excludes installation/cdrom directory if set
# CDSOURCE Set to 'true' to include $RELEASEDIR/source on the CD
# CDEXTRA Set to a directory containing extra stuff to put on CD
# CDEXTRA Set to a list of files or directories containing extra
# stuff to put on CD (set by build.sh -C flag)
# CDBUILDEXTRA Set to a list of files or directories containing extra
# stuff to put on CD (use in Makefiles)
# CDEXTRA_SKIP A list of file exclusion paths to exclude when copying
# directories of extra stuff in CDEXTRA AND CDBUILDEXTRA
# BOOT Defaults to $DESTDIR/usr/mdec/boot
# BOOTXX_CD9660 Defaults to $DESTDIR/usr/mdec/bootxx_cd9660
# CDBOOTOPTIONS Options for installboot, eg -o console=com0,speed=9600
@ -136,19 +141,35 @@ copy-releasedir:
. $$release_destdir; \
cd $$curdir; \
fi
if [ "X${CDEXTRA}" != "X" ]; then \
if [ ! -d ${CDEXTRA} ]; then \
echo "Missing ${CDEXTRA}, aborting"; \
exit 1; \
fi; \
if [ "X${CDEXTRA}${CDBUILDEXTRA}" != "X" ]; then \
curdir=$$(pwd); \
release_destdir=$$(pwd)/cdrom; \
cd ${CDEXTRA}; \
echo Copying $$(pwd) to $$release_destdir ...; \
${TOOL_PAX} \
-rw -pe -v \
. $$release_destdir; \
cd $$curdir; \
skipflag=""; \
if [ "X${CDEXTRA_SKIP}" != "X" ]; then \
rm -f cdskip; \
for skip in ${CDEXTRA_SKIP}; \
do \
echo $${skip} >> cdskip; \
done; \
skipflag="-X $${curdir}/cdskip"; \
fi; \
for cde in ${CDEXTRA} ${CDBUILDEXTRA}; \
do \
release_destdir=$${curdir}/cdrom; \
if [ -f $${cde} ]; then \
echo Copying $${cde} to $$release_destdir ...; \
${CP} $${cde} $${release_destdir}; \
elif [ -d $${cde} ]; then \
cd $${cde}; \
echo Copying $$(pwd) to $$release_destdir ...; \
${TOOL_MTREE} -c $${skipflag} | \
${TOOL_PAX} -rw -pe -v -M \
$$release_destdir; \
else \
echo "Missing $${cde}, aborting"; \
exit 1; \
fi; \
cd $$curdir; \
done; \
fi
image:

View File

@ -1,4 +1,4 @@
.\" $NetBSD: BUILDING.mdoc,v 1.53 2007/09/01 09:32:19 jnemeth Exp $
.\" $NetBSD: BUILDING.mdoc,v 1.54 2007/11/23 16:19:28 sborrill Exp $
.\"
.\" Copyright (c) 2001-2007 The NetBSD Foundation, Inc.
.\" All rights reserved.
@ -1198,25 +1198,25 @@ Set the value of
.Sy BUILDID
to
.Ar buildid .
This will also append the build idenfitier to the name of the
This will also append the build identifier to the name of the
.Dq make
wrapper script so that the resulting name is of the form
.Dq Sy \*[toolprefix]make-MACHINE-BUILDID .
.
.It Fl C Ar cddir
.It Fl C Ar cdextras
Set the value of
.Sy CDEXTRA
to
.Ar cddir .
If a relative path is specified, it will be converted to an
absolute path before being used.
When combined with
.Ar cdextras
which is a space-separated list of files or directories which will be
added in order to the CD-ROM image when used in conjunction with
.Dq iso-image
or
.Dq iso-image-source ,
it will cause the contents of
.Ar cddir
to be added to the CD-ROM image.
.Dq iso-image-source .
Files will be added to the root of the CD-ROM image, whereas directories
will be copied recursively.
If relative paths are specified, they will be converted to
absolute paths before being used.
.
.It Fl D Ar dest
Set the value of