From bd2bddcd7821f2f4bb8005631e8779f5f0bdfa60 Mon Sep 17 00:00:00 2001 From: CyberLeo Date: Mon, 3 Oct 2011 11:07:50 -0500 Subject: [PATCH] script/makeworld: take advantage of newly discovered KERNCONFDIR to avoid tampering with /usr/src --- script/makeworld | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/script/makeworld b/script/makeworld index 9467a11..7d89188 100755 --- a/script/makeworld +++ b/script/makeworld @@ -60,7 +60,10 @@ prepare() { if [ -d "${world}/config" ] then meh "Installing build-time configuration" - [ -f "${world}/config/${CONF}" ] && cp "${world}/config/${CONF}" "${SRCS}/sys/${ARCH}/conf/" + [ -f "${world}/config/${CONF}" ] && { + mkdir -p "${build}/usr/obj/conf" || wtf + cp "${world}/config/${CONF}" "${build}/usr/obj/conf" || wtf + } [ -f "${world}/config/make.conf" ] && cp "${world}/config/make.conf" "${build}/etc/" [ -f "${world}/config/src.conf" ] && cp "${world}/config/src.conf" "${build}/etc/" fi @@ -146,8 +149,10 @@ SRCS="$(realpath "${SRCS}")" # If kernel config matching CONF does not exist, assume GENERIC if [ -e "${world}/config/${CONF}" ] then + KERNCONFDIR=/usr/obj/conf KERNCONF="${CONF}" else + KERNCONFDIR= KERNCONF=GENERIC fi @@ -199,7 +204,8 @@ do meh "==> Step: ${step} -> ${build_log}" [ "${BUILD_VERBOSE}" ] || exec 3>&1 > /dev/null script "${build_log}" env -i ${env} chroot "${build}" sh -c \ - "cd /usr/src; time make ${MAKEOPTS} ${step} TARGET=${ARCH} KERNCONF=${KERNCONF} DESTDIR=/mnt" + "cd /usr/src; time make ${MAKEOPTS} ${step} TARGET=${ARCH} " \ + "${KERNCONFDIR:+KERNCONFDIR=${KERNCONFDIR}} KERNCONF=${KERNCONF} DESTDIR=/mnt" res=$? [ "${BUILD_VERBOSE}" ] || exec 1>&3 [ "${res}" -gt 0 ] && wtf "chroot-cmd ${step} failed; check log" -- 2.42.0