Sat Oct 13 18:40:33 2012 UTC ()
Update to 2.4:

- Add a MKVARS variable to pass arbitrary variables to build.sh through -V.
  E.g. MKVARS="MKDEBUG=yes".
- Move the documentation of the configuration file to a new sysbuild.conf(5).


(jmmv)
diff -r1.21 -r1.22 pkgsrc/sysutils/sysbuild/Makefile
diff -r1.6 -r1.7 pkgsrc/sysutils/sysbuild/PLIST
diff -r1.5 -r1.6 pkgsrc/sysutils/sysbuild/files/sysbuild.1
diff -r0 -r1.1 pkgsrc/sysutils/sysbuild/files/sysbuild.conf.5
diff -r1.15 -r1.16 pkgsrc/sysutils/sysbuild/files/sysbuild.sh
diff -r1.4 -r1.5 pkgsrc/sysutils/sysbuild/files/sysbuild_test.sh

cvs diff -r1.21 -r1.22 pkgsrc/sysutils/sysbuild/Makefile (expand / switch to unified diff)

--- pkgsrc/sysutils/sysbuild/Makefile 2012/08/25 19:20:53 1.21
+++ pkgsrc/sysutils/sysbuild/Makefile 2012/10/13 18:40:33 1.22
@@ -1,16 +1,16 @@ @@ -1,16 +1,16 @@
1# $NetBSD: Makefile,v 1.21 2012/08/25 19:20:53 jmmv Exp $ 1# $NetBSD: Makefile,v 1.22 2012/10/13 18:40:33 jmmv Exp $
2 2
3DISTNAME= sysbuild-2.3 3DISTNAME= sysbuild-2.4
4CATEGORIES= sysutils 4CATEGORIES= sysutils
5MASTER_SITES= # empty 5MASTER_SITES= # empty
6DISTFILES= # empty 6DISTFILES= # empty
7 7
8MAINTAINER= jmmv@NetBSD.org 8MAINTAINER= jmmv@NetBSD.org
9COMMENT= Automates builds of NetBSD and manages source trees 9COMMENT= Automates builds of NetBSD and manages source trees
10LICENSE= modified-bsd 10LICENSE= modified-bsd
11 11
12PKG_INSTALLATION_TYPES= overwrite pkgviews 12PKG_INSTALLATION_TYPES= overwrite pkgviews
13PKG_DESTDIR_SUPPORT= user-destdir 13PKG_DESTDIR_SUPPORT= user-destdir
14 14
15WRKSRC= ${WRKDIR} 15WRKSRC= ${WRKDIR}
16NO_CONFIGURE= YES 16NO_CONFIGURE= YES
@@ -58,36 +58,38 @@ install-tests: @@ -58,36 +58,38 @@ install-tests:
58do-test: 58do-test:
59 cd ${WRKSRC} && PATH="${WRKSRC}:${PATH}" \ 59 cd ${WRKSRC} && PATH="${WRKSRC}:${PATH}" \
60 SYSBUILD_SHAREDIR="${WRKSRC}" kyua test 60 SYSBUILD_SHAREDIR="${WRKSRC}" kyua test
61.else 61.else
62PLIST_SUBST+= TESTS=@comment 62PLIST_SUBST+= TESTS=@comment
63.endif 63.endif
64 64
65do-build: 65do-build:
66.for file in sysbuild sysbuild4cron 66.for file in sysbuild sysbuild4cron
67 sed ${BUILD_SUBST} ${FILESDIR}/${file}.sh \ 67 sed ${BUILD_SUBST} ${FILESDIR}/${file}.sh \
68 | ${BUILDLINK_PREFIX.shtk}/bin/shtk build \ 68 | ${BUILDLINK_PREFIX.shtk}/bin/shtk build \
69 -s ${SH} -m ${file}_main -o ${WRKSRC}/${file} - 69 -s ${SH} -m ${file}_main -o ${WRKSRC}/${file} -
70.endfor 70.endfor
71.for file in sysbuild.1 sysbuild4cron.1 default.conf 71.for file in sysbuild.1 sysbuild4cron.1 sysbuild.conf.5 default.conf
72 sed ${BUILD_SUBST} <${FILESDIR}/${file} >${WRKSRC}/${file} 72 sed ${BUILD_SUBST} <${FILESDIR}/${file} >${WRKSRC}/${file}
73.endfor 73.endfor
74 cp ${FILESDIR}/env.sh ${WRKSRC} 74 cp ${FILESDIR}/env.sh ${WRKSRC}
75 chmod +x ${WRKSRC}/env.sh 75 chmod +x ${WRKSRC}/env.sh
76 76
77INSTALLATION_DIRS+= bin ${PKGMANDIR}/man1 \ 77INSTALLATION_DIRS+= bin ${PKGMANDIR}/man1 ${PKGMANDIR}/man5 \
78 share/examples/sysbuild share/sysbuild 78 share/examples/sysbuild share/sysbuild
79 79
80do-install: 80do-install:
81 ${INSTALL_SCRIPT} ${WRKSRC}/sysbuild ${DESTDIR}${PREFIX}/bin/ 81 ${INSTALL_SCRIPT} ${WRKSRC}/sysbuild ${DESTDIR}${PREFIX}/bin/
82 ${INSTALL_SCRIPT} ${WRKSRC}/sysbuild4cron ${DESTDIR}${PREFIX}/bin/ 82 ${INSTALL_SCRIPT} ${WRKSRC}/sysbuild4cron ${DESTDIR}${PREFIX}/bin/
83 ${INSTALL_MAN} ${WRKSRC}/sysbuild.1 \ 83 ${INSTALL_MAN} ${WRKSRC}/sysbuild.1 \
84 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1/ 84 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1/
85 ${INSTALL_MAN} ${WRKSRC}/sysbuild4cron.1 \ 85 ${INSTALL_MAN} ${WRKSRC}/sysbuild4cron.1 \
86 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1/ 86 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1/
 87 ${INSTALL_MAN} ${WRKSRC}/sysbuild.conf.5 \
 88 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man5/
