diff options
author | jmmv <jmmv@pkgsrc.org> | 2002-12-18 11:28:08 +0000 |
---|---|---|
committer | jmmv <jmmv@pkgsrc.org> | 2002-12-18 11:28:08 +0000 |
commit | 5e13ca12576e4c65ca48550762b474ef436b3732 (patch) | |
tree | 5aa4af29b3eb5aa1edaddd38f9462a380ec037b7 /sysutils/sysbuild | |
parent | 2982681d367e236b49073e025d8a77c58a0227e5 (diff) | |
download | pkgsrc-5e13ca12576e4c65ca48550762b474ef436b3732.tar.gz |
Update sysbuild to 1.5. Changes in this version:
- Added build-x-release target to build a full X11R6 binary snapshot. The
process works as an unprivileged user, keeping sources clean (using
mount_union(8)).
- Added install-x-sets target to install the sets built by build-x-release.
Diffstat (limited to 'sysutils/sysbuild')
-rw-r--r-- | sysutils/sysbuild/Makefile | 4 | ||||
-rw-r--r-- | sysutils/sysbuild/files/default.conf | 12 | ||||
-rw-r--r-- | sysutils/sysbuild/files/sysbuild.8 | 56 | ||||
-rw-r--r-- | sysutils/sysbuild/files/sysbuild.sh | 109 |
4 files changed, 175 insertions, 6 deletions
diff --git a/sysutils/sysbuild/Makefile b/sysutils/sysbuild/Makefile index 80975b64e99..c01e017e2bd 100644 --- a/sysutils/sysbuild/Makefile +++ b/sysutils/sysbuild/Makefile @@ -1,7 +1,7 @@ -# $NetBSD: Makefile,v 1.5 2002/12/14 23:23:08 jmmv Exp $ +# $NetBSD: Makefile,v 1.6 2002/12/18 11:28:08 jmmv Exp $ # -DISTNAME= sysbuild-1.4 +DISTNAME= sysbuild-1.5 CATEGORIES= sysutils MASTER_SITES= # empty DISTFILES= # empty diff --git a/sysutils/sysbuild/files/default.conf b/sysutils/sysbuild/files/default.conf index 3692df4b73b..7a54c1e8110 100644 --- a/sysutils/sysbuild/files/default.conf +++ b/sysutils/sysbuild/files/default.conf @@ -1,4 +1,4 @@ -# $NetBSD: default.conf,v 1.2 2002/12/08 11:37:18 jmmv Exp $ +# $NetBSD: default.conf,v 1.3 2002/12/18 11:28:09 jmmv Exp $ # # sysbuild - System wide configuration file # @@ -20,6 +20,13 @@ RELEASEDIR=/var/sysbuild/NetBSD-1.6/i386 # Source directory. SRCDIR=/usr/src +# X11R6 Source directory. +XSRCDIR=/usr/xsrc + +# When mounting union filesystems (to build X11R6), prefix umount(8) +# and mount_union(8) calls with the following command. +#MOUNT_PRECMD="sudo" + # List of directories that are updated via cvs. CVSDIRS="/usr/src /usr/pkgsrc /usr/xsrc" @@ -50,3 +57,6 @@ MAIL_CMDLOG=no # etc.tgz is not specified, as it is specially installed through the # etcupdate target. SETS="base.tgz comp.tgz games.tgz man.tgz misc.tgz text.tgz" + +# When using the install-x-sets target, unpack these sets. +XSETS="xbase.tgz xcomp.tgz xcontrib.tgz xfont.tgz xmisc.tgz xserver.tgz" diff --git a/sysutils/sysbuild/files/sysbuild.8 b/sysutils/sysbuild/files/sysbuild.8 index 33661a20711..b008f2e8147 100644 --- a/sysutils/sysbuild/files/sysbuild.8 +++ b/sysutils/sysbuild/files/sysbuild.8 @@ -1,4 +1,4 @@ -.\" $NetBSD: sysbuild.8,v 1.4 2002/12/08 11:37:18 jmmv Exp $ +.\" $NetBSD: sysbuild.8,v 1.5 2002/12/18 11:28:09 jmmv Exp $ .\" .\" sysbuild - Automatic NetBSD system builds .\" Copyright (c) 2002, Julio Merino <jmmv@netbsd.org> @@ -27,7 +27,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd November 16, 2002 +.Dd December 18, 2002 .Dt SYSBUILD 8 .Os .Sh NAME @@ -127,6 +127,32 @@ Depends on This target requires .Ql @SYSBUILD_USER@ privileges. +.It build-x-release +Build a full release of the X11R6 window system. +.Pp +Release files are placed inside the directory pointed by +.Va RELEASEDIR . +During the build, +.Va BSDOBJDIR +is set to +.Pa $BUILDDIR/obj +and +.Va DESTDIR +is set to +.Pa $BUILDDIR/root . +The source tree, +.Va XSRCDIR , +is mounted below +.Pa $BUILDDIR/root +using +.Xr mount_union 8 . +.Pp +Depends on +.Ql clean . +.Pp +This target requires +.Ql @SYSBUILD_USER@ +privileges. .It build-sets Build compressed system sets only. If you want the sets to install them later on your own system, this is @@ -255,6 +281,16 @@ variable are installed. This target requires .Ql root privileges. +.It install-x-sets +Install built X11R6 sets, placed inside +.Pa $RELEASEDIR/binary/sets . +Only sets specified in the +.Va XSETS +variable are installed. +.Pp +This target requires +.Ql root +privileges. .It update-srcs Op Ar dir ... Use .Xr cvs 1 @@ -331,6 +367,17 @@ The first one is the kernel that will be installed when running Directory which holds kernel configuration files. Defaults to .Pa @SYSBUILD_HOMEDIR@ . +.It MOUNT_PRECMD +Specifies a command to be called to gain privileges when running +.Xr mount_union 8 +and +.Xr umount 8 . +This is not needed if you have +.Va vfs.generic.usermount +set to +.Ql 1 +in +.Xr sysctl 8 . .It RELEASEDIR Base directory which will hold release files. .It MAILTO @@ -360,6 +407,9 @@ Path to .Nx source directory tree, usually .Pa /usr/src . +.It XSRCDIR +Path to X11R6 source tree, usually +.Pa /usr/xsrc . .El .Sh SEE ALSO .Xr crontab 1 , @@ -367,6 +417,8 @@ source directory tree, usually .Xr mk.conf 5 , .Xr cron 8 , .Xr etcupdate 8 , +.Xr mount_union 8 , +.Xr umount 8 , .Pa /usr/src/BUILDING .Sh CRON JOBS .Xr cron 8 diff --git a/sysutils/sysbuild/files/sysbuild.sh b/sysutils/sysbuild/files/sysbuild.sh index 2dd7d73e94d..3afc8ca135e 100644 --- a/sysutils/sysbuild/files/sysbuild.sh +++ b/sysutils/sysbuild/files/sysbuild.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# $NetBSD: sysbuild.sh,v 1.5 2002/12/14 23:23:08 jmmv Exp $ +# $NetBSD: sysbuild.sh,v 1.6 2002/12/18 11:28:09 jmmv Exp $ # # sysbuild - Automatic NetBSD system builds # Copyright (c) 2002, Julio Merino <jmmv@netbsd.org> @@ -51,6 +51,7 @@ usage() { echo " build-kernels Build kernels" echo " build-release Build a complete release" echo " build-sets Build system sets only" + echo " build-x-release Build a complete X11R6 release" echo " clean Clean work directories" echo " clean-srcs Fix ownerships in source directories" echo " config Create or edit a configuration file" @@ -60,6 +61,7 @@ usage() { echo " init Initialize work directories" echo " install-kernel Install a built kernel" echo " install-sets Install system sets" + echo " install-x-sets Install X11R6 sets" echo " update-srcs Use CVS to update source directories" } @@ -320,6 +322,25 @@ sysbuild_install_sets() { echo "You MUST now run \`sysbuild etcupdate' by hand to update /etc." } +sysbuild_install_x_sets() { + check_root + check_init + + for _s in $XSETS; do + printf "Installing $_s:" + if [ ! -f $RELEASEDIR/binary/sets/$_s ]; then + echo " not built yet" + else + cd / && tar xzpf $RELEASEDIR/binary/sets/$_s > /dev/null 2>&1 + if [ $? -ne 0 ]; then + echo " failed." + else + echo " done." + fi + fi + done +} + sysbuild_build_tools() { check_noroot check_init @@ -353,6 +374,73 @@ sysbuild_build_tools() { fi } +sysbuild_build_x_release() { + check_noroot + check_init + + _log=`mktemp /tmp/sysbuild.XXXX` + + sysbuild_clean + sysbuild_build_tools + if [ "$MAIL_CMDLOG" = "yes" ]; then + echo "Logging to $_log (will be removed later)" + else + echo "Logging to $_log (will NOT be removed later)" + fi + + printf "Mounting $XSRCDIR below $BUILDDIR/obj:" + _mnt="ok" + if [ ! -d $XSRCDIR ]; then + echo " failed." + _mnt="fail" + else + if [ -z "${MOUNT_PRECMD}" ]; then + mount -t union -o -b $XSRCDIR $BUILDDIR/obj >> $_log 2>&1 + else + ${MOUNT_PRECMD} "mount -t union -o -b $XSRCDIR $BUILDDIR/obj" >> $_log 2>&1 + fi + if [ $? -ne 0 ]; then + echo " failed." + _mnt="fail" + else + echo " done." + fi + fi + + if [ "$_mnt" = "ok" ]; then + printf "Building full X11R6 release:" + mkdir -p $RELEASEDIR + ( cd $BUILDDIR/obj && \ + BSDSRCDIR=$SRCDIR NETBSDSRCDIR=$SRCDIR $BUILDDIR/tools/bin/nbmake-`uname -m` DESTDIR=$BUILDDIR/root release >> $_log 2>&1 ) + if [ $? -ne 0 ]; then + echo " failed." + else + echo " done." + fi + + chmod 644 $RELEASEDIR/binary/sets/x*.tgz + chown $USER:$OBJGROUP $RELEASEDIR/binary/sets/* + fi + + printf "Unmounting $BUILDDIR/obj:" + if [ -z "${MOUNT_PRECMD}" ]; then + umount $BUILDDIR/obj >> $_log 2>&1 + else + ${MOUNT_PRECMD} "umount $BUILDDIR/obj" >> $_log 2>&1 + fi + if [ $? -ne 0 ]; then + echo " failed." + else + echo " done." + fi + + if [ "$MAIL_CMDLOG" = "yes" ]; then + echo "Command log follows:" + cat $_log + rm -f $_log + fi +} + # -------------------------------------------------------------------- # Cleanup functions # -------------------------------------------------------------------- @@ -361,6 +449,11 @@ sysbuild_clean() { check_noroot check_init + if [ -n "`mount | grep $BUILDDIR/obj`" ]; then + echo "$BUILDDIR/obj still mounted; cannot clean." + exit 1 + fi + printf "Cleaning $BUILDDIR/obj contents:" rm -rf $BUILDDIR/obj/* echo " done." @@ -607,6 +700,13 @@ case $target in sysbuild_build_sets fi ;; + build-x-release) + if [ "$maillog" = "yes" ]; then + sysbuild_build_x_release >> $maillogfile + else + sysbuild_build_x_release + fi + ;; clean) if [ "$maillog" = "yes" ]; then sysbuild_clean >> $maillogfile @@ -650,6 +750,13 @@ case $target in sysbuild_install_sets fi ;; + install-x-sets) + if [ "$maillog" = "yes" ]; then + sysbuild_install_x_sets >> $maillogfile + else + sysbuild_install_x_sets + fi + ;; update-srcs) if [ "$maillog" = "yes" ]; then sysbuild_update_srcs $* >> $maillogfile 2>&1 |