From cf35c685d01fa9b797c9a428f08f51b75ac6db4b Mon Sep 17 00:00:00 2001 From: Thomas Quinot Date: Sat, 3 May 2014 09:24:20 +0000 Subject: [PATCH] Add appropriate quoting to allow building with a KERNCONFDIR containing spaces. PR: kern/162736 MFC after: 1 week --- Makefile.inc1 | 4 ++-- tools/tools/nanobsd/nanobsd.sh | 24 ++++++++++++------------ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index 8bf192d5590f..ba7fe523774b 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -1001,7 +1001,7 @@ buildkernel: cd ${KRNLCONFDIR}; \ PATH=${TMPPATH} \ config ${CONFIGARGS} -d ${KRNLOBJDIR}/${_kernel} \ - -I ${KERNCONFDIR} ${KERNCONFDIR}/${_kernel} + -I '${KERNCONFDIR}' '${KERNCONFDIR}/${_kernel}' .endif .if !defined(NO_CLEAN) && !defined(NO_KERNELCLEAN) @echo @@ -1816,7 +1816,7 @@ DTBOUTPUTPATH= ${KRNLOBJDIR}/${KERNCONF}/ .if !defined(FDT_DTS_FILE) || empty(FDT_DTS_FILE) .if exists(${KERNCONFDIR}/${KERNCONF}) FDT_DTS_FILE!= awk 'BEGIN {FS="="} /^makeoptions[[:space:]]+FDT_DTS_FILE/ {print $$2}' \ - ${KERNCONFDIR}/${KERNCONF} ; echo + '${KERNCONFDIR}/${KERNCONF}' ; echo .endif .endif diff --git a/tools/tools/nanobsd/nanobsd.sh b/tools/tools/nanobsd/nanobsd.sh index 3f7fbe29ab58..274132c27430 100644 --- a/tools/tools/nanobsd/nanobsd.sh +++ b/tools/tools/nanobsd/nanobsd.sh @@ -233,7 +233,7 @@ build_kernel ( ) ( ( if [ -f ${NANO_KERNEL} ] ; then - extra="KERNCONFDIR=$(realpath $(dirname ${NANO_KERNEL}))" + kernconfdir_arg="KERNCONFDIR='$(realpath $(dirname ${NANO_KERNEL}))'" kernconf=$(basename ${NANO_KERNEL}) else kernconf=${NANO_KERNEL} @@ -245,10 +245,10 @@ build_kernel ( ) ( unset TARGET_CPUTYPE # Note: We intentionally build all modules, not only the ones in # NANO_MODULES so the built world can be reused by multiple images. - env TARGET_ARCH=${NANO_ARCH} ${NANO_PMAKE} buildkernel \ - SRCCONF=${SRCCONF} \ - ${extra} __MAKE_CONF=${NANO_MAKE_CONF_BUILD} \ - KERNCONF=${kernconf} + eval "TARGET_ARCH=${NANO_ARCH} ${NANO_PMAKE} buildkernel \ + SRCCONF='${SRCCONF}' \ + __MAKE_CONF='${NANO_MAKE_CONF_BUILD}' \ + ${kernconfdir_arg} KERNCONF=${kernconf}" ) > ${MAKEOBJDIRPREFIX}/_.bk 2>&1 ) @@ -315,19 +315,19 @@ install_kernel ( ) ( ( if [ -f ${NANO_KERNEL} ] ; then - extra="KERNCONFDIR=$(realpath $(dirname ${NANO_KERNEL}))" + kernconfdir_arg="KERNCONFDIR='$(realpath $(dirname ${NANO_KERNEL}))'" kernconf=$(basename ${NANO_KERNEL}) else kernconf=${NANO_KERNEL} fi cd ${NANO_SRC} - env TARGET_ARCH=${NANO_ARCH} ${NANO_MAKE} installkernel \ - DESTDIR=${NANO_WORLDDIR} \ - SRCCONF=${SRCCONF} \ - ${extra} __MAKE_CONF=${NANO_MAKE_CONF_INSTALL} \ - KERNCONF=${kernconf} \ - MODULES_OVERRIDE="${NANO_MODULES}" + eval "TARGET_ARCH=${NANO_ARCH} ${NANO_MAKE} installkernel \ + DESTDIR='${NANO_WORLDDIR}' \ + SRCCONF='${SRCCONF}' \ + __MAKE_CONF='${NANO_MAKE_CONF_INSTALL}' \ + ${kernconfdir_arg} KERNCONF=${kernconf} \ + MODULES_OVERRIDE='${NANO_MODULES}'" ) > ${NANO_OBJ}/_.ik 2>&1 )