From owner-svn-src-head@FreeBSD.ORG Thu Apr 24 02:02:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B17CB420; Thu, 24 Apr 2014 02:02:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9EC08149F; Thu, 24 Apr 2014 02:02:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3O22Kp5064061; Thu, 24 Apr 2014 02:02:20 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3O22KNH064060; Thu, 24 Apr 2014 02:02:20 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404240202.s3O22KNH064060@svn.freebsd.org> From: Warner Losh Date: Thu, 24 Apr 2014 02:02:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264858 - head/tools/tools/nanobsd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2014 02:02:20 -0000 Author: imp Date: Thu Apr 24 02:02:20 2014 New Revision: 264858 URL: http://svnweb.freebsd.org/changeset/base/264858 Log: Introduce NANO_PKG_META_BASE to allow moving where metadata for packages is stored. Sponsored by: Netflix Modified: head/tools/tools/nanobsd/nanobsd.sh Modified: head/tools/tools/nanobsd/nanobsd.sh ============================================================================== --- head/tools/tools/nanobsd/nanobsd.sh Thu Apr 24 02:02:11 2014 (r264857) +++ head/tools/tools/nanobsd/nanobsd.sh Thu Apr 24 02:02:20 2014 (r264858) @@ -49,6 +49,9 @@ NANO_TOOLS=tools/tools/nanobsd NANO_PACKAGE_DIR=${NANO_SRC}/${NANO_TOOLS}/Pkg NANO_PACKAGE_LIST="*" +# where package metadata gets placed +NANO_PKG_META_BASE=/var/db + # Object tree directory # default is subdir of /usr/obj #NANO_OBJ="" @@ -719,7 +722,7 @@ cust_pkg () ( fi # Copy packages into chroot - mkdir -p ${NANO_WORLDDIR}/Pkg + mkdir -p ${NANO_WORLDDIR}/Pkg ${NANO_WORLDDIR}/${NANO_PKG_META_BASE}/pkg ( cd ${NANO_PACKAGE_DIR} find ${NANO_PACKAGE_LIST} -print | @@ -734,18 +737,18 @@ cust_pkg () ( while true do # Record how many we have now - have=`ls ${NANO_WORLDDIR}/var/db/pkg | wc -l` + have=`ls ${NANO_WORLDDIR}/${NANO_PKG_META_BASE}/pkg | wc -l` # Attempt to install more packages # ...but no more than 200 at a time due to pkg_add's internal # limitations. chroot ${NANO_WORLDDIR} sh -c \ - 'ls Pkg/*tbz | xargs -n 200 pkg_add -F' || true + 'ls Pkg/*tbz | xargs -n 200 env PKG_DBDIR='${NANO_PKG_META_BASE}'/pkg pkg_add -v -F' || true # See what that got us - now=`ls ${NANO_WORLDDIR}/var/db/pkg | wc -l` + now=`ls ${NANO_WORLDDIR}/${NANO_PKG_META_BASE}/pkg | wc -l` echo "=== NOW $now" - ls ${NANO_WORLDDIR}/var/db/pkg + ls ${NANO_WORLDDIR}/${NANO_PKG_META_BASE}/pkg echo "==="