From owner-freebsd-arch@FreeBSD.ORG Mon Jul 2 14:46:05 2012 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 69F38106566B; Mon, 2 Jul 2012 14:46:05 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (lor.one-eyed-alien.net [69.66.77.232]) by mx1.freebsd.org (Postfix) with ESMTP id 0F85E8FC18; Mon, 2 Jul 2012 14:46:03 +0000 (UTC) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.4/8.14.4) with ESMTP id q62EYIGp074767; Mon, 2 Jul 2012 09:34:19 -0500 (CDT) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.4/8.14.4/Submit) id q62EYICH074766; Mon, 2 Jul 2012 09:34:18 -0500 (CDT) (envelope-from brooks) Date: Mon, 2 Jul 2012 09:34:18 -0500 From: Brooks Davis To: Marcel Moolenaar Message-ID: <20120702143418.GA74604@lor.one-eyed-alien.net> References: <20120626063017.D05DA58081@chaos.jnpr.net> <86wr2uwdgf.fsf@ds4.des.no> <20120626161605.5082A58081@chaos.jnpr.net> <20120627235945.GE243@lor.one-eyed-alien.net> <9BB38D52-3CB9-44CE-B1BD-85DFAD6A1176@xcllnt.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="pWyiEgJYm5f9v55/" Content-Disposition: inline In-Reply-To: <9BB38D52-3CB9-44CE-B1BD-85DFAD6A1176@xcllnt.net> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Tim Kientzle , freebsd-arch@freebsd.org, Brooks Davis , Dag-Erling Sm?rgrav , "Simon J. Gerraty" Subject: Re: Allow user install X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jul 2012 14:46:05 -0000 --pWyiEgJYm5f9v55/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jul 01, 2012 at 02:12:07PM -0700, Marcel Moolenaar wrote: >=20 > On Jun 27, 2012, at 4:59 PM, Brooks Davis wrote: >=20 > > On Tue, Jun 26, 2012 at 09:16:05AM -0700, Simon J. Gerraty wrote: > >>=20 > >> On Tue, 26 Jun 2012 08:18:05 -0700, Tim Kientzle writes: > >>> Better idea: have the build write a textual description of the > >>> tar entries. That description can then be fed to tar to build > >>> the actual tarball. > >>=20 > >> Yes, that's what we do - manifest files that tar and other tools use to > >> produce the install images. > >>=20 > >>> The description format that tar already supports is a variant > >>> mtree format borrowed from NetBSD. Each line specifies > >>> the tar entry fields (filename, owner, permissions, etc) and > >>> the filename where the file contents are stored. > >>=20 > >> Yes, we've added that support to makefs - I believe it is already in > >> -current. There's still quite a bit to do. > >=20 > > It's there except that makefs uses the FreeBSD mtree code which doesn't > > support the crucial absolute path support in NetBSD's mtree. >=20 > ? >=20 > I wrote the code and no, it doesn't use FreeBSD mtree code and yes, > it supports absolute pathnames: >=20 > : > cp =3D strchr(pathspec, '/'); =20 > if (cp !=3D NULL) { > /* Absolute pathname */ > mtree_current =3D mtree_root; > =20 > : >=20 > The code should be compatible with libarchive. > Maybe there's a bug? On the first point, two files are used from ../mtree: $ ident makefs | grep mtree $FreeBSD: head/usr.sbin/makefs/mtree.c 223306 2011-06-19 18:34:49Z mar= cel $ $FreeBSD: head/usr.sbin/mtree/misc.c 160083 2006-07-03 10:55:22Z maxim= $ $FreeBSD: head/usr.sbin/mtree/spec.c 229403 2012-01-03 18:51:58Z ed $ Here's the failure: $ mkdir foo $ touch foo/bar $ cd foo $ tar cf ../foo.mtree --format mtree --options mtree:use-set . $ cd .. $ cat foo.mtree #mtree /set type=3Dfile uname=3Dbrooks uid=3D1001 gname=3Dbrooks gid=3D1001 mode= =3D644 =2E time=3D1341239212.0 mode=3D755 type=3Ddir =2E/bar time=3D1341239166.0 size=3D0 =2E/ormat time=3D1341239212.0 size=3D2048 $ makefs -s 1m -F foo.mtree foo.img foo makefs: line 4: slash character in file name and the source of the failure. $ grep "slash character in file name" /usr/src/usr.sbin/mtree/* /usr/src/usr.sbin/mtree/spec.c: errx(1, "line %d: slash character in file= name", -- Brooks --pWyiEgJYm5f9v55/ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iD8DBQFP8bFpXY6L6fI4GtQRAtgbAJ0SH8spjZCx26KrQZoQNDFp/7HtDwCgklHm zC01r8uz/OyKrf/3ynqpiuA= =RJV4 -----END PGP SIGNATURE----- --pWyiEgJYm5f9v55/--