87.for file in default.conf 89.for file in default.conf
88 ${INSTALL_DATA} ${WRKSRC}/${file} ${DESTDIR}${EGDIR} 90 ${INSTALL_DATA} ${WRKSRC}/${file} ${DESTDIR}${EGDIR}
89.endfor 91.endfor
90 ${INSTALL_SCRIPT} ${WRKSRC}/env.sh ${DESTDIR}${PREFIX}/share/sysbuild 92 ${INSTALL_SCRIPT} ${WRKSRC}/env.sh ${DESTDIR}${PREFIX}/share/sysbuild
91 93
92.include "../../devel/shtk/buildlink3.mk" 94.include "../../devel/shtk/buildlink3.mk"
93.include "../../mk/bsd.pkg.mk" 95.include "../../mk/bsd.pkg.mk"

cvs diff -r1.6 -r1.7 pkgsrc/sysutils/sysbuild/PLIST (expand / switch to unified diff)

--- pkgsrc/sysutils/sysbuild/PLIST 2012/08/25 19:20:53 1.6
+++ pkgsrc/sysutils/sysbuild/PLIST 2012/10/13 18:40:33 1.7
@@ -1,10 +1,11 @@ @@ -1,10 +1,11 @@
1@comment $NetBSD: PLIST,v 1.6 2012/08/25 19:20:53 jmmv Exp $ 1@comment $NetBSD: PLIST,v 1.7 2012/10/13 18:40:33 jmmv Exp $
2bin/sysbuild 2bin/sysbuild
3bin/sysbuild4cron 3bin/sysbuild4cron
4man/man1/sysbuild.1 4man/man1/sysbuild.1
5man/man1/sysbuild4cron.1 5man/man1/sysbuild4cron.1
 6man/man5/sysbuild.conf.5
6share/examples/sysbuild/default.conf 7share/examples/sysbuild/default.conf
7share/sysbuild/env.sh 8share/sysbuild/env.sh
8${TESTS}tests/sysbuild/Kyuafile 9${TESTS}tests/sysbuild/Kyuafile
9${TESTS}tests/sysbuild/sysbuild_test 10${TESTS}tests/sysbuild/sysbuild_test
10${TESTS}tests/sysbuild/sysbuild4cron_test 11${TESTS}tests/sysbuild/sysbuild4cron_test

cvs diff -r1.5 -r1.6 pkgsrc/sysutils/sysbuild/files/Attic/sysbuild.1 (expand / switch to unified diff)

--- pkgsrc/sysutils/sysbuild/files/Attic/sysbuild.1 2012/08/25 19:20:53 1.5
+++ pkgsrc/sysutils/sysbuild/files/Attic/sysbuild.1 2012/10/13 18:40:33 1.6
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1.\" $NetBSD: sysbuild.1,v 1.5 2012/08/25 19:20:53 jmmv Exp $ 1.\" $NetBSD: sysbuild.1,v 1.6 2012/10/13 18:40:33 jmmv Exp $
2.\" Copyright 2012 Google Inc. 2.\" Copyright 2012 Google Inc.
3.\" All rights reserved. 3.\" All rights reserved.
4.\" 4.\"
5.\" Redistribution and use in source and binary forms, with or without 5.\" Redistribution and use in source and binary forms, with or without
6.\" modification, are permitted provided that the following conditions are 6.\" modification, are permitted provided that the following conditions are
7.\" met: 7.\" met:
8.\" 8.\"
9.\" * Redistributions of source code must retain the above copyright 9.\" * Redistributions of source code must retain the above copyright
10.\" notice, this list of conditions and the following disclaimer. 10.\" notice, this list of conditions and the following disclaimer.
11.\" * Redistributions in binary form must reproduce the above copyright 11.\" * Redistributions in binary form must reproduce the above copyright
12.\" notice, this list of conditions and the following disclaimer in the 12.\" notice, this list of conditions and the following disclaimer in the
13.\" documentation and/or other materials provided with the distribution. 13.\" documentation and/or other materials provided with the distribution.
14.\" * Neither the name of Google Inc. nor the names of its contributors 14.\" * Neither the name of Google Inc. nor the names of its contributors
@@ -16,27 +16,27 @@ @@ -16,27 +16,27 @@
16.\" without specific prior written permission. 16.\" without specific prior written permission.
17.\" 17.\"
18.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19.\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19.\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21.\" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21.\" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22.\" OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22.\" OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24.\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24.\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28.\" OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28.\" OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29.Dd August 25, 2012 29.Dd October 13, 2012
30.Dt SYSBUILD 1 30.Dt SYSBUILD 1
31.Os 31.Os
32.Sh NAME 32.Sh NAME
33.Nm sysbuild 33.Nm sysbuild
34.Nd performs fully automatic builds of NetBSD 34.Nd performs fully automatic builds of NetBSD
35.Sh SYNOPSIS 35.Sh SYNOPSIS
36.Nm 36.Nm
37.Op Fl c Ar config_name 37.Op Fl c Ar config_name
38.Op Fl o Ar variable=value 38.Op Fl o Ar variable=value
39build 39build
40.Op Fl f 40.Op Fl f
41.Op Ar build_targets 41.Op Ar build_targets
42.Nm 42.Nm
@@ -99,54 +99,55 @@ rebuilds by adding a single line to your @@ -99,54 +99,55 @@ rebuilds by adding a single line to your
99.Pp 99.Pp
100As you can see in the 100As you can see in the
101.Sx SYNOPSIS 101.Sx SYNOPSIS
102section, 102section,
103.Nm 103.Nm
104provides a subcommand-interface: the tool has several modes of operation, 104provides a subcommand-interface: the tool has several modes of operation,
105and the particular mode to use for a given run is selected by the first 105and the particular mode to use for a given run is selected by the first
106non-option argument in the command line. 106non-option argument in the command line.
107.Pp 107.Pp
108The following options apply to all commands: 108The following options apply to all commands:
109.Bl -tag -width XXXX 109.Bl -tag -width XXXX
110.It Fl c Ar config_name 110.It Fl c Ar config_name
111Specifies the configuration file to use. 111Specifies the configuration file to use.
 112The format of the file is described in
 113.Xr sysbuild.conf 5 .
