aboutsummaryrefslogtreecommitdiff
path: root/release/release.sh
diff options
context:
space:
mode:
authorGlen Barber <gjb@FreeBSD.org>2015-05-06 14:35:43 +0000
committerGlen Barber <gjb@FreeBSD.org>2015-05-06 14:35:43 +0000
commita12fa24967c5d53433d728392e91e8c67a3a6766 (patch)
tree3d532af05b86d8a93000b389b42b2c9cfdcbc900 /release/release.sh
parentfb539361f71a6ae2f1123990d2d172036c7ecd60 (diff)
downloadsrc-a12fa24967c5d53433d728392e91e8c67a3a6766.tar.gz
src-a12fa24967c5d53433d728392e91e8c67a3a6766.zip
Add documentation for newly-added functions.
While here, move CHROOT_* and RELEASE_* variables from env_setup() to env_check() since they may change if a release.conf file is used. Sponsored by: The FreeBSD Foundation
Notes
Notes: svn path=/projects/release-arm-redux/; revision=282540
Diffstat (limited to 'release/release.sh')
-rwxr-xr-xrelease/release.sh33
1 files changed, 23 insertions, 10 deletions
diff --git a/release/release.sh b/release/release.sh
index 7806c036a993..0674c2fa08f6 100755
--- a/release/release.sh
+++ b/release/release.sh
@@ -51,6 +51,9 @@ usage() {
exit 1
}
+# env_setup(): Set up the default build environment variables, such as the
+# CHROOTDIR, VCSCMD, SVNROOT, etc. This is called before the release.conf
+# file is sourced, if '-c <release.conf>' is specified.
env_setup() {
# The directory within which the release will be built.
CHROOTDIR="/scratch"
@@ -108,19 +111,13 @@ env_setup() {
# cloud providers as part of the release.
WITH_CLOUDWARE=
- CHROOT_MAKEENV="${CHROOT_MAKEENV} MAKEOBJDIRPREFIX=${CHROOTDIR}/tmp/obj"
- CHROOT_WMAKEFLAGS="${MAKE_FLAGS} ${WORLD_FLAGS} ${CONF_FILES}"
- CHROOT_IMAKEFLAGS="${CONF_FILES}"
- CHROOT_DMAKEFLAGS="${CONF_FILES}"
- RELEASE_WMAKEFLAGS="${MAKE_FLAGS} ${WORLD_FLAGS} ${ARCH_FLAGS} ${CONF_FILES}"
- RELEASE_KMAKEFLAGS="${MAKE_FLAGS} ${KERNEL_FLAGS} KERNCONF=\"${KERNEL}\" ${ARCH_FLAGS} ${CONF_FILES}"
- RELEASE_RMAKEFLAGS="${ARCH_FLAGS} KERNCONF=\"${KERNEL}\" ${CONF_FILES} \
- ${DOCPORTS} WITH_DVD=${WITH_DVD} WITH_VMIMAGES=${WITH_VMIMAGES} \
- WITH_CLOUDWARE=${WITH_CLOUDWARE} XZ_THREADS=${XZ_THREADS}"
-
return 0
} # env_setup()
+# env_check(): Perform sanity tests on the build environment, such as ensuring
+# files/directories exist, as well as adding backwards-compatibility hacks if
+# necessary. This is called unconditionally, and overrides the defaults set
+# in env_setup() if '-c <release.conf>' is specified.
env_check() {
# Fix for backwards-compatibility with release.conf that does not have the
# trailing '/'.
@@ -187,9 +184,20 @@ env_check() {
exit 1
fi
+ CHROOT_MAKEENV="${CHROOT_MAKEENV} MAKEOBJDIRPREFIX=${CHROOTDIR}/tmp/obj"
+ CHROOT_WMAKEFLAGS="${MAKE_FLAGS} ${WORLD_FLAGS} ${CONF_FILES}"
+ CHROOT_IMAKEFLAGS="${CONF_FILES}"
+ CHROOT_DMAKEFLAGS="${CONF_FILES}"
+ RELEASE_WMAKEFLAGS="${MAKE_FLAGS} ${WORLD_FLAGS} ${ARCH_FLAGS} ${CONF_FILES}"
+ RELEASE_KMAKEFLAGS="${MAKE_FLAGS} ${KERNEL_FLAGS} KERNCONF=\"${KERNEL}\" ${ARCH_FLAGS} ${CONF_FILES}"
+ RELEASE_RMAKEFLAGS="${ARCH_FLAGS} KERNCONF=\"${KERNEL}\" ${CONF_FILES} \
+ ${DOCPORTS} WITH_DVD=${WITH_DVD} WITH_VMIMAGES=${WITH_VMIMAGES} \
+ WITH_CLOUDWARE=${WITH_CLOUDWARE} XZ_THREADS=${XZ_THREADS}"
+
return 0
} # env_check()
+# chroot_setup(): Prepare the build chroot environment for the release build.
chroot_setup() {
load_chroot_env
mkdir -p ${CHROOTDIR}/usr
@@ -218,6 +226,8 @@ chroot_setup() {
return 0
} # chroot_setup()
+# extra_chroot_setup(): Prepare anything additional within the build
+# necessary for the release build.
extra_chroot_setup() {
# If MAKE_CONF and/or SRC_CONF are set and not character devices (/dev/null),
# copy them to the chroot.
@@ -253,6 +263,7 @@ extra_chroot_setup() {
return 0
} # extra_chroot_setup()
+# chroot_build_target(): Build the userland and kernel for the build target.
chroot_build_target() {
buildenv_setup
load_target_env
@@ -287,6 +298,7 @@ chroot_build_target() {
return 0
} # chroot_build_target
+# chroot_build_release(): Invoke the 'make release' target.
chroot_build_release() {
buildenv_setup
load_target_env
@@ -299,6 +311,7 @@ chroot_build_release() {
return 0
} # chroot_build_release()
+# main(): Start here.
main() {
set -e # Everything must succeed
env_setup