From owner-svn-src-all@freebsd.org Mon Aug 20 10:39:54 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3EBBC108BE1D; Mon, 20 Aug 2018 10:39:54 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D948186496; Mon, 20 Aug 2018 10:39:53 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B6C4E14230; Mon, 20 Aug 2018 10:39:53 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7KAdrwO079557; Mon, 20 Aug 2018 10:39:53 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7KAdrMM079556; Mon, 20 Aug 2018 10:39:53 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <201808201039.w7KAdrMM079556@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Mon, 20 Aug 2018 10:39:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338098 - in head: . tools/build X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: in head: . tools/build X-SVN-Commit-Revision: 338098 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Aug 2018 10:39:54 -0000 Author: arichardson Date: Mon Aug 20 10:39:53 2018 New Revision: 338098 URL: https://svnweb.freebsd.org/changeset/base/338098 Log: Don't create directories in ${WORLDTMP}/legacy with mtree This has two advantages: 1) We no longer create lots of empty directories that are not needed 2) This is a requirement for building on non-FreeBSD hosts since mtree will only exist after the bootstrap-tools phase there. Aproved By: jhb (mentor) Differential Revision: https://reviews.freebsd.org/D16773 Modified: head/Makefile.inc1 head/tools/build/Makefile Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Mon Aug 20 10:39:48 2018 (r338097) +++ head/Makefile.inc1 Mon Aug 20 10:39:53 2018 (r338098) @@ -968,29 +968,10 @@ _worldtmp: .PHONY .endif # !defined(NO_CLEAN) @mkdir -p ${WORLDTMP} @touch ${WORLDTMP}/${.TARGET} - -.for _dir in \ - lib lib/casper lib/geom usr legacy/bin legacy/usr - mkdir -p ${WORLDTMP}/${_dir} -.endfor - ${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.usr.dist \ - -p ${WORLDTMP}/legacy/usr >/dev/null - ${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.include.dist \ - -p ${WORLDTMP}/legacy/usr/include >/dev/null - ${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.usr.dist \ - -p ${WORLDTMP}/usr >/dev/null - ${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.include.dist \ - -p ${WORLDTMP}/usr/include >/dev/null - ln -sf ${.CURDIR}/sys ${WORLDTMP} -.if ${MK_DEBUG_FILES} != "no" - ${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.debug.dist \ - -p ${WORLDTMP}/legacy/usr/lib >/dev/null - ${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.debug.dist \ - -p ${WORLDTMP}/usr/lib >/dev/null -.endif -.for _mtree in ${LOCAL_MTREE} - ${WORLDTMP_MTREE} -f ${.CURDIR}/${_mtree} -p ${WORLDTMP} > /dev/null -.endfor +# We can't use mtree to create the worldtmp directories since it may not be +# available on the target system (this happens e.g. when building on non-FreeBSD) + cd ${.CURDIR}/tools/build; \ + ${MAKE} DIRPRFX=tools/build/ DESTDIR=${WORLDTMP}/legacy installdirs _legacy: @echo @echo "--------------------------------------------------------------" @@ -1003,6 +984,19 @@ _bootstrap-tools: @echo ">>> stage 1.2: bootstrap tools" @echo "--------------------------------------------------------------" ${_+_}cd ${.CURDIR}; ${BMAKE} bootstrap-tools + mkdir -p ${WORLDTMP}/usr ${WORLDTMP}/lib/casper ${WORLDTMP}/lib/geom + ${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.usr.dist \ + -p ${WORLDTMP}/usr >/dev/null + ${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.include.dist \ + -p ${WORLDTMP}/usr/include >/dev/null + ln -sf ${.CURDIR}/sys ${WORLDTMP} +.if ${MK_DEBUG_FILES} != "no" + ${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.debug.dist \ + -p ${WORLDTMP}/usr/lib >/dev/null +.endif +.for _mtree in ${LOCAL_MTREE} + ${WORLDTMP_MTREE} -f ${.CURDIR}/${_mtree} -p ${WORLDTMP} > /dev/null +.endfor _cleanobj: .if !defined(NO_CLEAN) @echo Modified: head/tools/build/Makefile ============================================================================== --- head/tools/build/Makefile Mon Aug 20 10:39:48 2018 (r338097) +++ head/tools/build/Makefile Mon Aug 20 10:39:53 2018 (r338098) @@ -59,4 +59,17 @@ SUBDIR= cross-build # Needed to build config (since it uses libnv) SYSINCS+= ${SRCTOP}/sys/sys/nv.h ${SRCTOP}/sys/sys/cnv.h + +# Create all the directories that are needed during the legacy, bootstrap-tools +# and cross-tools stages. We do this here using mkdir since mtree may not exist +# yet (this happens if we are crossbuilding from Linux/Mac). +installdirs: +.for _dir in bin sbin usr/bin usr/sbin usr/lib usr/include lib/geom lib/casper + mkdir -p "${DESTDIR}/${_dir}" +.endfor + +.for _group in ${INCSGROUPS:NINCS} + mkdir -p "${DESTDIR}/${${_group}DIR}" +.endfor + .include