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 -B buildid
Set the value of BUILDID to buildid. This will also append the 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 that the resulting name is of the form
``nbmake-MACHINE-BUILDID''. ``nbmake-MACHINE-BUILDID''.
-C cddir Set the value of CDEXTRA to cddir. If a relative path is spec- -C cdextras
ified, it will be converted to an absolute path before being Set the value of CDEXTRA to cdextras which is a space-separated
used. When combined with ``iso-image'' or list of files or directories which will be added in order to
``iso-image-source'', it will cause the contents of cddir to be the CD-ROM image when used in conjunction with ``iso-image'' or
added to the CD-ROM image. ``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- -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 fied, it will be converted to an absolute path before being

View File

@ -1,5 +1,5 @@
#! /usr/bin/env sh #! /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. # Copyright (c) 2001-2005 The NetBSD Foundation, Inc.
# All rights reserved. # All rights reserved.
@ -499,7 +499,7 @@ usage()
fi fi
cat <<_usage_ 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] [-j njob] [-M obj] [-m mach] [-N noisy] [-O obj] [-R release]
[-T tools] [-V var=[value]] [-w wrapper] [-X x11src] [-Z var] [-T tools] [-V var=[value]] [-w wrapper] [-X x11src] [-Z var]
operation [...] operation [...]
@ -525,13 +525,13 @@ Usage: ${progname} [-EnorUux] [-a arch] [-B buildid] [-C cddir] [-D dest]
syspkgs Create syspkgs in RELEASEDIR/MACHINE/binary/syspkgs. syspkgs Create syspkgs in RELEASEDIR/MACHINE/binary/syspkgs.
iso-image Create CD-ROM image in RELEASEDIR/iso. iso-image Create CD-ROM image in RELEASEDIR/iso.
iso-image-source Create CD-ROM image with source 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. params Display various make(1) parameters.
Options: Options:
-a arch Set MACHINE_ARCH to arch. [Default: deduced from MACHINE] -a arch Set MACHINE_ARCH to arch. [Default: deduced from MACHINE]
-B buildId Set BUILDID to buildId. -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] -D dest Set DESTDIR to dest. [Default: destdir.MACHINE]
-E Set "expert" mode; disables various safety checks. -E Set "expert" mode; disables various safety checks.
Should not be used without expert knowledge of the build system. Should not be used without expert knowledge of the build system.
@ -1096,7 +1096,7 @@ createmakewrapper()
eval cat <<EOF ${makewrapout} eval cat <<EOF ${makewrapout}
#! ${HOST_SH} #! ${HOST_SH}
# Set proper variables to allow easy "make" building of a NetBSD subtree. # 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} # 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 # Makefile snipped to create a CD/DVD ISO
# #
@ -15,7 +15,12 @@
# CDRELEASE Set to 'true' to include $RELEASEDIR/$MACHINE on the CD # CDRELEASE Set to 'true' to include $RELEASEDIR/$MACHINE on the CD
# CDRELEASE_NOISOS Excludes installation/cdrom directory if set # CDRELEASE_NOISOS Excludes installation/cdrom directory if set
# CDSOURCE Set to 'true' to include $RELEASEDIR/source on the CD # 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 # BOOT Defaults to $DESTDIR/usr/mdec/boot
# BOOTXX_CD9660 Defaults to $DESTDIR/usr/mdec/bootxx_cd9660 # BOOTXX_CD9660 Defaults to $DESTDIR/usr/mdec/bootxx_cd9660
# CDBOOTOPTIONS Options for installboot, eg -o console=com0,speed=9600 # CDBOOTOPTIONS Options for installboot, eg -o console=com0,speed=9600
@ -136,19 +141,35 @@ copy-releasedir:
. $$release_destdir; \ . $$release_destdir; \
cd $$curdir; \ cd $$curdir; \
fi fi
if [ "X${CDEXTRA}" != "X" ]; then \ if [ "X${CDEXTRA}${CDBUILDEXTRA}" != "X" ]; then \
if [ ! -d ${CDEXTRA} ]; then \
echo "Missing ${CDEXTRA}, aborting"; \
exit 1; \
fi; \
curdir=$$(pwd); \ curdir=$$(pwd); \
release_destdir=$$(pwd)/cdrom; \ skipflag=""; \
cd ${CDEXTRA}; \ if [ "X${CDEXTRA_SKIP}" != "X" ]; then \
echo Copying $$(pwd) to $$release_destdir ...; \ rm -f cdskip; \
${TOOL_PAX} \ for skip in ${CDEXTRA_SKIP}; \
-rw -pe -v \ do \
. $$release_destdir; \ echo $${skip} >> cdskip; \
cd $$curdir; \ 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 fi
image: 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. .\" Copyright (c) 2001-2007 The NetBSD Foundation, Inc.
.\" All rights reserved. .\" All rights reserved.
@ -1198,25 +1198,25 @@ Set the value of
.Sy BUILDID .Sy BUILDID
to to
.Ar buildid . .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 .Dq make
wrapper script so that the resulting name is of the form wrapper script so that the resulting name is of the form
.Dq Sy \*[toolprefix]make-MACHINE-BUILDID . .Dq Sy \*[toolprefix]make-MACHINE-BUILDID .
. .
.It Fl C Ar cddir .It Fl C Ar cdextras
Set the value of Set the value of
.Sy CDEXTRA .Sy CDEXTRA
to to
.Ar cddir . .Ar cdextras
If a relative path is specified, it will be converted to an which is a space-separated list of files or directories which will be
absolute path before being used. added in order to the CD-ROM image when used in conjunction with
When combined with
.Dq iso-image .Dq iso-image
or or
.Dq iso-image-source , .Dq iso-image-source .
it will cause the contents of Files will be added to the root of the CD-ROM image, whereas directories
.Ar cddir will be copied recursively.
to be added to the CD-ROM image. If relative paths are specified, they will be converted to
absolute paths before being used.
. .
.It Fl D Ar dest .It Fl D Ar dest
Set the value of Set the value of