This is an old revision of the document!
Importing NetBSD mtree(8)
FreeBSD and NetBSD have developed mtree(8) separately for quite some time. NetBSD's mtree has a number of useful features that would be useful to our installation process. Specifically NetBSD's mtree supports full paths to file system objects rather than implying them from a prior series of directory names and ..'s. This syntax is understood by libarchive and thus bsdtar as well as makefs to allow file systems to be generated from collections of files that were installed with permissions settable by ordinary users. With the addition of NetBSD's install these can be generated during the installworld process and then applied to an image, all without root permissions.
Missing FreeBSD features in NetBSD mtree
The following features have been implemented in FreeBSD's mtree. They most likley need to be added to NetBSD's mtree before it can be imported:
| Option or Field | Description | Notes |
|---|---|---|
-i | Indent the output 4 spaces each time a directory level is descended when creating a specification with the -c option. | Mostly useless and conflicts with the NetBSD option to “set the schg and/or sappnd flags.” |
-n | Don't emit name | |
-q | Quiet mode | |
-w | Make some errors non-fatal warnings | |
ripemd160digest | The RIPEMD160 message digest of the file | seems to be spelled rmd160(digest) |
nochange | Make sure this file or directory exists but otherwise ignore all attributes. |
Missing FreeBSD library functions
| Funcation | Description | Notes |
|---|---|---|
| flags_to_string() | Trivial wrapper around fflagstostr() | In util.h in NetBSD. Probably just add to libc/unistd.h |
| string_to_flags() | Identical to strtofflags() | same issues as flags_to_string |
| strsvis() | Allow encoding other character sets | probably just pull the vis.3 set from NetBSD |
| pwcache_userdb() | allow alternative lookups for user_from_uid/uid_from_user | Grab the lot from NetBSD |
| uid_from_user() | reverse of user_from_uid | |
| pwcache_groupdb() | allow alternative lookups for group_from_gid/gid_from_user | |
| gid_from_group() | reverse of group_from_gid() |