112.Pp 114.Pp
113If 115If
114.Ar config_name 116.Ar config_name
115includes any directory separator (aka, one or more slashes) or the 117includes any directory separator (aka, one or more slashes) or the
116.Sq .conf 118.Sq .conf
117suffix, then this specifies the path of the configuration file to load. 119suffix, then this specifies the path of the configuration file to load.
118.Pp 120.Pp
119.If 121.If
120.Ar config_name 122.Ar config_name
121is a plain name without any directory components nor extension, then this 123is a plain name without any directory components nor extension, then this
122specifies the name of the configuration. 124specifies the name of the configuration.
123.Nm 125.Nm
124will first look for a configuration file in 126will first look for a configuration file in
125.Pa ~/.sysbuild/<config_name>.conf 127.Pa ~/.sysbuild/<config_name>.conf
126and, if not found, will use 128and, if not found, will use
127.Pa @SYSBUILD_ETCDIR@/<config_name>.conf . 129.Pa @SYSBUILD_ETCDIR@/<config_name>.conf .
128Any of the two files must exist, or else 130Any of the two files must exist, or else
129.Nm 131.Nm
130will exit with an error. 132will exit with an error.
131.It Fl o Ar variable=value 133.It Fl o Ar variable=value
132Applies an override to the loaded configuration. 134Applies an override to the loaded configuration.
133.Pp 135.Pp
134The 136The
135.Ar variable 137.Ar variable
136part of the argument must be any of the recognized configuration variables 138part of the argument must be any of the recognized configuration variables
137described in 139described in
138.Sx Configuration file 140.Xr sysbuild.conf 5 .
139below. 
140The 141The
141.Ar value , 142.Ar value ,
142if not empty, specifies the value to set the configuration variable to. 143if not empty, specifies the value to set the configuration variable to.
143If 144If
144.Ar value 145.Ar value
145is empty, then the configuration variable is unset. 146is empty, then the configuration variable is unset.
146.El 147.El
147.Ss The build command 148.Ss The build command
148The build command provides the main functionality of 149The build command provides the main functionality of
149.Nm . 150.Nm .
150It performs the following steps: 151It performs the following steps:
151.Bl -enum 152.Bl -enum
152.It 153.It
@@ -272,158 +273,43 @@ Consider that you wish to use the standa @@ -272,158 +273,43 @@ Consider that you wish to use the standa
272and 273and
273.Pa /usr/xsrc 274.Pa /usr/xsrc
274for your source trees, and that you would like to keep these owned by root 275for your source trees, and that you would like to keep these owned by root
275while, at the same time, you run your 276while, at the same time, you run your
276.Nx 277.Nx
277builds as an unprivileged user. 278builds as an unprivileged user.
278In this situation, you can use the 279In this situation, you can use the
279.Sq fetch 280.Sq fetch
280command as root only, set 281command as root only, set
281.Va UPDATE_SOURCES 282.Va UPDATE_SOURCES
282to 283to
283.Sq false 284.Sq false
284in your user configuration files, and do your builds as another user. 285in your user configuration files, and do your builds as another user.
285.Ss Configuration file 
286Configuration files for 
287.Nm 
288are plain shell scripts that define a set of recognized variables. 
289.Pp 
290As scripts, they can perform any magic they desire to deduce the value of 
291the configuration variables. 
292For example, the default configuration file shipped with 
293.Nm 
294automatically deduces the value of the 
295.Va NJOBS 
296variable by looking at how many CPUs are available in the system. 
297.Pp 
298The following variables configure the source trees: 
299.Bl -tag -width INCREMENTAL_BUILD 
300.It Va CVSROOT 
301Location of the CVS root from which to check out or update the src and xsrc 
302modules. 
303.Pp 
304Default: 
305.Sq :ext:anoncvs@anoncvs.NetBSD.org:/cvsroot 
306.It Va CVSTAG 
307CVS tag to use during checkouts or updates of the src and xsrc modules. 
308.Pp 
309Default: not defined. 
310.It Va SRCDIR 
311Path to the src module. 
312If you want 
313.Nm 
314to perform an update of this directory before every build, you will need 
315write access to it. 
316Otherwise, you can use a read-only directory. 
317.Pp 
318Default: 
319.Pa /usr/src . 
320.It Va UPDATE_SOURCES 
321Whether to perform an update of the source tree before every build or not. 
322.Pp 
323Default: 
324.Sq true . 
325.It Va XSRCDIR 
326Path to the xsrc module. 
327If you want 
328.Nm 
329to perform an update of this directory before every build, you will need 
330write access to it. 
331Otherwise, you can use a read-only directory. 
332.Pp 
333Defining this variable causes 
334.Nm 
335to build the X Window System as part of the build of 
336.Nx . 
337.Pp 
338Default: not defined. 
339.El 
340.Pp 
341The following variables configure the location of the build files: 
342.Bl -tag -width INCREMENTAL_BUILD 
343.It Va BUILD_ROOT 
344Path to the directory in which to place build files. 
345These include the obj tree, the destdir and the cross-build tools generated 
346by the 
347.Nm build.sh 
348script. 
349The contents of this directory are sorted by machine type so that it can be 
350shared across builds for different machines. 
351.Pp 
352Default: 
353.Pa ~/sysbuild/ . 
354.It Va RELEASEDIR 
355Path to the directory that will contain the build products (aka the release 
356files). 
357The contents of this directory are sorted by machine type so that it can be 
358shared across builds for different machines. 
359.Pp 
360Default: 
361.Pa ~/sysbuild/release . 
362.El 
363.Pp 
364The following variables configure the build process: 
365.Bl -tag -width INCREMENTAL_BUILD 
366.It Va BUILD_TARGETS 
367Whitespace-separated list of targets to pass to 
368.Nm build.sh 
369during builds. 
370Targets can be prefixed by a machine name and a colon, in which case they only 
371apply to that machine; for example, 
372.Sq macppc:kernel=${HOME}/CUSTOM macppc:releasekernel=${HOME}/CUSTOM . 
373.Pp 
374Default: 
375.Sq release . 
376.It Va INCREMENTAL_BUILD 
377Whether to perform update builds or not. 
378An update build reuses existing obj, destdir and tools trees. 
379.Pp 
380Of special note is that 
381.Nm 
382will take care of pruning files likely to cause breakage during update 
383builds before performing the build itself. 
384As an example, this includes deleting all the modules from 
385.Pa destdir/stand/<platform>/ . 
386.Pp 
387Default: 
388.Sq false . 
389.It Va MACHINES 
390Whitespace-separated list of machine types to build for. 
391.Pp 
392Default: the name of the host machine type. 
393.It Va NJOBS 
394Number of parallel jobs to use during the build. 
395If not set, disables parallel builds (which, due to 
396.Nm make 1 
397semantics, is not the same as setting this to 1). 
398.Pp 
399Default: not defined. 
400.El 
401.Sh FILES 286.Sh FILES
402.Bl -tag -width XXXX 287.Bl -tag -width XXXX
403.It Pa @SYSBUILD_ETCDIR@/ 288.It Pa @SYSBUILD_ETCDIR@/
404Directory containing all system-wide configuration files. 289Directory containing all system-wide configuration files.
405.It Pa @SYSBUILD_ETCDIR@/default.conf 290.It Pa @SYSBUILD_ETCDIR@/default.conf
406Default configuration file to load if the user does not have a 291Default configuration file to load if the user does not have a
407corresponding 292corresponding
408.Pa ~/.sysbuild/default.conf 293.Pa ~/.sysbuild/default.conf
409file and the 294file and the
410.Fl c 295.Fl c
411flag is not provided. 296flag is not provided.
412.It Pa ~/.sysbuild/ 297.It Pa ~/.sysbuild/
413Directory containing all user-specific configuration files. 298Directory containing all user-specific configuration files.
414.It Pa ~/.sysbuild/default.conf 299.It Pa ~/.sysbuild/default.conf
415Default configuration file to load when the 300Default configuration file to load when the
416.Fl c 301.Fl c
417flag is not provided. 302flag is not provided.
418.El 303.El
419.Sh SEE ALSO 304.Sh SEE ALSO
420.Xr cvs 1 , 305.Xr cvs 1 ,
421.Xr sysbuild4cron 1 , 306.Xr sysbuild4cron 1 ,
 307.Xr sysbuild.conf 5 ,
