From owner-freebsd-small@FreeBSD.ORG Fri Apr 20 12:45:13 2007 Return-Path: X-Original-To: freebsd-small@freebsd.org Delivered-To: freebsd-small@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E9E7116A404 for ; Fri, 20 Apr 2007 12:45:13 +0000 (UTC) (envelope-from eugen@www.svzserv.kemerovo.su) Received: from www.svzserv.kemerovo.su (www.svzserv.kemerovo.su [213.184.65.80]) by mx1.freebsd.org (Postfix) with ESMTP id 4CEC113C4BB for ; Fri, 20 Apr 2007 12:45:12 +0000 (UTC) (envelope-from eugen@www.svzserv.kemerovo.su) Received: from www.svzserv.kemerovo.su (eugen@localhost [127.0.0.1]) by www.svzserv.kemerovo.su (8.13.8/8.13.8) with ESMTP id l3KC9rZr028909; Fri, 20 Apr 2007 20:09:53 +0800 (KRAST) (envelope-from eugen@www.svzserv.kemerovo.su) Received: (from eugen@localhost) by www.svzserv.kemerovo.su (8.13.8/8.13.8/Submit) id l3KC9qp5028907; Fri, 20 Apr 2007 20:09:52 +0800 (KRAST) (envelope-from eugen) Date: Fri, 20 Apr 2007 20:09:52 +0800 From: Eugene Grosbein To: Jordan Coleman Message-ID: <20070420120952.GA28426@svzserv.kemerovo.su> References: <14320DBA-7A3B-4CA6-BC60-D2BF8EA77C71@JordanColeman.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <14320DBA-7A3B-4CA6-BC60-D2BF8EA77C71@JordanColeman.com> User-Agent: Mutt/1.4.2.1i Cc: freebsd-small@freebsd.org Subject: Re: Building NanoBSD with ports and packages X-BeenThere: freebsd-small@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Apr 2007 12:45:14 -0000 On Fri, Apr 20, 2007 at 06:07:50AM -0400, Jordan Coleman wrote: > Can anyone suggest a way to pre-install ports in a NanoBSD system at > build time? Ideally, I'd like to be able to add a customize_cmd to > my NanoBSD configuration file so that the finished disk images can be > made to include anything in ports. > > Suggestions? Just add to your nanobsd.conf: NANO_CUSTOMIZE="/path/to/localfiles" Place packages to /path/to/Pkg subdirectory. Here comes the script "localfiles": #!/bin/sh -e # save pointer to packages, there should be $src/Pkg directory # with packages ready to install src=$(dirname `realpath $0`) pkgs="$src/Pkg" # go to Nano world cd "$NANO_WORLDDIR" # start from the beginning dirs="usr/local tmp/Pkg var/db/pkg" rm -rf $dirs mkdir $dirs trap "umount $pkgs" SIGHUP SIGINT SIGTERM mount_nullfs -o ro "$pkgs" tmp/Pkg chroot "$NANO_WORLDDIR" sh -c "cd /tmp/Pkg && pkg_add -vF *" umount "$pkgs" rmdir tmp/Pkg