From owner-freebsd-current@FreeBSD.ORG Wed Jan 2 03:11:46 2013 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0762A3C1; Wed, 2 Jan 2013 03:11:46 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-oa0-f43.google.com (mail-oa0-f43.google.com [209.85.219.43]) by mx1.freebsd.org (Postfix) with ESMTP id ADDFE8FC0C; Wed, 2 Jan 2013 03:11:45 +0000 (UTC) Received: by mail-oa0-f43.google.com with SMTP id k1so12594012oag.2 for ; Tue, 01 Jan 2013 19:11:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=TrQ+mgGSjQFWnGKokQX8zlOaDbrjpCUPqaUWhvOhAtw=; b=TIE0hJNziDW3JW8gtZRUWf8F6YXthZZxUmvCXJjBuOQed0CLvg9rtMkmsz8+bk7aJ2 ARfDkCywRNgHrl6sTNLZ6/gJ/17fu9KJQ7rvih0fsycGQafgv5oSN378aHBQrdJnx8zZ EeOtnR3RsuhzynCgP6mnQyKdt7x+CCuJ6Y94XGMfs1nPcr4n0vXZ9VgKqR1nOl+ZvPwU TrtiVX5NPXvtweGf4ID1uVFPmSqdgS72+0jU+iEm9Vslo2/OsCv3qyC4BazOnExjxCN1 NKKm9sF4I+Ng1hnAP0lx5EQcdr9f9GCrV24i/WhPFPH7nWMdTOUk3qE5obGrNzUMOdYE CmvA== MIME-Version: 1.0 Received: by 10.182.172.74 with SMTP id ba10mr37090315obc.83.1357096298924; Tue, 01 Jan 2013 19:11:38 -0800 (PST) Received: by 10.76.143.33 with HTTP; Tue, 1 Jan 2013 19:11:38 -0800 (PST) In-Reply-To: <20121221210237.GA47912@lor.one-eyed-alien.net> References: <20121221210237.GA47912@lor.one-eyed-alien.net> Date: Tue, 1 Jan 2013 19:11:38 -0800 Message-ID: Subject: Re: NetBSD mtree committed From: Garrett Cooper To: Brooks Davis Content-Type: text/plain; charset=ISO-8859-1 Cc: current@freebsd.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 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: Wed, 02 Jan 2013 03:11:46 -0000 On Fri, Dec 21, 2012 at 1:02 PM, Brooks Davis wrote: > I have committed NetBSD's mtree to the tree and am building and > installing it as nmtree. I plan to replace our mtree with this version > after the following steps: > > - Add a WITH_NMTREE build option to install nmtree as mtree and the > old mtree as omtree. > - Switch the default to WITH_NMTREE. > - Remove the old mtree. > - Rename usr.sbin/nmtree to usr.sbin/mtree. > > During this process I will also commit patches to switch makefs > to use NetBSD's mtree which will make the -F specfile option more > useful. > > As a reminder we are doing this because, we will gain the -C option > which produces mtree files compatible with libarchive and makefs (one > line per file with full path) and the -N option which allows a stand > alone set of passwd and group files. When mated with the -U and -M > options to NetBSD's install we will have most of the pieces require to > allow installworld to run as a user and then build images containing > proper permissions. > > The new mtree does introduce some incompatibilities, but nearly all can > be overcome with small command line changes. With one exception, > FreeBSD 9 compatible behavior can be restored by adding the "-F > freebsd9" to the command line. In some cases new warnings are > generate to aid transition, but the output should otherwise be the same. > If you find cases where it is not, please let me know. > > Known incompatibilities are: > > - The -u and -U (update) options do not update the modification time or > set file flags unless the -t and -i options are passed respectively. > - Because the -i option as already take, FreeBSD's option to indent > 4 spaces for each directory level is now -j. > - The -d (directories only) option does not omit blank lines when > entering a new directory or leaving one. The -b option now enables > this behavior independently. > - The handling of the uname and group keywords when the uid or gid can > not be resolved is changed. In the new code, when the uname or group > keyword is request and the name can not be found a uid or gid keyword > is emitted instead. Historically, mtree would report and error and > exit unless the -w option was passed. If that happened then a > warning was printed and no keyword was emitted. That resulted in > potentially dangerous /set statements. As a result I declined to > implement this behavior. > > Here is an example of the dangerous \set statements: > > $ ls -l > total 0 > -rwxr-xr-x 1 root wheel 0 Dec 21 14:13 a > -rwsr-xr-x 1 12345 wheel 0 Dec 21 14:13 b > $ mtree -c -p . -n -k uname,mode -w > ../mtree.out > mtree: Could not get uname for uid=12345 > $ cat ../mtree.out > > /set type=file uname=root mode=0755 > . type=dir uname=brooks > a > b mode=04755 > .. > > $ mtree -f ../mtree.out -u -p . > b: user (0, 12345, modified) > $ ll > total 0 > -rwxr-xr-x 1 root wheel 0 Dec 21 14:13 a > -rwsr-xr-x 1 root wheel 0 Dec 21 14:13 b > $ > > I have heard some requests to MFC the new mtree code. At this time I > have no concrete plans to do so. If it were done then I would modify > the code to run with -F freebsd9 and would implement full uname/group > compatibility. Ran into this linker error when running make installworld going from 10-CURRENT from a month ago to now: /tmp/install.9ten1vtn/mtree: Undefined symbol "strunvis" *** Error code 1 And I'm running into similar issues with mergemaster. Is this a known chicken and egg problem? Thanks, -Garrett