From owner-freebsd-hackers@FreeBSD.ORG Sun Jul 15 03:21:49 2007 Return-Path: X-Original-To: hackers@freebsd.org Delivered-To: freebsd-hackers@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 55C1616A401; Sun, 15 Jul 2007 03:21:49 +0000 (UTC) (envelope-from kientzle@freebsd.org) Received: from kientzle.com (h-66-166-149-50.snvacaid.covad.net [66.166.149.50]) by mx1.freebsd.org (Postfix) with ESMTP id 11F3313C461; Sun, 15 Jul 2007 03:21:48 +0000 (UTC) (envelope-from kientzle@freebsd.org) Received: from [10.0.0.222] (p54.kientzle.com [66.166.149.54]) by kientzle.com (8.12.9/8.12.9) with ESMTP id l6F3LkH7004767; Sat, 14 Jul 2007 20:21:46 -0700 (PDT) (envelope-from kientzle@freebsd.org) Message-ID: <469992CA.6000104@freebsd.org> Date: Sat, 14 Jul 2007 20:21:46 -0700 From: Tim Kientzle User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.12) Gecko/20060422 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Joerg Sonnenberger References: <46992FFF.7010906@kientzle.com> <20070714223853.GF16579@britannica.bec.de> In-Reply-To: <20070714223853.GF16579@britannica.bec.de> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org, hackers@freebsd.org Subject: Re: Tar output mode for installworld X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jul 2007 03:21:49 -0000 Joerg Sonnenberger wrote: > On Sat, Jul 14, 2007 at 01:20:15PM -0700, Tim Kientzle wrote: > >>This is easy to implement using a trick that I stumbled >>across a few years ago. The idea is to just build >>a description of the final archive in a nice verbose >>text format such as: > > ...which is done by NetBSD for the unprivileged release building via > build.sh. Anyone interested in working on this should possibly have a > look there. Interesting. I hadn't looked at NetBSD's unprivileged release build before. I just skimmed through some of it. Parts of it seems a little roundabout, but I like the use of a modified mtree format as the specification format: usr/bin/su type=file mode=04555 uname=root gname=wheel time=1057493599.102665 I would make two changes: 1) Add a contents= option. With this, DESTDIR is mostly irrelevant, since the path can just refer to the file in the build tree. 2) Allow multiple lines for any file. This complicates the consumer of this file a bit, but simplifies the build process, since you can emit separate information as you find it. For example, the regular install process could install rcp by emitting: bin/rcp type=file mode=04555 contents=/usr/obj/usr/src/bin/rcp and then a later point in the build process could add the flag by adding the line: bin/rcp flags=schg Hmmm... It would be easy for libarchive to parse this format and then bsdtar's existing "archive conversion" feature could trivially generate a tar.gz output from such a specification. Another idea would be to create an install program that accepted this format as the command line: mtree_install usr/bin/su type=file mode=04555 uname=root ... Then the build logic gets scary simple: A regular build sets INSTALL=mtree_install, a tar.gz build sets INSTALL=echo. (Hmmm... Maybe a tad more complex than this, but close.) (You could also modify the specification file so that the file specs mimicked 'install' options.) Tim Kientzle