Date: Sat, 14 Jul 2007 20:21:46 -0700 From: Tim Kientzle <kientzle@freebsd.org> To: Joerg Sonnenberger <joerg@britannica.bec.de> Cc: freebsd-hackers@freebsd.org, hackers@freebsd.org Subject: Re: Tar output mode for installworld Message-ID: <469992CA.6000104@freebsd.org> In-Reply-To: <20070714223853.GF16579@britannica.bec.de> References: <46992FFF.7010906@kientzle.com> <20070714223853.GF16579@britannica.bec.de>
next in thread | previous in thread | raw e-mail | index | archive | help
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=<path> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?469992CA.6000104>