422.Xr hier 7 , 308.Xr hier 7 ,
423.Pa /usr/src/BUILDING 309.Pa /usr/src/BUILDING
424.Sh AUTHORS 310.Sh AUTHORS
425The 311The
426.Nm 312.Nm
427utility was developed by 313utility was developed by
428.An Julio Merino 314.An Julio Merino
429.Aq jmmv@NetBSD.org . 315.Aq jmmv@NetBSD.org .

File Added: pkgsrc/sysutils/sysbuild/files/Attic/sysbuild.conf.5
.\" $NetBSD: sysbuild.conf.5,v 1.1 2012/10/13 18:40:33 jmmv Exp $
.\" Copyright 2012 Google Inc.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions are
.\" met:
.\"
.\" * Redistributions of source code must retain the above copyright
.\"   notice, this list of conditions and the following disclaimer.
.\" * Redistributions in binary form must reproduce the above copyright
.\"   notice, this list of conditions and the following disclaimer in the
.\"   documentation and/or other materials provided with the distribution.
.\" * Neither the name of Google Inc. nor the names of its contributors
.\"   may be used to endorse or promote products derived from this software
.\"   without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
.\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
.\" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
.\" OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
.\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
.\" OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.Dd October 13, 2012
.Dt SYSBUILD.CONF 5
.Os
.Sh NAME
.Nm sysbuild.conf
.Nd configuration file format for the sysbuild tool
.Sh DESCRIPTION
Configuration files for
.Xr sysbuild 1
are plain shell scripts that define a set of recognized variables.
.Pp
As scripts, they can perform any magic they desire to deduce the value of
the configuration variables.
For example, the default configuration file shipped with
.Xr sysbuild 1
automatically deduces the value of the
.Va NJOBS
variable by looking at how many CPUs are available in the system.
.Pp
The following variables configure the source trees:
.Bl -tag -width INCREMENTAL_BUILD
.It Va CVSROOT
Location of the CVS root from which to check out or update the src and xsrc
modules.
.Pp
Default:
.Sq :ext:anoncvs@anoncvs.NetBSD.org:/cvsroot
.It Va CVSTAG
CVS tag to use during checkouts or updates of the src and xsrc modules.
.Pp
Default: not defined.
.It Va SRCDIR
Path to the src module.
If you want
.Xr sysbuild 1
to perform an update of this directory before every build, you will need
write access to it.
Otherwise, you can use a read-only directory.
.Pp
Default:
.Pa /usr/src .
.It Va UPDATE_SOURCES
Whether to perform an update of the source tree before every build or not.
.Pp
Default:
.Sq true .
.It Va XSRCDIR
Path to the xsrc module.
If you want
.Xr sysbuild 1
to perform an update of this directory before every build, you will need
write access to it.
Otherwise, you can use a read-only directory.
.Pp
Defining this variable causes
.Xr sysbuild 1
to build the X Window System as part of the build of
.Nx .
.Pp
Default: not defined.
.El
.Pp
The following variables configure the location of the build files:
.Bl -tag -width INCREMENTAL_BUILD
.It Va BUILD_ROOT
Path to the directory in which to place build files.
These include the obj tree, the destdir and the cross-build tools generated
by the
.Nm build.sh
script.
The contents of this directory are sorted by machine type so that it can be
shared across builds for different machines.
.Pp
Default:
.Pa ~/sysbuild/ .
.It Va RELEASEDIR
Path to the directory that will contain the build products (aka the release
files).
The contents of this directory are sorted by machine type so that it can be
shared across builds for different machines.
.Pp
Default:
.Pa ~/sysbuild/release .
.El
.Pp
The following variables configure the build process:
.Bl -tag -width INCREMENTAL_BUILD
.It Va BUILD_TARGETS
Whitespace-separated list of targets to pass to
.Nm build.sh
during builds.
Targets can be prefixed by a machine name and a colon, in which case they only
apply to that machine; for example,
.Sq macppc:kernel=${HOME}/CUSTOM macppc:releasekernel=${HOME}/CUSTOM .
.Pp
Default:
.Sq release .
.It Va INCREMENTAL_BUILD
Whether to perform update builds or not.
An update build reuses existing obj, destdir and tools trees.
.Pp
Of special note is that
.Xr sysbuild 1
will take care of pruning files likely to cause breakage during update
builds before performing the build itself.
As an example, this includes deleting all the modules from
.Pa destdir/stand/<platform>/ .
.Pp
Default:
.Sq false .
.It Va MACHINES
Whitespace-separated list of machine types to build for.
.Pp
Default: the name of the host machine type.
.It Va MKVARS
Whitespace-separated list of
.Sq VARIABLE=value
.Xr make 1
variable definitions to be set during the build.
A useful example would be:
.Sq MKVARS="MKDEBUG=yes" .
.Pp
Default: not defined.
.It Va NJOBS
Number of parallel jobs to use during the build.
If not set, disables parallel builds (which, due to
.Nm make 1
semantics, is not the same as setting this to 1).
.Pp
Default: not defined.
.El
.Sh SEE ALSO
.Xr sysbuild 1

