From owner-freebsd-current@FreeBSD.ORG Fri Nov 4 04:31:17 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EFA2E1065670 for ; Fri, 4 Nov 2011 04:31:17 +0000 (UTC) (envelope-from doconnor@gsoft.com.au) Received: from cain.gsoft.com.au (cain.gsoft.com.au [203.31.81.10]) by mx1.freebsd.org (Postfix) with ESMTP id 589298FC08 for ; Fri, 4 Nov 2011 04:31:16 +0000 (UTC) Received: from ur.gsoft.com.au (Ur.gsoft.com.au [203.31.81.44]) (authenticated bits=0) by cain.gsoft.com.au (8.14.4/8.14.3) with ESMTP id pA44V7Kx005231 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Fri, 4 Nov 2011 15:01:12 +1030 (CST) (envelope-from doconnor@gsoft.com.au) Mime-Version: 1.0 (Apple Message framework v1251.1) Content-Type: text/plain; charset=iso-8859-1 From: "Daniel O'Connor" In-Reply-To: Date: Fri, 4 Nov 2011 15:01:07 +1030 Content-Transfer-Encoding: quoted-printable Message-Id: <0DBBB027-DB51-4245-8DC5-EC5F98D66777@gsoft.com.au> References: To: Alexander Yerenkow X-Mailer: Apple Mail (2.1251.1) X-Spam-Score: -4.523 () ALL_TRUSTED,BAYES_00,RP_MATCHES_RCVD X-Scanned-By: MIMEDefang 2.67 on 203.31.81.10 Cc: Warren Block , freebsd-current@freebsd.org Subject: Re: VM images for FreeBSD X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Nov 2011 04:31:18 -0000 On 19/10/2011, at 21:19, Alexander Yerenkow wrote: > I can't specify to pkg_add that it should treat /zpool0/testroot as = root, as > I need (so record really should be @cwd /usr/local) > Instead, pkg_add allows me to make chroot, which as you understand is = not > good (In specified chroot all required by pkg* binaries/libraries must > exists, unfortunately I can't specify some empty dir and install = there). Hmmm, why is it empty? When I have made something analogous I did an installkernel/world into a = directory and then chroot'd in there and built ports. There is no reason = you couldn't pkg_add from a local mirror (or nullfs mount a local = package mirror directory into the chroot). > Why is that? Because there is +INSTALL script in packages, in which > package/port system allows execute any code/script written by porter. This is a feature ;) > To summarize my efforts: > I checked 21195 packages; > I found 880 install scripts; >=20 > 3 scripts contains plain "exit 0" > 8 install scripts contains some perl code; > 17 scripts contains some additional "install" commands; > 70 scripts contains some chgroup/chown actions (which probably could = be done > by specifying mtree file?...) > 75 contains uncategorized actions (print of license, some interactive > questions, ghostscript actions, tex, fonts etc.) > 161 scripts contains some file commands, like (ld / cp / mv, creating > backups, creating configs if they aren't exists etc. ) > 166 scripts contains useradd/groupadd commands (many similar = constructions, > not too hard to move this to .mk, in pkgng group/users can be = specified in > yaml config) > 380 contains pear component registration (md5 -q * | uniq - produces > exactly one result, so these all scripts are really one, could be = moved to > some pear.mk) Interesting stats, thanks for taking the time to do the analysis. I think one of the reasons pkg_add is so slow is that it copies = everything to a staging directory, then copies the files.. This is very = tedious (obviously). I wonder if it could be modified to have a "stream" = mode where it unpacks directly into the target FS. Alternatively you could cut it in 2 conceptually and modify pkg_add so = it can run it a mode where it just unpacks to a staging area, and = another mode where it copies from the staging area to the destination. -- Daniel O'Connor software and network engineer for Genesis Software - http://www.gsoft.com.au "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C