From owner-svn-src-all@freebsd.org Tue Dec 22 06:36:02 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33EECA4C429; Tue, 22 Dec 2015 06:36:02 +0000 (UTC) (envelope-from imp@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 mx1.freebsd.org (Postfix) with ESMTPS id DF5BA19F6; Tue, 22 Dec 2015 06:36:01 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBM6a1fp074197; Tue, 22 Dec 2015 06:36:01 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBM6a1Tj074196; Tue, 22 Dec 2015 06:36:01 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201512220636.tBM6a1Tj074196@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 22 Dec 2015 06:36:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292586 - head/tools/tools/nanobsd/embedded X-SVN-Group: head 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.20 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: Tue, 22 Dec 2015 06:36:02 -0000 Author: imp Date: Tue Dec 22 06:36:00 2015 New Revision: 292586 URL: https://svnweb.freebsd.org/changeset/base/292586 Log: For embedded platforms that require it, use mtools to copy the appropriate u-boot port's files into the fat part. Modified: head/tools/tools/nanobsd/embedded/common Modified: head/tools/tools/nanobsd/embedded/common ============================================================================== --- head/tools/tools/nanobsd/embedded/common Tue Dec 22 05:57:23 2015 (r292585) +++ head/tools/tools/nanobsd/embedded/common Tue Dec 22 06:36:00 2015 (r292586) @@ -86,7 +86,7 @@ NANO_CFG_BASE=$(pwd) NANO_CFG_BASE=$(realpath ${NANO_CFG_BASE}/..) NANO_SRC=$(realpath ${NANO_CFG_BASE}/../../..) #### XXX share obj -NANO_OBJ=$(realpath ${NANO_SRC}/../$NANO_NAME/obj || echo ${NANO_SRC}/../$NANO_NAME/obj) +NANO_OBJ=${NANO_SRC}/../$NANO_NAME/obj # Where cust_pkg() finds packages to install #XXX: Is this the right place? #NANO_PORTS=$(realpath ${NANO_SRC}/../ports) @@ -100,6 +100,9 @@ unset MAKEOBJDIRPREFIX NANO_PORTS=${NANO_PORTS:-/usr/ports} mkdir -p ${NANO_OBJ} +NANO_OBJ=$(realpath ${NANO_OBJ}) + +NANO_FAT_DIR=${NANO_OBJ}/_.fat customize_cmd cust_allow_ssh_root @@ -301,8 +304,11 @@ create_diskimage_mbr ( ) ( echo Creating MSDOS partition for kernel newfs_msdos -C ${NANO_SLICE_FAT_SIZE} -F 16 -L ${NANO_NAME} \ ${NANO_OBJ}/_.${NANO_SLICE_FAT} - # Need to copy files from ${NANO_FATDIR} with mtools, or use - # makefs -t msdos once that's supported + if [ -d ${NANO_FAT_DIR} ]; then + # Need to copy files from ${NANO_FATDIR} with mtools, or use + # makefs -t msdos once that's supported + mcopy -i ${NANO_OBJ}/_.${NANO_SLICE_FAT} ${NANO_FAT_DIR}/* :: + fi fi # Populate the Powerpc boot image, if needed @@ -440,7 +446,7 @@ save_build ( ) } customize_cmd save_build -shrink_md_fbsize() +shrink_md_fbsize ( ) { # We have a lot of little files on our memory disks. Let's decrease # the block and frag size to fit more little files on them (this @@ -454,8 +460,28 @@ customize_cmd shrink_md_fbsize customize_cmd cust_comconsole -product_custom() -{ +dos_boot_part ( ) +( + local d=/usr/local/share/u-boot/${NANO_BOOT_PKG} + + mkdir ${NANO_FAT_DIR} + cp ${d}/* ${NANO_FAT_DIR} +) + +if [ -n "$NANO_BOOT_PKG" ]; then + if [ ! -d ${d} ]; then + echo ${NANO_BOOT_PKG} not installed. Sadly, it must be. + exit 1 + fi + if [ ! -x /usr/local/bin/mcopy ]; then + echo mtools not installed. Sadly, we gotta have it. + exit 1 + fi + customize_cmd dos_boot_part +fi + +product_custom ( ) +( # not quie ready to tweak these in nopriv build if [ -z ${NANO_NOPRIV_BUILD} ]; then # Last second tweaks -- generally not needed @@ -467,7 +493,7 @@ product_custom() chown root:wheel ${NANO_WORLDDIR}/ chown root:wheel ${NANO_WORLDDIR}/usr fi -} +) late_customize_cmd product_custom #