cvs diff -r1.15 -r1.16 pkgsrc/sysutils/sysbuild/files/Attic/sysbuild.sh (expand / switch to unified diff)

--- pkgsrc/sysutils/sysbuild/files/Attic/sysbuild.sh 2012/08/25 19:20:53 1.15
+++ pkgsrc/sysutils/sysbuild/files/Attic/sysbuild.sh 2012/10/13 18:40:33 1.16
@@ -30,27 +30,28 @@ @@ -30,27 +30,28 @@
30# Entry point and main program logic. 30# Entry point and main program logic.
31 31
32shtk_import cli 32shtk_import cli
33shtk_import config 33shtk_import config
34shtk_import cvs 34shtk_import cvs
35shtk_import list 35shtk_import list
36shtk_import process 36shtk_import process
37 37
38 38
39# List of valid configuration variables. 39# List of valid configuration variables.
40# 40#
41# Please remember to update sysbuild(1) if you change this list. 41# Please remember to update sysbuild(1) if you change this list.
42SYSBUILD_CONFIG_VARS="BUILD_ROOT BUILD_TARGETS CVSROOT CVSTAG INCREMENTAL_BUILD 42SYSBUILD_CONFIG_VARS="BUILD_ROOT BUILD_TARGETS CVSROOT CVSTAG INCREMENTAL_BUILD
43 MACHINES NJOBS RELEASEDIR SRCDIR UPDATE_SOURCES XSRCDIR" 43 MACHINES MKVARS NJOBS RELEASEDIR SRCDIR UPDATE_SOURCES
 44 XSRCDIR"
