Re: NetBSD mtree committed

From: Garrett Cooper <yanegomi_at_gmail.com>
Date: Tue, 1 Jan 2013 19:11:38 -0800
On Fri, Dec 21, 2012 at 1:02 PM, Brooks Davis <brooks_at_freebsd.org> 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
Received on Wed Jan 02 2013 - 02:11:46 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:33 UTC