summaryrefslogtreecommitdiff
path: root/sysutils/sysbuild
diff options
context:
space:
mode:
authorkristerw <kristerw@pkgsrc.org>2004-06-01 21:51:46 +0000
committerkristerw <kristerw@pkgsrc.org>2004-06-01 21:51:46 +0000
commit404fd457e6706f9c39459ab53f9decedbd358eea (patch)
tree82940600acf5214ee5bee30e48de180680286721 /sysutils/sysbuild
parent1b0ace13d4d14b71bf9e735e328c952f7f7cc079 (diff)
downloadpkgsrc-404fd457e6706f9c39459ab53f9decedbd358eea.tar.gz
Remove obsolete package, per discussion on tech-pkg.
Diffstat (limited to 'sysutils/sysbuild')
-rw-r--r--sysutils/sysbuild/DESCR10
-rw-r--r--sysutils/sysbuild/INSTALL27
-rw-r--r--sysutils/sysbuild/MESSAGE15
-rw-r--r--sysutils/sysbuild/Makefile69
-rw-r--r--sysutils/sysbuild/PLIST7
-rw-r--r--sysutils/sysbuild/files/crontab19
-rw-r--r--sysutils/sysbuild/files/default.conf66
-rw-r--r--sysutils/sysbuild/files/profile17
-rw-r--r--sysutils/sysbuild/files/sysbuild.8538
-rw-r--r--sysutils/sysbuild/files/sysbuild.sh781
10 files changed, 0 insertions, 1549 deletions
diff --git a/sysutils/sysbuild/DESCR b/sysutils/sysbuild/DESCR
deleted file mode 100644
index 1bc2a3abb16..00000000000
--- a/sysutils/sysbuild/DESCR
+++ /dev/null
@@ -1,10 +0,0 @@
-sysbuild is a script that simplifies the process of building NetBSD
-releases and kernels as an unprivileged user. It should be clear enough
-that it does not add any kind of magic to the NetBSD build system. It
-just automates boring steps, like setup of permissions, directories,
-execution of the build process, etc. It also provides enough
-functionality to automatically update CVS source trees.
-
-sysbuild can be easily used from command line or as a cron job, so
-you can schedule most of the build jobs (really, it has been designed
-to run perfectly from cron).
diff --git a/sysutils/sysbuild/INSTALL b/sysutils/sysbuild/INSTALL
deleted file mode 100644
index 801a33051e1..00000000000
--- a/sysutils/sysbuild/INSTALL
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/sh
-#
-# $NetBSD: INSTALL,v 1.2 2002/12/01 19:39:49 jmmv Exp $
-
-SYSBUILD_USER=@SYSBUILD_USER@
-SYSBUILD_HOMEDIR=@SYSBUILD_HOMEDIR@
-EGDIR=@EGDIR@
-
-case ${STAGE} in
-POST-INSTALL)
- echo "Setting up sysbuild's crontab..."
- crontab -u ${SYSBUILD_USER} -r > /dev/null 2>&1
- crontab -u ${SYSBUILD_USER} ${EGDIR}/crontab > /dev/null 2>&1
- ;;
-
-DEINSTALL)
- echo "Removing sysbuild's crontab..."
- crontab -u ${SYSBUILD_USER} -r > /dev/null 2>&1
- ${CAT} << EOF
-===========================================================================
-If you will not be using sysbuild any longer, you may want to remove
-sysbuild's home directory and all work areas. Just to let you know, work
-areas can be removed using the 'destroy' target of the program.
-===========================================================================
-EOF
- ;;
-esac
diff --git a/sysutils/sysbuild/MESSAGE b/sysutils/sysbuild/MESSAGE
deleted file mode 100644
index 5d4e4a3fa50..00000000000
--- a/sysutils/sysbuild/MESSAGE
+++ /dev/null
@@ -1,15 +0,0 @@
-===========================================================================
-$NetBSD: MESSAGE,v 1.1.1.1 2002/11/28 19:57:28 jmmv Exp $
-
-sysbuild has been installed successfully. These lines are a must to get
-started:
-
- ${PREFIX}/bin/sysbuild config
- ${PREFIX}/bin/sysbuild init
-
-A sample crontab file for the '${SYSBUILD_USER}' user has been installed.
-Use the following command (as root) to edit it interactively:
-
- crontab -e -u ${SYSBUILD_USER}
-
-===========================================================================
diff --git a/sysutils/sysbuild/Makefile b/sysutils/sysbuild/Makefile
deleted file mode 100644
index 6f77c2a4028..00000000000
--- a/sysutils/sysbuild/Makefile
+++ /dev/null
@@ -1,69 +0,0 @@
-# $NetBSD: Makefile,v 1.16 2004/01/20 12:26:16 agc Exp $
-#
-
-DISTNAME= sysbuild-1.9
-CATEGORIES= sysutils
-MASTER_SITES= # empty
-DISTFILES= # empty
-
-MAINTAINER= jmmv@NetBSD.org
-COMMENT= Automate NetBSD system and kernel unprivileged builds
-
-WRKSRC= ${WRKDIR}
-EXTRACT_ONLY= # empty
-NO_CHECKSUM= yes
-NO_CONFIGURE= yes
-CHECK_SHLIBS= no
-SHLIB_HANDLING= no
-
-.include "../../mk/bsd.prefs.mk"
-
-# SYSBUILD_HOME - Home directory of SYSBUILD_USER user.
-SYSBUILD_HOMEDIR?= /home/sysbuild
-# SYSBUILD_USER - Unpriviledged user that runs the build script.
-SYSBUILD_USER?= sysbuild
-# SYSBUILD_OBJGROUP - Group that owns build files (should not be shared).
-SYSBUILD_OBJGROUP?= wobj
-# SYSBUILD_SRCGROUP - Group that owns sources (may be shared).
-SYSBUILD_SRCGROUP?= wsrc
-
-FILES_SUBST+= SYSBUILD_HOMEDIR=${SYSBUILD_HOMEDIR}
-FILES_SUBST+= SYSBUILD_USER=${SYSBUILD_USER}
-FILES_SUBST+= SYSBUILD_OBJGROUP=${SYSBUILD_OBJGROUP}
-FILES_SUBST+= SYSBUILD_SRCGROUP=${SYSBUILD_SRCGROUP}
-FILES_SUBST+= EGDIR=${EGDIR}
-MESSAGE_SUBST+= SYSBUILD_USER=${SYSBUILD_USER}
-
-USE_PKGINSTALL= yes
-DEINSTALL_EXTRA_TMPL= ${.CURDIR}/INSTALL
-INSTALL_EXTRA_TMPL= ${.CURDIR}/INSTALL
-
-PKG_GROUPS= ${SYSBUILD_OBJGROUP} ${SYSBUILD_SRCGROUP}
-PKG_USERS= ${SYSBUILD_USER}:${SYSBUILD_OBJGROUP}::`hostname`\\ sysbuild\\ output:${SYSBUILD_HOMEDIR}:${SH}
-
-EGDIR= ${PREFIX}/share/examples/sysbuild
-
-do-build:
- @${ECHO} "Generating sysbuild.sh..."
- @${SED} ${FILES_SUBST_SED} ${FILESDIR}/sysbuild.sh > \
- ${WRKSRC}/sysbuild.sh
- @${ECHO} "Generating sysbuild.8..."
- @${SED} ${FILES_SUBST_SED} ${FILESDIR}/sysbuild.8 > \
- ${WRKSRC}/sysbuild.8
- @${ECHO} "Generating sample default.conf..."
- @${SED} ${FILES_SUBST_SED} ${FILESDIR}/default.conf > \
- ${WRKSRC}/default.conf
- @${ECHO} "Generating sample crontab..."
- @${SED} ${FILES_SUBST_SED} ${FILESDIR}/crontab > ${WRKSRC}/crontab
- @${ECHO} "Generating sample profile..."
- @${SED} ${FILES_SUBST_SED} ${FILESDIR}/profile > ${WRKSRC}/profile
-
-do-install:
- ${INSTALL_DATA_DIR} ${PREFIX}/share/examples/sysbuild
- ${INSTALL_SCRIPT} ${WRKSRC}/sysbuild.sh ${PREFIX}/bin/sysbuild
- ${INSTALL_MAN} ${WRKSRC}/sysbuild.8 ${PREFIX}/man/man8/sysbuild.8
- ${INSTALL_DATA} ${WRKSRC}/default.conf ${EGDIR}/default.conf
- ${INSTALL_DATA} ${WRKSRC}/crontab ${EGDIR}/crontab
- ${INSTALL_DATA} ${WRKSRC}/profile ${EGDIR}/profile
-
-.include "../../mk/bsd.pkg.mk"
diff --git a/sysutils/sysbuild/PLIST b/sysutils/sysbuild/PLIST
deleted file mode 100644
index 8290be12580..00000000000
--- a/sysutils/sysbuild/PLIST
+++ /dev/null
@@ -1,7 +0,0 @@
-@comment $NetBSD: PLIST,v 1.2 2002/12/01 19:39:50 jmmv Exp $
-bin/sysbuild
-man/man8/sysbuild.8
-share/examples/sysbuild/crontab
-share/examples/sysbuild/default.conf
-share/examples/sysbuild/profile
-@dirrm share/examples/sysbuild
diff --git a/sysutils/sysbuild/files/crontab b/sysutils/sysbuild/files/crontab
deleted file mode 100644
index 90f5bf23a95..00000000000
--- a/sysutils/sysbuild/files/crontab
+++ /dev/null
@@ -1,19 +0,0 @@
-# $NetBSD: crontab,v 1.1.1.1 2002/11/28 19:57:29 jmmv Exp $
-#
-# sysbuild - crontab file for '@SYSBUILD_USER@' user
-#
-
-HOME=@SYSBUILD_HOMEDIR@
-SHELL=@SH@
-PATH=/bin:/sbin:/usr/bin:/usr/sbin:@PREFIX@/bin:@PREFIX@/sbin
-
-#minute hour mday month wday command
-
-# Update sources daily
-#0 0 * * * @PREFIX@/bin/sysbuild -m update-srcs
-
-# Build kernel weekly
-#0 4 * * 0 @PREFIX@/bin/sysbuild -m build-kernels
-
-# Build release weekly
-#0 6 * * 0 @PREFIX@/bin/sysbuild -m build-release
diff --git a/sysutils/sysbuild/files/default.conf b/sysutils/sysbuild/files/default.conf
deleted file mode 100644
index 2e1207c962c..00000000000
--- a/sysutils/sysbuild/files/default.conf
+++ /dev/null
@@ -1,66 +0,0 @@
-# $NetBSD: default.conf,v 1.4 2003/01/08 17:45:09 jmmv Exp $
-#
-# sysbuild - System wide configuration file
-#
-
-# ----------- Build time setup; be careful if you change these -----------
-HOMEDIR=@SYSBUILD_HOMEDIR@
-USER=@SYSBUILD_USER@
-OBJGROUP=@SYSBUILD_OBJGROUP@
-SRCGROUP=@SYSBUILD_SRCGROUP@
-# ------------------------------------------------------------------------
-
-# Directory that holds all object files and DESTDIR (requires *lots*
-# of space).
-BUILDDIR=/var/sysbuild
-
-# Release directory (it will require around 100-200 Mb).
-RELEASEDIR=/var/sysbuild/NetBSD-1.6
-
-# Machine name. It is appended to RELEASEDIR. It currently has no other
-# effect. Set only if you are building NetBSD-current!
-MACHINE=
-
-# 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"
-
-# Ownerships and permissions to set on CVSDIRS during clean-srcs.
-CVSDIRS_OWNER=$USER
-CVSDIRS_GROUP=$SRCGROUP
-CVSDIRS_PERMS="g+w"
-
-# Preserve tools (toolchain) even when running the "clean" target.
-KEEP_TOOLS=no
-
-# Base directory of kernel configuration files; sysbuild can only read
-# the ones contained here.
-KERNCONFDIR=$HOMEDIR
-
-# List of kernel names to build (files inside $KERNCONFDIR). You can
-# specify several; the first one is the kernel installed locally.
-KERNCONF="MYKERNEL GENERIC"
-
-# If using the `-m' flag, the user who will receive the logs.
-MAILTO=root
-
-# Set to `yes' to send the entire log of commands through mail.
-# Logs can become *very* big.
-MAIL_CMDLOG=no
-
-# When using the install-sets target, unpack these sets. Note that
-# 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/profile b/sysutils/sysbuild/files/profile
deleted file mode 100644
index a0921d95759..00000000000
--- a/sysutils/sysbuild/files/profile
+++ /dev/null
@@ -1,17 +0,0 @@
-# $NetBSD: profile,v 1.1 2002/12/01 19:39:50 jmmv Exp $
-#
-# @SYSBUILD_USER@ user's profile
-# Home directory is @SYSBUILD_HOMEDIR@
-#
-
-PATH=/bin:/sbin:/usr/bin:/usr/sbin:@PREFIX@/bin:@PREFIX@/sbin
-PATH=${PATH}:/usr/local/bin:/usr/local/sbin
-export PATH
-
-EDITOR=vi
-export EDITOR
-PAGER=more
-export PAGER
-
-PS1="@SYSBUILD_USER@@`hostname -s`\$ "
-export PS1
diff --git a/sysutils/sysbuild/files/sysbuild.8 b/sysutils/sysbuild/files/sysbuild.8
deleted file mode 100644
index ad1426e8452..00000000000
--- a/sysutils/sysbuild/files/sysbuild.8
+++ /dev/null
@@ -1,538 +0,0 @@
-.\" $NetBSD: sysbuild.8,v 1.7 2003/01/08 17:48:16 wiz Exp $
-.\"
-.\" sysbuild - Automatic NetBSD system builds
-.\" Copyright (c) 2002, Julio Merino <jmmv@netbsd.org>
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\" 2. Neither the name of The NetBSD Foundation nor the names of its
-.\" contributors may be used to endorse or promote products derived
-.\" from this software without specific prior written permission.
-.\" 3. Neither the name of author 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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 December 18, 2002
-.Dt SYSBUILD 8
-.Os
-.Sh NAME
-.Nm sysbuild
-.Nd Automates
-.Nx
-release and kernel builds
-.Sh SYNOPSIS
-.Nm
-.Op Fl fms
-.Op Fl c Ar conf
-.Ar target
-.Op Ar target_args ...
-.Sh DESCRIPTION
-The
-.Nm
-utility automates the building process of a
-.Nx
-release and all related stuff (like kernels), everything working as an
-unprivileged, special user.
-It should be clear enough that this program does not add any kind of
-magic to the existing build mechanisms of the
-.Nx
-operating system; it just makes things easier if you want to automate
-them (for example, to run them from a
-.Xr cron 8
-job).
-.Pp
-The following options are recognized:
-.Bl -tag -width indent
-.It Fl c Ar conf
-Specify the name of the configuration file.
-This is not a full name; it is just a symbolic name.
-See
-.Sx CONFIGURATION
-for for information.
-.It Fl f
-Run in fast mode.
-This option passes the
-.Fl u
-flag to the build.sh script; this way build directories are not
-cleaned during builds.
-While building kernels, it avoids the config, clean and depend
-steps.
-.It Fl m
-Capture all output and send it by mail to the
-.Va MAILTO
-user specified in the configuration file.
-.It Fl s
-Automatically change privileges using
-.Xr su 1 .
-By default the program will
-exit if user credentials for the specified target are incorrect.
-.El
-.Sh EXIT STATUS
-Returns 0 on success, 1 if any error happened.
-.Sh TARGETS
-.Nm
-behavior is controlled through a target.
-A target specifies what the program should do when executed.
-The following targets are recognized:
-.Bl -tag -width ident
-.It build-kernels
-Automatically build all kernels listed in the
-.Va KERNCONF
-variable.
-.Pp
-Each kernel name listed in this variable is configured, cleaned,
-depended and built inside its own directory, which is in turn placed in
-.Pa $BUILDDIR/kernels .
-Note that kernel configuration files must be stored inside the
-directory pointed to by
-.Va KERNCONFDIR .
-.Pp
-This target requires
-.Ql @SYSBUILD_USER@
-privileges.
-.It build-release
-Build a full release of the system.
-A release is formed by all compressed system sets, installation floppy
-disks and standard kernels.
-.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 .
-.Pp
-Depends on
-.Ql clean .
-.Pp
-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
-the recommended target, as building a release takes much more time.
-.Pp
-Depends on
-.Ql clean .
-.Pp
-This target requires
-.Ql @SYSBUILD_USER@
-privileges.
-.It clean
-Cleanup all work areas.
-This will unconditionally clean all the stuff located under the
-directory specified by
-.Va BUILDDIR ,
-but will not destroy the main directory hierarchy inside it.
-.Pp
-This target requires
-.Ql @SYSBUILD_USER@
-privileges.
-.It clean-srcs Op Ar dir ...
-Cleanup permissions of all source files inside the directories
-specified by
-.Va CVSDIRS ,
-or the ones specified by the optional list
-.Ar dir .
-All files are set to
-.Va CVSDIRS_OWNER
-owner and
-.Va CVSDIRS_GROUP
-group.
-Optional permissions can be provided through
-.Va CVSDIRS_PERMS ,
-which are set on all files using
-.Xr chown 8 .
-.Pp
-This target requires
-.Ql root
-privileges.
-.It config Op Ar conf
-Edit the default configuration file or the one specified by
-.Ar conf ,
-if given (remember that these are symbolic names, not full paths).
-This will run
-.Xr vi 1
-if no editor is specified by the
-.Ev EDITOR
-variable.
-.Pp
-If the specified configuration file does not exist, a sample one is
-copied from
-.Pa @EGDIR@/default.conf .
-.Pp
-This command is interactive, so output cannot be captured with
-.Fl m .
-.Pp
-This target requires
-.Ql root
-privileges.
-.It config-kernel Ar kernel
-Edit a kernel configuration file interactively, located inside
-.Pa @SYSBUILD_HOMEDIR@ .
-If the configuration file is not found, the
-.Pa GENERIC
-kernel for your platform is copied as a template.
-.Pp
-This target requires
-.Ql root
-privileges.
-.It destroy
-Completely remove the work area specified by
-.Va BUILDDIR .
-You should run this target before deinstalling this program.
-.Pp
-This target requires
-.Ql root
-privileges.
-.It etcupdate
-Extract the compressed
-.Pa etc.tgz
-file, generated during the
-.Ql build-sets
-or the
-.Ql build-release
-stages, in a temporary place and then run
-.Xr etcupdate 8
-over it to update your
-.Pa /etc
-directory.
-.Pp
-This command is interactive, so output cannot be captured with
-.Fl m .
-.Pp
-This target requires
-.Ql root
-privileges.
-.It init
-Initialize the work directory specified in
-.Va BUILDDIR
-plus all the subdirectories required inside it.
-Should be run once, after configuring the program with the
-.Ql config
-target (or when creating new configuration files).
-.Pp
-This target requires
-.Ql root
-privileges.
-.It install-kernel Op Ar kernel
-Install the first kernel specified in the
-.Va KERNCONF
-variable or the one supplied by the
-.Ar kernel
-argument.
-.Pp
-This target requires
-.Ql root
-privileges.
-.It install-sets
-Install built system sets, placed inside
-.Pa $RELEASEDIR/binary/sets .
-Only sets specified in the
-.Va SETS
-variable are installed.
-.Pp
-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
-to update all source trees specified by
-.Va CVSDIRS ,
-or the ones specified by the optional
-.Ar dir
-arguments.
-.Pp
-This target requires
-.Ql @SYSBUILD_USER@
-privileges.
-.El
-.Sh CONFIGURATION
-.Nm
-supports multiple configuration files.
-This is specially useful if you usually need to build different
-versions of
-.Nx ,
-that is, one configuration for each version.
-.Pp
-Configuration files are directly stored inside
-.Pa @SYSBUILD_HOMEDIR@ ,
-and have a
-.Ql .conf
-extension.
-The symbolic name of the configuration file (the one used with the
-.Ar -c
-flag) is formed by the name of the configuration file, without the
-path and without the extension.
-For example, the default configuration file (used when no other one is
-specified) is named
-.Pa @SYSBUILD_HOMEDIR@/default.conf ,
-but you could use
-.Fl c Ar default
-to select it.
-You should not worry about where these files are stored, as the
-.Ql config
-target will take care of it.
-.Pp
-The sample configuration file (copied to all new configurations
-created) is well documented and contains some reasonable
-defaults.
-Even though, a list of all known variables is provided here,
-for reference:
-.Bl -tag -width indent
-.It BUILDDIR
-The directory which holds all working stuff (object files, temporary
-root, etc.).
-You will need lots of space in this directory if you want
-to build full releases.
-.It CVSDIRS
-White-space separated list of directories that are updated using
-.Xr cvs 1
-when executing the
-.Ql update-srcs
-target.
-.It KEEP_TOOLS
-If set to
-.Ql yes ,
-do not remove tools while running the
-.Ql clean
-target.
-Therefore, the easiest way to really remove them will be with the
-.Ql destroy
-target.
-.It KERNCONF
-White-space separated list of kernels that are built with the
-.Ql build-kernels
-target.
-The first one is the kernel that will be installed when running
-.Ql install-kernel .
-.It KERNCONFDIR
-Directory which holds kernel configuration files.
-Defaults to
-.Pa @SYSBUILD_HOMEDIR@ .
-.It MACHINE
-Machine name.
-It is appended to
-.Va RELEASEDIR .
-Do not set if you are not building
-.Nx Ns -current .
-This variable may be used for cross-building in a future.
-.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
-User who will receive all logs by mail when using the
-.Fl m
-flag.
-.It MAIL_CMDLOG
-If set to
-.Ql yes ,
-mail the entire log of commands to the user specified in
-.Va MAILTO
-(if using the
-.Fl m
-flag).
-If set to
-.Ql no ,
-logs are left in
-.Pa /tmp .
-A summary of the process is always sent, regardless of this variable.
-Remember that logs can become very big!
-.It SETS
-White-space separated list of compressed sets that should be
-extracted in the machine while running
-.Ql install-sets .
-.It SRCDIR
-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 ,
-.Xr cvs 1 ,
-.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
-is our best friend to schedule these CPU tasks.
-You can, for example, set a task to build a release while you are
-sleeping, another to install it and when you get up you just have to
-run the interactive
-.Ql etcupdate
-target to finish the process.
-.Pp
-To make this even easier, the
-.Ql @SYSBUILD_USER@
-comes with a sample crontab file, with several (disabled) entries,
-ready to be edited.
-You should note that the
-.Fl m
-flag is a good choice for unattended tasks, because you will get a
-report by mail when they finish.
-.Pp
-To edit it, simply type:
-.Pp
-.Dl crontab -e -u @SYSBUILD_USER@
-.Sh EXAMPLES
-To initialize
-.Nm
-for the first time:
-.Pp
-.Dl sysbuild config
-.Dl sysbuild init
-.Pp
-Once you have configured it properly, you can execute the following, as
-.Ql root ,
-to build your kernels and system sets.
-Note that the
-.Fl s
-flag will automatically downgrade privileges.
-.Pp
-.Dl sysbuild -s build-kernels
-.Dl sysbuild -s build-sets
-.Pp
-And then, as
-.Ql root ,
-you can install the results:
-.Pp
-.Dl sysbuild install-kernel
-.Dl sysbuild install-sets
-.Pp
-Or, if you want to update all your source trees:
-.Pp
-.Dl sysbuild clean-srcs
-.Dl sysbuild -s update-srcs
-.Pp
-The first command should be only required once, the first time you
-want to do this task.
-.Pp
-Note that where we are using the
-.Fl s
-you could as well become the
-.Ql @SYSBUILD_USER@
-user using
-.Xr su 1
-and execute the command from there.
-Read
-.Sx SECURITY CONSIDERATIONS
-for more details on this.
-.Sh SECURITY CONSIDERATIONS
-The unprivileged user
-.Ql @SYSBUILD_USER@
-account is disabled by default.
-This means that root can access it through
-.Xr su 1 ,
-but no other user will be able to run
-.Nm
-properly.
-If you want anybody to be able to use it, just set a password for the
-account, give it to the user, and tell him to use the
-.Fl s
-flag.
-.Sh NOTES
-This program will only work in
-.Nx 1.6
-and above.
-Some targets may work in previous versions, but do not expect it to
-work fine.
-.Pp
-If you are changing some of the default directories in your
-.Pa /etc/mk.conf ,
-be sure to use the
-.Ql ?=
-operator instead of
-.Ql =
-so
-.Nm
-can override their value.
-.Sh AUTHORS
-.An Julio Merino Aq jmmv@netbsd.org
-.Sh TO DO
-There are many other things to do, but are left for future releases.
-Here is a small list with some ideas:
-.Bl -bullet -width indent
-.It
-Support building for multiple architectures.
-.It
-Create our own
-.Nm nbmake
-wrapper (using
-.Nm build.sh )
-at the beginning of each build, instead of passing all the
-variables when calling the program itself.
-.El
diff --git a/sysutils/sysbuild/files/sysbuild.sh b/sysutils/sysbuild/files/sysbuild.sh
deleted file mode 100644
index 3dec0882658..00000000000
--- a/sysutils/sysbuild/files/sysbuild.sh
+++ /dev/null
@@ -1,781 +0,0 @@
-#!/bin/sh
-#
-# $NetBSD: sysbuild.sh,v 1.10 2003/01/08 17:45:09 jmmv Exp $
-#
-# sysbuild - Automatic NetBSD system builds
-# Copyright (c) 2002, Julio Merino <jmmv@netbsd.org>
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. 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.
-# 3. Neither the name of author 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
-#
-
-progname=`basename $0`
-allargs="$*"
-conffile=@SYSBUILD_HOMEDIR@/default.conf
-
-# XXX: This is needed when downgrading privileges with su...
-PATH=/bin:/sbin:/usr/bin:/usr/sbin:@PREFIX@/bin:@PREFIX@/sbin
-
-usage() {
- echo "usage: sysbuild [-fms] [-c conf] target [target_arguments]"
- echo
- echo "Flags:"
- echo " -c conf Base name of configuration file"
- echo " -f Fast mode"
- echo " -m Send all output by mail instead of console"
- echo " -s Run \`su' to change privileges if needed"
- echo
- echo "Available targets:"
- 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"
- echo " config-kernel Create or edit a kernel configuration file"
- echo " destroy Remove all build stuff"
- echo " etcupdate Run etcupdate (interactive)"
- 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"
-}
-
-err() {
- echo "$progname: $*"
- exit 1
-}
-
-# --------------------------------------------------------------------
-# Checks
-# --------------------------------------------------------------------
-
-check_noroot() {
- if [ "`id -un`" != "$USER" ]; then
- if [ "$autosu" = "yes" ]; then
- echo "$progname: downgrading privileges to \`$USER'"
- su -l $USER -c "@PREFIX@/bin/sysbuild $allargs"
- if [ $? -ne 0 ]; then
- err "cannot switch privileges; aborting"
- fi
- # XXX: After su, terminate inmediately.
- exit 0
- else
- err "this target must be run as \`$USER' user (use the \`-s' flag)"
- fi
- fi
-}
-
-check_root() {
- if [ `id -u` -ne 0 ]; then
- if [ "$autosu" = "yes" ]; then
- echo "$progname: becoming root"
- su -l root -c "@PREFIX@/bin/sysbuild $allargs"
- if [ $? -ne 0 ]; then
- err "cannot switch privileges; aborting"
- fi
- # XXX: After su, terminate inmediately.
- exit 0
- else
- err "this target must be run as root (use the \`-s' flag)"
- fi
- fi
-}
-
-check_init() {
- _ok=1
- if [ ! -d $HOMEDIR ]; then _ok=0; fi
- if [ ! -d $BUILDDIR ]; then _ok=0; fi
- if [ ! -d $BUILDDIR/kernel ]; then _ok=0; fi
- if [ ! -d $BUILDDIR/obj ]; then _ok=0; fi
- if [ ! -d $BUILDDIR/root ]; then _ok=0; fi
- if [ ! -d $BUILDDIR/tools ]; then _ok=0; fi
- if [ $_ok -eq 0 ]; then
- err "trees not initialized; use the \`init' target first"
- fi
-}
-
-# --------------------------------------------------------------------
-# Kernel related functions
-# --------------------------------------------------------------------
-
-sysbuild_build_kernels() {
- check_noroot
- check_init
-
- _confs="$*"
- if [ -z "$_confs" ]; then
- _confs="$KERNCONF"
- fi
-
- sysbuild_build_tools
-
- _log=`mktemp /tmp/sysbuild.XXXX`
- if [ "$MAIL_CMDLOG" = "yes" ]; then
- echo "Logging to $_log (will be removed later)"
- else
- echo "Logging to $_log (will NOT be removed later)"
- fi
- echo
- for _k in $_confs; do
- if [ ! -f "$KERNCONFDIR/$_k" ]; then
- echo "No such kernel configuration $_k"
- elif [ "$fast" = "yes" -a -d $BUILDDIR/kernel/$_k ]; then
- cd $BUILDDIR/kernel/$_k
- printf "Buildling kernel $_k (fast mode):"
- $BUILDDIR/tools/bin/nbmake-`uname -m` BSDSRCDIR=$SRCDIR OBJMACHINE=yes MKOBJDIRS=yes >> $_log 2>&1
- if [ $? -ne 0 ]; then
- echo " failed."
- else
- echo " done."
- echo "Kernel MD5: `md5 netbsd`"
- fi
- else
- printf "Configuring kernel $_k:"
- mkdir -p $BUILDDIR/kernel/$_k
- $BUILDDIR/tools/bin/nbconfig -s $SRCDIR/sys -b $BUILDDIR/kernel/$_k $KERNCONFDIR/$_k >> $_log 2>&1
- if [ $? -ne 0 ]; then
- echo " failed."
- else
- echo " done."
- cd $BUILDDIR/kernel/$_k
-
- printf "Cleaning kernel $_k:"
- $BUILDDIR/tools/bin/nbmake-`uname -m` BSDSRCDIR=$SRCDIR OBJMACHINE=yes MKOBJDIRS=yes cleandir >> $_log 2>&1
- echo " done."
-
- printf "Depending kernel $_k:"
- $BUILDDIR/tools/bin/nbmake-`uname -m` BSDSRCDIR=$SRCDIR OBJMACHINE=yes MKOBJDIRS=yes depend >> $_log 2>&1
- if [ $? -ne 0 ]; then
- echo " failed."
- else
- echo " done."
-
- printf "Buildling kernel $_k:"
- $BUILDDIR/tools/bin/nbmake-`uname -m` BSDSRCDIR=$SRCDIR OBJMACHINE=yes MKOBJDIRS=yes >> $_log 2>&1
- if [ $? -ne 0 ]; then
- echo " failed."
- else
- echo " done."
- echo "Kernel MD5: `md5 netbsd`"
- fi
- fi
- fi
- fi
- echo
- done
-
- if [ "$MAIL_CMDLOG" = "yes" ]; then
- echo "Command log follows:"
- cat $_log
- rm -f $_log
- fi
-}
-
-sysbuild_install_kernel() {
- check_root
- check_init
-
- _conf="$*"
- if [ -z "$_conf" ]; then
- _conf="$KERNCONF"
- fi
- _conf=`echo $_conf | cut -d ' ' -f 1`
-
- if [ ! -f $BUILDDIR/kernel/$_conf/netbsd ]; then
- err "kernel $_conf is not built."
- else
- cd $BUILDDIR/kernel/$_conf
- echo "Kernel MD5: `md5 netbsd`"
- echo "Installing $_conf kernel:"
- $BUILDDIR/tools/bin/nbmake-`uname -m` DESTDIR= BSDSRCDIR=$SRCDIR OBJMACHINE=yes MKOBJDIRS=yes install
- fi
-}
-
-# --------------------------------------------------------------------
-# Release related functions
-# --------------------------------------------------------------------
-
-sysbuild_build_release() {
- check_noroot
- check_init
-
- _log=`mktemp /tmp/sysbuild.XXXX`
-
- if [ "$fast" = "no" ]; then
- sysbuild_clean
- fi
- 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 "Building full release:"
- mkdir -p $RELEASEDIR
- cd $SRCDIR
- if [ "$fast" = "yes" ]; then
- BSDSRCDIR=$SRCDIR BSDOBJDIR=$BUILDDIR/obj OBJMACHINE=yes MKOBJDIRS=yes ./build.sh -T $BUILDDIR/tools -D $BUILDDIR/root -R $RELEASEDIR -U -u >> $_log 2>&1
- else
- BSDSRCDIR=$SRCDIR BSDOBJDIR=$BUILDDIR/obj OBJMACHINE=yes MKOBJDIRS=yes ./build.sh -T $BUILDDIR/tools -D $BUILDDIR/root -R $RELEASEDIR -U >> $_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
-}
-
-sysbuild_build_sets() {
- check_noroot
- check_init
-
- _log=`mktemp /tmp/sysbuild.XXXX`
-
- if [ "$fast" = "no" ]; then
- sysbuild_clean
- fi
- 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 "Building system:"
- cd $SRCDIR
- if [ "$fast" = "yes" ]; then
- BSDSRCDIR=$SRCDIR BSDOBJDIR=$BUILDDIR/obj OBJMACHINE=yes MKOBJDIRS=yes ./build.sh -T $BUILDDIR/tools -d -D $BUILDDIR/root -U >> $_log 2>&1
- else
- BSDSRCDIR=$SRCDIR BSDOBJDIR=$BUILDDIR/obj OBJMACHINE=yes MKOBJDIRS=yes ./build.sh -T $BUILDDIR/tools -d -D $BUILDDIR/root -U -u >> $_log 2>&1
- fi
- if [ $? -ne 0 ]; then
- echo " failed."
- else
- echo " done."
-
- printf "Making sets:"
- mkdir -p $RELEASEDIR/$MACHINE/binary/sets
- cd $SRCDIR/distrib/sets
- $BUILDDIR/tools/bin/nbmake-`uname -m` sets BSDSRCDIR=$SRCDIR OBJMACHINE=yes MKOBJDIRS=yes TOOLDIR=$BUILDDIR/tools DESTDIR=$BUILDDIR/root RELEASEDIR=$RELEASEDIR UNPRIVED=yes >> $_log 2>&1
- if [ $? -ne 0 ]; then
- echo " failed."
- else
- echo " done."
- fi
- fi
-
- if [ "$MAIL_CMDLOG" = "yes" ]; then
- echo "Command log follows:"
- cat $_log
- rm -f $_log
- fi
-}
-
-sysbuild_install_sets() {
- check_root
- check_init
-
- for _s in $SETS; do
- printf "Installing $_s:"
- if [ ! -f $RELEASEDIR/$MACHINE/binary/sets/$_s ]; then
- echo " not built yet"
- else
- cd / && tar xzpf $RELEASEDIR/$MACHINE/binary/sets/$_s > /dev/null 2>&1
- if [ $? -ne 0 ]; then
- echo " failed."
- else
- echo " done."
- fi
- fi
- done
- echo
- 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/$MACHINE/binary/sets/$_s ]; then
- echo " not built yet"
- else
- cd / && tar xzpf $RELEASEDIR/$MACHINE/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
-
- _log=`mktemp /tmp/sysbuild.XXXX`
-
- if [ -x "$BUILDDIR/tools/bin/nbmake-`uname -m`" ]; then
- echo "$progname: tools seem to be up to date"
- return 0
- fi
-
- 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 "Building tools (toolchain):"
- cd $SRCDIR
- rm -rf $BUILDDIR/tools/*
- BSDSRCDIR=$SRCDIR BSDOBJDIR=$BUILDDIR/obj OBJMACHINE=yes MKOBJDIRS=yes ./build.sh -T $BUILDDIR/tools -t -D $BUILDDIR/root >> $_log 2>&1
- 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
-}
-
-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/$MACHINE
- ( cd $BUILDDIR/obj && \
- BSDSRCDIR=$SRCDIR NETBSDSRCDIR=$SRCDIR RELEASEDIR=$RELEASEDIR/$MACHINE $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/$MACHINE/binary/sets/x*.tgz
- chown $USER:$OBJGROUP $RELEASEDIR/$MACHINE/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
-# --------------------------------------------------------------------
-
-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."
-
- printf "Cleaning $BUILDDIR/root contents:"
- rm -rf $BUILDDIR/root/*
- echo " done."
-
- printf "Cleaning $BUILDDIR/tools contents:"
- if [ "$KEEP_TOOLS" = "yes" ]; then
- echo " kept."
- else
- rm -rf $BUILDDIR/tools/*
- echo " done."
- fi
-}
-
-sysbuild_destroy() {
- check_root
-
- printf "Destroying $BUILDDIR:"
- rm -rf $BUILDDIR
- echo " done."
-}
-
-sysbuild_etcupdate() {
- check_root
-
- tmp=`mktemp -d /tmp/sysbuild.XXXX`
- if [ ! -f $RELEASEDIR/$MACHINE/binary/sets/etc.tgz ]; then
- err "etc.tgz is not yet built."
- fi
- printf "Backing up /etc to /etc.old:"
- rm -rf /etc.old
- cp -rf /etc /etc.old > /dev/null 2>&1
- echo " done."
- printf "Unpacking etc.tgz:"
- cd $tmp && tar xzpf $RELEASEDIR/$MACHINE/binary/sets/etc.tgz > /dev/null 2>&1
- if [ $? -ne 0 ]; then
- echo " failed."
- else
- echo " done."
- etcupdate -b $tmp
- rm -rf $tmp
- fi
-}
-
-# --------------------------------------------------------------------
-# Initialization and configuration
-# --------------------------------------------------------------------
-
-sysbuild_init() {
- check_root
-
- printf "Initializing $HOMEDIR:"
- mkdir -p $HOMEDIR
- chown $USER:$OBJGROUP $HOMEDIR
- if [ ! -f $HOMEDIR/.profile ]; then
- cp @EGDIR@/profile $HOMEDIR/.profile
- cp @EGDIR@/profile $HOMEDIR/.shrc
- fi
- echo " done."
-
- printf "Initializing $BUILDDIR:"
- # Make main directory
- mkdir -p $BUILDDIR
- chown $USER:$OBJGROUP $BUILDDIR
- chmod 750 $BUILDDIR
- # Make kernel work area
- mkdir -p $BUILDDIR/kernel
- chown $USER:$OBJGROUP $BUILDDIR/kernel
- chmod 750 $BUILDDIR/kernel
- # Make obj work area
- mkdir -p $BUILDDIR/obj
- chown $USER:$OBJGROUP $BUILDDIR/obj
- chmod 750 $BUILDDIR/obj
- # Make root work area
- mkdir -p $BUILDDIR/root
- chown $USER:$OBJGROUP $BUILDDIR/root
- chmod 750 $BUILDDIR/root
- # Make tools directory
- mkdir -p $BUILDDIR/tools
- chown $USER:$OBJGROUP $BUILDDIR/tools
- chmod 750 $BUILDDIR/tools
- echo " done."
-}
-
-sysbuild_config() {
- check_root
-
- if [ ! -d "@SYSBUILD_HOMEDIR@" ]; then
- mkdir -p @SYSBUILD_HOMEDIR@
- fi
-
- _conf="$1"
- if [ -z "$_conf" ]; then
- _conf="default"
- fi
- _conffile="@SYSBUILD_HOMEDIR@/$_conf.conf"
-
- if [ ! -f "$_conffile" ]; then
- printf "Copying template to $_conffile:"
- cp @EGDIR@/default.conf $_conffile
- chmod 644 $_conffile
- echo " done."
- fi
-
- if [ -z "$EDITOR" ]; then
- vi $_conffile
- else
- $EDITOR $_conffile
- fi
-}
-
-sysbuild_config_kernel() {
- check_root
-
- _conf="$1"
- if [ -z "$_conf" ]; then
- err "kernel name must be specified"
- fi
- _conffile="@SYSBUILD_HOMEDIR@/$_conf"
-
- if [ ! -f "$_conffile" ]; then
- printf "Copying template to $_conffile:"
- _generic="$SRCDIR/sys/arch/`uname -p`/conf/GENERIC"
- cp "$_generic" $_conffile
- chmod 644 $_conffile
- echo " done."
- fi
-
- if [ -z "$EDITOR" ]; then
- vi $_conffile
- else
- $EDITOR $_conffile
- fi
-}
-
-# --------------------------------------------------------------------
-# Source related functions
-# --------------------------------------------------------------------
-
-sysbuild_clean_srcs() {
- check_root
-
- _dirs="$*"
- if [ -z "$_dirs" ]; then
- _dirs="$CVSDIRS"
- fi
-
- for _d in $_dirs; do
- printf "Fixing ownerships and permissions of $_d:"
- chown -R $CVSDIRS_OWNER:$CVSDIRS_GROUP $_d
- if [ -n "$CVSDIRS_PERMS" ]; then
- chmod -R $CVSDIRS_PERMS $_d
- fi
- echo " done."
- done
-}
-
-sysbuild_update_srcs() {
- check_noroot
-
- _dirs="$*"
- if [ -z "$_dirs" ]; then
- _dirs="$CVSDIRS"
- fi
-
- for _d in $_dirs; do
- echo "Updating source tree $_d"
- cd $_d && CVS_RSH=ssh cvs -q -z6 update -dP
- echo
- done
-}
-
-# --------------------------------------------------------------------
-# Main program
-# --------------------------------------------------------------------
-
-# Parse options
-args=`getopt c:fms $*`
-if [ $? != 0 ]; then
- usage
- exit 1
-fi
-set -- $args
-maillog="no"
-autosu="no"
-fast="no"
-while [ $# -gt 0 ]; do
- case "$1" in
- -c)
- conffile="@SYSBUILD_HOMEDIR@/$2.conf"
- shift
- ;;
- -f)
- fast="yes"
- ;;
- -m)
- maillog="yes"
- maillogfile=`mktemp /tmp/sysbuild.XXXX`
- ;;
- -s)
- autosu="yes"
- ;;
- --)
- shift; break
- ;;
- esac
- shift
-done
-
-if [ $# -lt 1 ]; then
- usage
- exit 1
-fi
-
-target="$1"
-shift
-
-# Read configuration file.
-if [ "$target" != "config" -a ! -f $conffile ]; then
- err "configuration file $conffile not found"
-elif [ "$target" != "config" ]; then
- . $conffile
-fi
-
-# Parse targets.
-case $target in
- build-kernels)
- if [ "$maillog" = "yes" ]; then
- sysbuild_build_kernels $* >> $maillogfile
- else
- sysbuild_build_kernels $*
- fi
- ;;
- build-release)
- if [ "$maillog" = "yes" ]; then
- sysbuild_build_release >> $maillogfile
- else
- sysbuild_build_release
- fi
- ;;
- build-sets)
- if [ "$maillog" = "yes" ]; then
- sysbuild_build_sets >> $maillogfile
- else
- 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
- else
- sysbuild_clean
- fi
- ;;
- clean-srcs)
- if [ "$maillog" = "yes" ]; then
- sysbuild_clean_srcs $* >> $maillogfile
- else
- sysbuild_clean_srcs $*
- fi
- ;;
- config)
- sysbuild_config $*
- ;;
- config-kernel)
- sysbuild_config_kernel $*
- ;;
- destroy)
- sysbuild_destroy
- ;;
- etcupdate)
- sysbuild_etcupdate
- ;;
- init)
- sysbuild_init
- ;;
- install-kernel)
- if [ "$maillog" = "yes" ]; then
- sysbuild_install_kernel >> $maillogfile
- else
- sysbuild_install_kernel
- fi
- ;;
- install-sets)
- if [ "$maillog" = "yes" ]; then
- sysbuild_install_sets >> $maillogfile
- else
- 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
- else
- sysbuild_update_srcs $*
- fi
- ;;
- *)
- err "unknown target \`$target'"
- ;;
-esac
-
-if [ "$maillog" = "yes" ]; then
- mail -s "Output of $target target" $MAILTO < $maillogfile
- rm -f $maillogfile
-fi
-
-exit 0