version 1.255.2.1, 2012/11/20 02:57:27 |
version 1.255.2.2, 2013/02/25 00:23:49 |
|
|
unsetmakeenv INFODIR |
unsetmakeenv INFODIR |
unsetmakeenv LESSCHARSET |
unsetmakeenv LESSCHARSET |
unsetmakeenv MAKEFLAGS |
unsetmakeenv MAKEFLAGS |
|
unsetmakeenv TERMINFO |
setmakeenv LC_ALL C |
setmakeenv LC_ALL C |
|
|
# Find information about the build platform. This should be |
# Find information about the build platform. This should be |
|
|
do_iso_image_source=false |
do_iso_image_source=false |
do_live_image=false |
do_live_image=false |
do_install_image=false |
do_install_image=false |
|
do_disk_image=false |
do_params=false |
do_params=false |
do_rump=false |
do_rump=false |
|
|
Line 588 MACHINE=evbarm MACHINE_ARCH=arm ALIAS=e |
|
Line 590 MACHINE=evbarm MACHINE_ARCH=arm ALIAS=e |
|
MACHINE=evbarm MACHINE_ARCH=armeb ALIAS=evbarm-eb |
MACHINE=evbarm MACHINE_ARCH=armeb ALIAS=evbarm-eb |
MACHINE=evbarm MACHINE_ARCH=earm ALIAS=evbearm-el |
MACHINE=evbarm MACHINE_ARCH=earm ALIAS=evbearm-el |
MACHINE=evbarm MACHINE_ARCH=earmeb ALIAS=evbearm-eb |
MACHINE=evbarm MACHINE_ARCH=earmeb ALIAS=evbearm-eb |
|
MACHINE=evbarm MACHINE_ARCH=earmhf ALIAS=evbearmhf-el |
|
MACHINE=evbarm MACHINE_ARCH=earmhfeb ALIAS=evbearmhf-eb |
MACHINE=evbmips MACHINE_ARCH= NO_DEFAULT |
MACHINE=evbmips MACHINE_ARCH= NO_DEFAULT |
MACHINE=evbmips MACHINE_ARCH=mips64eb ALIAS=evbmips64-eb |
MACHINE=evbmips MACHINE_ARCH=mips64eb ALIAS=evbmips64-eb |
MACHINE=evbmips MACHINE_ARCH=mips64el ALIAS=evbmips64-el |
MACHINE=evbmips MACHINE_ARCH=mips64el ALIAS=evbmips64-el |
Line 919 Usage: ${progname} [-EhnorUuxy] [-a arch |
|
Line 923 Usage: ${progname} [-EhnorUuxy] [-a arch |
|
RELEASEDIR/RELEASEMACHINEDIR/installation/liveimage. |
RELEASEDIR/RELEASEMACHINEDIR/installation/liveimage. |
install-image Create bootable installation image in |
install-image Create bootable installation image in |
RELEASEDIR/RELEASEMACHINEDIR/installation/installimage. |
RELEASEDIR/RELEASEMACHINEDIR/installation/installimage. |
|
disk-image=target Creae bootable disk image in |
|
RELEASEDIR/RELEASEMACHINEDIR/binary/gzimg/target.img.gz. |
params Display various make(1) parameters. |
params Display various make(1) parameters. |
|
|
Options: |
Options: |
|
|
bomb "Must supply a kernel name with \`${op}=...'" |
bomb "Must supply a kernel name with \`${op}=...'" |
;; |
;; |
|
|
|
disk-image=*) |
|
arg=${op#*=} |
|
op=disk_image |
|
[ -n "${arg}" ] || |
|
bomb "Must supply a target name with \`${op}=...'" |
|
|
|
;; |
|
|
modules) |
modules) |
op=modules |
op=modules |
;; |
;; |
|
|
# |
# |
sanitycheck() |
sanitycheck() |
{ |
{ |
|
# Non-root should always use either the -U or -E flag. |
|
# |
|
if ! ${do_expertmode} && \ |
|
[ "$id_u" -ne 0 ] && \ |
|
[ "${MKUNPRIVED}" = "no" ] ; then |
|
bomb "-U or -E must be set for build as an unprivileged user." |
|
fi |
|
|
|
# Install as non-root is a bad idea. |
|
# |
|
if ${do_install} && [ "$id_u" -ne 0 ] ; then |
|
if ${do_expertmode}; then |
|
warning "Will install as an unprivileged user." |
|
else |
|
bomb "-E must be set for install as an unprivileged user." |
|
fi |
|
fi |
|
|
# If the PATH contains any non-absolute components (including, |
# If the PATH contains any non-absolute components (including, |
# but not limited to, "." or ""), then complain. As an exception, |
# but not limited to, "." or ""), then complain. As an exception, |
# allow "" or "." as the last component of the PATH. This is fatal |
# allow "" or "." as the last component of the PATH. This is fatal |
|
|
${runcmd} env CC="${HOST_CC-cc}" CPPFLAGS="${HOST_CPPFLAGS}" \ |
${runcmd} env CC="${HOST_CC-cc}" CPPFLAGS="${HOST_CPPFLAGS}" \ |
CFLAGS="${HOST_CFLAGS--O}" LDFLAGS="${HOST_LDFLAGS}" \ |
CFLAGS="${HOST_CFLAGS--O}" LDFLAGS="${HOST_LDFLAGS}" \ |
${HOST_SH} "${TOP}/tools/make/configure" || |
${HOST_SH} "${TOP}/tools/make/configure" || |
bomb "Configure of ${toolprefix}make failed" |
( cp ${tmpdir}/config.log ${tmpdir}-config.log |
|
bomb "Configure of ${toolprefix}make failed, see ${tmpdir}-config.log for details" ) |
${runcmd} ${HOST_SH} buildmake.sh || |
${runcmd} ${HOST_SH} buildmake.sh || |
bomb "Build of ${toolprefix}make failed" |
bomb "Build of ${toolprefix}make failed" |
make="${tmpdir}/${toolprefix}make" |
make="${tmpdir}/${toolprefix}make" |
Line 1580 validatemakeparams() |
|
Line 1613 validatemakeparams() |
|
removedirs="${TOOLDIR}" |
removedirs="${TOOLDIR}" |
|
|
if [ -z "${DESTDIR}" ] || [ "${DESTDIR}" = "/" ]; then |
if [ -z "${DESTDIR}" ] || [ "${DESTDIR}" = "/" ]; then |
if ${do_build} || ${do_distribution} || ${do_release}; then |
if ${do_distribution} || ${do_release} || \ |
if ! ${do_build} || \ |
[ "${uname_s}" != "NetBSD" ] || \ |
[ "${uname_s}" != "NetBSD" ] || \ |
[ "${uname_m}" != "${MACHINE}" ]; then |
[ "${uname_m}" != "${MACHINE}" ]; then |
bomb "DESTDIR must != / for cross builds, or ${progname} 'distribution' or 'release'." |
bomb "DESTDIR must != / for cross builds, or ${progname} 'distribution' or 'release'." |
|
fi |
|
if ! ${do_expertmode}; then |
|
bomb "DESTDIR must != / for non -E (expert) builds" |
|
fi |
|
statusmsg "WARNING: Building to /, in expert mode." |
|
statusmsg " This may cause your system to break! Reasons include:" |
|
statusmsg " - your kernel is not up to date" |
|
statusmsg " - the libraries or toolchain have changed" |
|
statusmsg " YOU HAVE BEEN WARNED!" |
|
fi |
fi |
|
if ! ${do_expertmode}; then |
|
bomb "DESTDIR must != / for non -E (expert) builds" |
|
fi |
|
statusmsg "WARNING: Building to /, in expert mode." |
|
statusmsg " This may cause your system to break! Reasons include:" |
|
statusmsg " - your kernel is not up to date" |
|
statusmsg " - the libraries or toolchain have changed" |
|
statusmsg " YOU HAVE BEEN WARNED!" |
else |
else |
removedirs="${removedirs} ${DESTDIR}" |
removedirs="${removedirs} ${DESTDIR}" |
fi |
fi |
if ${do_build} || ${do_distribution} || ${do_release}; then |
|
if ! ${do_expertmode} && \ |
|
[ "$id_u" -ne 0 ] && \ |
|
[ "${MKUNPRIVED}" = "no" ] ; then |
|
bomb "-U or -E must be set for build as an unprivileged user." |
|
fi |
|
fi |
|
if ${do_releasekernel} && [ -z "${RELEASEDIR}" ]; then |
if ${do_releasekernel} && [ -z "${RELEASEDIR}" ]; then |
bomb "Must set RELEASEDIR with \`releasekernel=...'" |
bomb "Must set RELEASEDIR with \`releasekernel=...'" |
fi |
fi |
|
|
# Install as non-root is a bad idea. |
|
# |
|
if ${do_install} && [ "$id_u" -ne 0 ] ; then |
|
if ${do_expertmode}; then |
|
warning "Will install as an unprivileged user." |
|
else |
|
bomb "-E must be set for install as an unprivileged user." |
|
fi |
|
fi |
|
|
|
# If a previous build.sh run used -U (and therefore created a |
# If a previous build.sh run used -U (and therefore created a |
# METALOG file), then most subsequent build.sh runs must also |
# METALOG file), then most subsequent build.sh runs must also |
# use -U. If DESTDIR is about to be removed, then don't perform |
# use -U. If DESTDIR is about to be removed, then don't perform |
Line 1629 validatemakeparams() |
|
Line 1643 validatemakeparams() |
|
# DESTDIR is about to be removed |
# DESTDIR is about to be removed |
;; |
;; |
*) |
*) |
if ( ${do_build} || ${do_distribution} || ${do_release} || \ |
if [ -e "${DESTDIR}/METALOG" ] && \ |
${do_install} ) && \ |
|
[ -e "${DESTDIR}/METALOG" ] && \ |
|
[ "${MKUNPRIVED}" = "no" ] ; then |
[ "${MKUNPRIVED}" = "no" ] ; then |
if $do_expertmode; then |
if $do_expertmode; then |
warning "A previous build.sh run specified -U." |
warning "A previous build.sh run specified -U." |
Line 1798 getkernelconf() |
|
Line 1810 getkernelconf() |
|
kernelbuildpath="${KERNOBJDIR}/${kernelconfname}" |
kernelbuildpath="${KERNOBJDIR}/${kernelconfname}" |
} |
} |
|
|
|
diskimage() |
|
{ |
|
ARG="$(echo $1 | tr '[:lower:]' '[:upper:]')" |
|
[ -f "${DESTDIR}/etc/mtree/set.base" ] || |
|
bomb "The release binaries must be built first" |
|
kerneldir="${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/kernel" |
|
kernel="${kerneldir}/netbsd-${ARG}.gz" |
|
[ -f "${kernel}" ] || |
|
bomb "The kernel ${kernel} must be built first" |
|
make_in_dir "${NETBSDSRCDIR}/etc" "smp_${1}" |
|
} |
|
|
buildkernel() |
buildkernel() |
{ |
{ |
if ! ${do_tools} && ! ${buildkernelwarned:-false}; then |
if ! ${do_tools} && ! ${buildkernelwarned:-false}; then |
|
|
releasekernel "${arg}" |
releasekernel "${arg}" |
;; |
;; |
|
|
|
disk-image=*) |
|
arg=${op#*=} |
|
diskimage "${arg}" |
|
;; |
|
|
modules) |
modules) |
buildmodules |
buildmodules |
;; |
;; |