44 45
45 46
46# Paths to installed files. 47# Paths to installed files.
47# 48#
48# Can be overriden for test purposes only. 49# Can be overriden for test purposes only.
49: ${SYSBUILD_ETCDIR="@SYSBUILD_ETCDIR@"} 50: ${SYSBUILD_ETCDIR="@SYSBUILD_ETCDIR@"}
50: ${SYSBUILD_SHAREDIR="@SYSBUILD_SHAREDIR@"} 51: ${SYSBUILD_SHAREDIR="@SYSBUILD_SHAREDIR@"}
51 52
52 53
53# Sets defaults for configuration variables that need a value. 54# Sets defaults for configuration variables that need a value.
54# 55#
55# This function should be before the configuration file has been loaded. This 56# This function should be before the configuration file has been loaded. This
56# means that the user can undefine a required configuration variable, but we let 57# means that the user can undefine a required configuration variable, but we let
@@ -85,26 +86,31 @@ do_one_build() { @@ -85,26 +86,31 @@ do_one_build() {
85 if shtk_config_get_bool INCREMENTAL_BUILD; then 86 if shtk_config_get_bool INCREMENTAL_BUILD; then
86 uflag=-u 87 uflag=-u
87 88
88 # Get rid of any possibly-old modules; they are a constant source of 89 # Get rid of any possibly-old modules; they are a constant source of
89 # update-build problems. 90 # update-build problems.
90 rm -rf "${basedir}/destdir/stand"/* 91 rm -rf "${basedir}/destdir/stand"/*
91 else 92 else
92 shtk_cli_info "Cleaning up previous build files" 93 shtk_cli_info "Cleaning up previous build files"
93 rm -rf "${basedir}/destdir" 94 rm -rf "${basedir}/destdir"
94 rm -rf "${basedir}/obj" 95 rm -rf "${basedir}/obj"
95 rm -rf "${basedir}/tools" 96 rm -rf "${basedir}/tools"
96 fi 97 fi
97 98
 99 local Vflags=
 100 for Vflag in $(shtk_config_get_default MKVARS ""); do
 101 Vflags="${Vflags} -V${Vflag}"
 102 done
 103
98 local xflag= 104 local xflag=
99 local Xflag= 105 local Xflag=
100 if shtk_config_has XSRCDIR; then 106 if shtk_config_has XSRCDIR; then
101 xflag=-x 107 xflag=-x
102 Xflag="-X$(shtk_config_get XSRCDIR)" 108 Xflag="-X$(shtk_config_get XSRCDIR)"
103 fi 109 fi
104 110
105 local targets= 111 local targets=
106 for target in $(shtk_config_get BUILD_TARGETS); do 112 for target in $(shtk_config_get BUILD_TARGETS); do
107 case "${target}" in 113 case "${target}" in
108 *:*) 114 *:*)
109 local submachine="$(echo "${target}" | cut -d : -f 1)" 115 local submachine="$(echo "${target}" | cut -d : -f 1)"
110 local subtarget="$(echo "${target}" | cut -d : -f 2-)" 116 local subtarget="$(echo "${target}" | cut -d : -f 2-)"
@@ -120,26 +126,27 @@ do_one_build() { @@ -120,26 +126,27 @@ do_one_build() {
120 *) 126 *)
121 targets="${targets} ${target}" 127 targets="${targets} ${target}"
122 ;; 128 ;;
123 esac 129 esac
124 done 130 done
125 131
126 ( cd "$(shtk_config_get SRCDIR)" && shtk_process_run ./build.sh \ 132 ( cd "$(shtk_config_get SRCDIR)" && shtk_process_run ./build.sh \
127 -D"${basedir}/destdir" \ 133 -D"${basedir}/destdir" \
128 -M"${basedir}/obj" \ 134 -M"${basedir}/obj" \
129 -N2 \ 135 -N2 \
130 -R"$(shtk_config_get RELEASEDIR)" \ 136 -R"$(shtk_config_get RELEASEDIR)" \
131 -T"${basedir}/tools" \ 137 -T"${basedir}/tools" \
132 -U \ 138 -U \
 139 ${Vflags} \
133 ${Xflag} \ 140 ${Xflag} \
134 ${jflag} \ 141 ${jflag} \
135 -m"${machine}" \ 142 -m"${machine}" \
136 ${uflag} \ 143 ${uflag} \
137 ${xflag} \ 144 ${xflag} \
138 ${targets} ) 145 ${targets} )
139} 146}
140 147
141 148
142# Builds the system. 149# Builds the system.
143# 150#
144# \params ... The options and arguments to the command. 151# \params ... The options and arguments to the command.
145sysbuild_build() { 152sysbuild_build() {
@@ -260,27 +267,27 @@ EOF @@ -260,27 +267,27 @@ EOF
260# \params ... The options and arguments to the command. 267# \params ... The options and arguments to the command.
261sysbuild_fetch() { 268sysbuild_fetch() {
262 [ ${#} -eq 0 ] || shtk_cli_usage_error "fetch does not take any arguments" 269 [ ${#} -eq 0 ] || shtk_cli_usage_error "fetch does not take any arguments"
263 270
264 local cvsroot="$(shtk_config_get CVSROOT)" 271 local cvsroot="$(shtk_config_get CVSROOT)"
265 272
266 shtk_cli_info "Updating base source tree" 273 shtk_cli_info "Updating base source tree"
267 shtk_cvs_fetch "${cvsroot}" src "$(shtk_config_get_default CVSTAG '')" \ 274 shtk_cvs_fetch "${cvsroot}" src "$(shtk_config_get_default CVSTAG '')" \
268 "$(shtk_config_get SRCDIR)" 275 "$(shtk_config_get SRCDIR)"
269 276
270 if shtk_config_has XSRCDIR; then 277 if shtk_config_has XSRCDIR; then
271 shtk_cli_info "Updating X11 source tree" 278 shtk_cli_info "Updating X11 source tree"
272 shtk_cvs_fetch "${cvsroot}" xsrc \ 279 shtk_cvs_fetch "${cvsroot}" xsrc \
273 "$(shtk_config_get_default CVSTAG '')" "$(shtk_config_get XSRCDIR)" 280 "$(shtk_config_get_default CVSTAG '')" "$(shtk_config_get XSRCDIR)"
274 fi 281 fi
275} 282}
276 283
277 284
278# Loads the configuration file specified in the command line. 285# Loads the configuration file specified in the command line.
279# 286#
280# \param config_name Name of the desired configuration. It can be either a 287# \param config_name Name of the desired configuration. It can be either a
281# configuration name (no slashes) or a path. 288# configuration name (no slashes) or a path.
282sysbuild_config_load() { 289sysbuild_config_load() {
283 local config_name="${1}"; shift 290 local config_name="${1}"; shift
284 291
285 local config_file= 292 local config_file=
286 case "${config_name}" in 293 case "${config_name}" in

cvs diff -r1.4 -r1.5 pkgsrc/sysutils/sysbuild/files/Attic/sysbuild_test.sh (expand / switch to unified diff)

--- pkgsrc/sysutils/sysbuild/files/Attic/sysbuild_test.sh 2012/08/25 19:20:53 1.4
+++ pkgsrc/sysutils/sysbuild/files/Attic/sysbuild_test.sh 2012/10/13 18:40:33 1.5
@@ -386,26 +386,55 @@ build__machine_targets__unmatched_body() @@ -386,26 +386,55 @@ build__machine_targets__unmatched_body()
386 386
387 cat >experr <<EOF 387 cat >experr <<EOF
388sysbuild: E: The 'macpp:kernel=/foo/bar a:b' targets do not match any machine in 'amd64 macppc shark' 388sysbuild: E: The 'macpp:kernel=/foo/bar a:b' targets do not match any machine in 'amd64 macppc shark'
389EOF 389EOF
390 atf_check -s exit:1 -o empty -e file:experr sysbuild \ 390 atf_check -s exit:1 -o empty -e file:experr sysbuild \
391 -c /dev/null -o CVSROOT="${MOCK_CVSROOT}" \ 391 -c /dev/null -o CVSROOT="${MOCK_CVSROOT}" \
392 -o MACHINES="amd64 macppc shark" -o NJOBS=2 build \ 392 -o MACHINES="amd64 macppc shark" -o NJOBS=2 build \
393 tools macpp:kernel=/foo/bar a:b release 393 tools macpp:kernel=/foo/bar a:b release
394 394
395 test ! -f commands.log || atf_fail "cvs should not have been executed" 395 test ! -f commands.log || atf_fail "cvs should not have been executed"
396} 396}
397 397
398 398
 399atf_test_case build__mkvars
 400build__mkvars_body() {
 401 mkdir -p sysbuild/src
 402 create_mock_binary sysbuild/src/build.sh
 403
 404 atf_check -o save:stdout -e save:stderr sysbuild \
 405 -c /dev/null -o CVSROOT="${MOCK_CVSROOT}" \
 406 -o MKVARS="MKDEBUG=yes FOO=bar" build -f
 407
 408 cat >expout <<EOF
 409Command: build.sh
 410Directory: ${HOME}/sysbuild/src
 411Arg: -D${HOME}/sysbuild/$(uname -m)/destdir
 412Arg: -M${HOME}/sysbuild/$(uname -m)/obj
 413Arg: -N2
 414Arg: -R${HOME}/sysbuild/release
 415Arg: -T${HOME}/sysbuild/$(uname -m)/tools
 416Arg: -U
 417Arg: -VMKDEBUG=yes
 418Arg: -VFOO=bar
 419Arg: -m$(uname -m)
 420Arg: -u
 421Arg: release
 422
 423EOF
 424 atf_check -o file:expout cat commands.log
 425}
 426
 427
399atf_test_case build__with_x11 428atf_test_case build__with_x11
400build__with_x11_body() { 429build__with_x11_body() {
401 create_mock_cvsroot "${MOCK_CVSROOT}" 430 create_mock_cvsroot "${MOCK_CVSROOT}"
402 431
403 create_mock_binary cvs yes 432 create_mock_binary cvs yes
404 PATH="$(pwd):${PATH}" 433 PATH="$(pwd):${PATH}"
405 434
406 atf_check -o save:stdout -e save:stderr sysbuild \ 435 atf_check -o save:stdout -e save:stderr sysbuild \
407 -c /dev/null -o CVSROOT="${MOCK_CVSROOT}" \ 436 -c /dev/null -o CVSROOT="${MOCK_CVSROOT}" \
408 -o XSRCDIR="${HOME}/sysbuild/xsrc" build 437 -o XSRCDIR="${HOME}/sysbuild/xsrc" build
409 438
410 cat >expout <<EOF 439 cat >expout <<EOF
411Command: cvs 440Command: cvs
@@ -478,26 +507,27 @@ EOF @@ -478,26 +507,27 @@ EOF
478 atf_check -o file:expout cat commands.log 507 atf_check -o file:expout cat commands.log
479} 508}
480 509
481 510
482atf_test_case config__builtins 511atf_test_case config__builtins
483config__builtins_body() { 512config__builtins_body() {
484 cat >expout <<EOF 513 cat >expout <<EOF
485BUILD_ROOT = ${HOME}/sysbuild 514BUILD_ROOT = ${HOME}/sysbuild
486BUILD_TARGETS = release 515BUILD_TARGETS = release
487CVSROOT = :ext:anoncvs@anoncvs.NetBSD.org:/cvsroot 516CVSROOT = :ext:anoncvs@anoncvs.NetBSD.org:/cvsroot
488CVSTAG is undefined 517CVSTAG is undefined
489INCREMENTAL_BUILD = false 518INCREMENTAL_BUILD = false
490MACHINES = $(uname -m) 519MACHINES = $(uname -m)
 520MKVARS is undefined
491NJOBS is undefined 521NJOBS is undefined
492RELEASEDIR = ${HOME}/sysbuild/release 522RELEASEDIR = ${HOME}/sysbuild/release
493SRCDIR = ${HOME}/sysbuild/src 523SRCDIR = ${HOME}/sysbuild/src
494UPDATE_SOURCES = true 524UPDATE_SOURCES = true
495XSRCDIR is undefined 525XSRCDIR is undefined
496EOF 526EOF
497 atf_check -o file:expout sysbuild -c /dev/null config 527 atf_check -o file:expout sysbuild -c /dev/null config
498} 528}
499 529
500 530
501atf_test_case config__path__components 531atf_test_case config__path__components
502config__path__components_body() { 532config__path__components_body() {
503 mkdir .sysbuild 533 mkdir .sysbuild
@@ -561,26 +591,27 @@ atf_test_case config__overrides @@ -561,26 +591,27 @@ atf_test_case config__overrides
561config__overrides_body() { 591config__overrides_body() {
562 cat >custom.conf <<EOF 592 cat >custom.conf <<EOF
563BUILD_ROOT=/tmp/test 593BUILD_ROOT=/tmp/test
564CVSTAG=the-tag-override 594CVSTAG=the-tag-override
565EOF 595EOF
566 596
567 cat >expout <<EOF 597 cat >expout <<EOF
568BUILD_ROOT = /tmp/test 598BUILD_ROOT = /tmp/test
569BUILD_TARGETS = release 599BUILD_TARGETS = release
570CVSROOT = foo bar 600CVSROOT = foo bar
571CVSTAG = the-new-tag 601CVSTAG = the-new-tag
572INCREMENTAL_BUILD = false 602INCREMENTAL_BUILD = false
573MACHINES = $(uname -m) 603MACHINES = $(uname -m)
 604MKVARS is undefined
574NJOBS is undefined 605NJOBS is undefined
575RELEASEDIR = ${HOME}/sysbuild/release 606RELEASEDIR = ${HOME}/sysbuild/release
576SRCDIR is undefined 607SRCDIR is undefined
577UPDATE_SOURCES = true 608UPDATE_SOURCES = true
578XSRCDIR is undefined 609XSRCDIR is undefined
579EOF 610EOF
580 atf_check -o file:expout sysbuild -c custom.conf -o CVSROOT="foo bar" \ 611 atf_check -o file:expout sysbuild -c custom.conf -o CVSROOT="foo bar" \
581 -o CVSTAG=the-new-tag -o SRCDIR= config 612 -o CVSTAG=the-new-tag -o SRCDIR= config
582} 613}
583 614
584 615
585atf_test_case config__too_many_args 616atf_test_case config__too_many_args
586config__too_many_args_body() { 617config__too_many_args_body() {
@@ -860,26 +891,27 @@ Type 'man sysbuild' for help @@ -860,26 +891,27 @@ Type 'man sysbuild' for help
860EOF 891EOF
861 atf_check -s exit:1 -e file:experr sysbuild -Z 892 atf_check -s exit:1 -e file:experr sysbuild -Z
862} 893}
863 894
864 895
865atf_init_test_cases() { 896atf_init_test_cases() {
866 atf_add_test_case build__custom_dirs 897 atf_add_test_case build__custom_dirs
867 atf_add_test_case build__defaults 898 atf_add_test_case build__defaults
868 atf_add_test_case build__remove_all 899 atf_add_test_case build__remove_all
869 atf_add_test_case build__fast_mode 900 atf_add_test_case build__fast_mode
870 atf_add_test_case build__many_machines 901 atf_add_test_case build__many_machines
871 atf_add_test_case build__machine_targets__ok 902 atf_add_test_case build__machine_targets__ok
872 atf_add_test_case build__machine_targets__unmatched 903 atf_add_test_case build__machine_targets__unmatched
 904 atf_add_test_case build__mkvars
873 atf_add_test_case build__with_x11 905 atf_add_test_case build__with_x11
874 atf_add_test_case build__some_args 906 atf_add_test_case build__some_args
875 907
876 atf_add_test_case config__builtins 908 atf_add_test_case config__builtins
877 atf_add_test_case config__path__components 909 atf_add_test_case config__path__components
878 atf_add_test_case config__path__extension 910 atf_add_test_case config__path__extension
879 atf_add_test_case config__name__system_directory 911 atf_add_test_case config__name__system_directory
880 atf_add_test_case config__name__user_directory 912 atf_add_test_case config__name__user_directory
881 atf_add_test_case config__name__not_found 913 atf_add_test_case config__name__not_found
882 atf_add_test_case config__overrides 914 atf_add_test_case config__overrides
883 atf_add_test_case config__too_many_args 915 atf_add_test_case config__too_many_args
884 916
885 atf_add_test_case env__src_only 917 atf_add_test_case env__src_only