release.sh (57dbde2ca8d4c493746569ec819faa3141d3d576) | release.sh (9056dae945680bce10b3cf844caf83cb51254a0a) |
---|---|
1#!/bin/sh 2#- 3# Copyright (c) 2013-2015 The FreeBSD Foundation 4# Copyright (c) 2013 Glen Barber 5# Copyright (c) 2011 Nathan Whitehorn 6# All rights reserved. 7# 8# Portions of this software were developed by Glen Barber --- 110 unchanged lines hidden (view full) --- 119 return 0 120} # env_setup() 121 122# env_check(): Perform sanity tests on the build environment, such as ensuring 123# files/directories exist, as well as adding backwards-compatibility hacks if 124# necessary. This is called unconditionally, and overrides the defaults set 125# in env_setup() if '-c <release.conf>' is specified. 126env_check() { | 1#!/bin/sh 2#- 3# Copyright (c) 2013-2015 The FreeBSD Foundation 4# Copyright (c) 2013 Glen Barber 5# Copyright (c) 2011 Nathan Whitehorn 6# All rights reserved. 7# 8# Portions of this software were developed by Glen Barber --- 110 unchanged lines hidden (view full) --- 119 return 0 120} # env_setup() 121 122# env_check(): Perform sanity tests on the build environment, such as ensuring 123# files/directories exist, as well as adding backwards-compatibility hacks if 124# necessary. This is called unconditionally, and overrides the defaults set 125# in env_setup() if '-c <release.conf>' is specified. 126env_check() { |
127 chroot_build_release_cmd="chroot_build_release" |
|
127 # Fix for backwards-compatibility with release.conf that does not have 128 # the trailing '/'. 129 case ${SVNROOT} in 130 *svn*) 131 SVNROOT="${SVNROOT}/" 132 ;; 133 *) 134 ;; 135 esac 136 137 # Prefix the branches with the SVNROOT for the full checkout URL. 138 SRCBRANCH="${SVNROOT}${SRCBRANCH}" 139 DOCBRANCH="${SVNROOT}${DOCBRANCH}" 140 PORTBRANCH="${SVNROOT}${PORTBRANCH}" 141 142 if [ -n "${EMBEDDEDBUILD}" ]; then 143 WITH_DVD= 144 WITH_COMPRESSED_IMAGES= 145 NODOC=yes | 128 # Fix for backwards-compatibility with release.conf that does not have 129 # the trailing '/'. 130 case ${SVNROOT} in 131 *svn*) 132 SVNROOT="${SVNROOT}/" 133 ;; 134 *) 135 ;; 136 esac 137 138 # Prefix the branches with the SVNROOT for the full checkout URL. 139 SRCBRANCH="${SVNROOT}${SRCBRANCH}" 140 DOCBRANCH="${SVNROOT}${DOCBRANCH}" 141 PORTBRANCH="${SVNROOT}${PORTBRANCH}" 142 143 if [ -n "${EMBEDDEDBUILD}" ]; then 144 WITH_DVD= 145 WITH_COMPRESSED_IMAGES= 146 NODOC=yes |
147 case ${EMBEDDED_TARGET}:${EMBEDDED_TARGET_ARCH} in 148 arm:armv6) 149 chroot_build_release_cmd="chroot_arm_armv6_build_release" 150 ;; 151 *) 152 esac |
|
146 fi 147 148 # If PORTS is set and NODOC is unset, force NODOC=yes because the ports 149 # tree is required to build the documentation set. 150 if [ -n "${NOPORTS}" ] && [ -z "${NODOC}" ]; then 151 echo "*** NOTICE: Setting NODOC=1 since ports tree is required" 152 echo " and NOPORTS is set." 153 NODOC=yes --- 144 unchanged lines hidden (view full) --- 298 eval chroot ${CHROOTDIR} make -C /usr/src ${RELEASE_KMAKEFLAGS} buildkernel 299 300 return 0 301} # chroot_build_target 302 303# chroot_build_release(): Invoke the 'make release' target. 304chroot_build_release() { 305 load_target_env | 153 fi 154 155 # If PORTS is set and NODOC is unset, force NODOC=yes because the ports 156 # tree is required to build the documentation set. 157 if [ -n "${NOPORTS}" ] && [ -z "${NODOC}" ]; then 158 echo "*** NOTICE: Setting NODOC=1 since ports tree is required" 159 echo " and NOPORTS is set." 160 NODOC=yes --- 144 unchanged lines hidden (view full) --- 305 eval chroot ${CHROOTDIR} make -C /usr/src ${RELEASE_KMAKEFLAGS} buildkernel 306 307 return 0 308} # chroot_build_target 309 310# chroot_build_release(): Invoke the 'make release' target. 311chroot_build_release() { 312 load_target_env |
313 eval chroot ${CHROOTDIR} make -C /usr/src/release \ 314 ${RELEASE_RMAKEFLAGS} release 315 eval chroot ${CHROOTDIR} make -C /usr/src/release \ 316 ${RELEASE_RMAKEFLAGS} install DESTDIR=/R \ 317 WITH_COMPRESSED_IMAGES=${WITH_COMPRESSED_IMAGES} \ 318 WITH_COMPRESSED_VMIMAGES=${WITH_COMPRESSED_VMIMAGES} |
|
306 | 319 |
307 if [ -z "${EMBEDDEDBUILD}" ]; then 308 eval chroot ${CHROOTDIR} make -C /usr/src/release \ 309 ${RELEASE_RMAKEFLAGS} release 310 eval chroot ${CHROOTDIR} make -C /usr/src/release \ 311 ${RELEASE_RMAKEFLAGS} install DESTDIR=/R \ 312 WITH_COMPRESSED_IMAGES=${WITH_COMPRESSED_IMAGES} \ 313 WITH_COMPRESSED_VMIMAGES=${WITH_COMPRESSED_VMIMAGES} 314 return 0 315 else 316 load_target_env 317 # XXX: In progress. 318 return 0 | 320 return 0 321} # chroot_build_release() 322 323# chroot_arm_armv6_build_release(): Create arm/armv6 SD card image. 324chroot_arm_armv6_build_release() { 325 load_target_env 326 # XXX: In progress. 327 if [ -e "${RELENGDIR}/tools/${TARGET}.subr" ]; then 328 . "${RELENGDIR}/tools/${TARGET}.subr" |
319 fi 320 321 return 0 | 329 fi 330 331 return 0 |
322} # chroot_build_release() | 332} # chroot_arm_armv6_build_release() |
323 324# main(): Start here. 325main() { 326 set -e # Everything must succeed 327 env_setup 328 while getopts c: opt; do 329 case ${opt} in 330 c) --- 13 unchanged lines hidden (view full) --- 344 echo "Using default build environment." 345 fi 346 fi 347 env_check 348 trap "umount ${CHROOTDIR}/dev" EXIT # Clean up devfs mount on exit 349 chroot_setup 350 extra_chroot_setup 351 chroot_build_target | 333 334# main(): Start here. 335main() { 336 set -e # Everything must succeed 337 env_setup 338 while getopts c: opt; do 339 case ${opt} in 340 c) --- 13 unchanged lines hidden (view full) --- 354 echo "Using default build environment." 355 fi 356 fi 357 env_check 358 trap "umount ${CHROOTDIR}/dev" EXIT # Clean up devfs mount on exit 359 chroot_setup 360 extra_chroot_setup 361 chroot_build_target |
352 chroot_build_release | 362 ${chroot_build_release_cmd} |
353 354 return 0 355} # main() 356 357main "${@}" | 363 364 return 0 365} # main() 366 367main "${@}" |