Page MenuHomeFreeBSD

pw: Add a metalog output mode
ClosedPublic

Authored by markj on Tue, Sep 16, 11:29 PM.
Tags
None
Referenced Files
F131608538: D52590.id162213.diff
Thu, Oct 9, 5:15 PM
F131608530: D52590.id.diff
Thu, Oct 9, 5:15 PM
F131608529: D52590.id162348.diff
Thu, Oct 9, 5:15 PM
F131608526: D52590.diff
Thu, Oct 9, 5:15 PM
Unknown Object (File)
Fri, Oct 3, 7:58 PM
Unknown Object (File)
Tue, Sep 30, 8:13 AM
Unknown Object (File)
Sat, Sep 27, 7:02 PM
Unknown Object (File)
Fri, Sep 26, 9:27 PM
Subscribers

Details

Summary

When creating OS images as a non-root user, it may be useful to
pre-create users in the staged tree. The useradd operation adds files
to the new user's home directory, copied from the skeleton directory
(/usr/share/skel), which makes it inconvient for use in this scenario.

To cover this gap, this change adds a new -M <metalog> option to pw's
useradd operation, causing pw to add mtree entries for newly added
files.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

emaste added inline comments.
usr.sbin/pw/pw.c
259–260

maybe worth doing this bugfix separately so we can MFC it in advance of other changes here?

usr.sbin/pw/pw_utils.c
97

This _ convention seems a bit unusual

This revision is now accepted and ready to land.Thu, Sep 18, 2:10 AM
bapt added inline comments.
usr.sbin/pw/pw_utils.c
124

I wonder if it won't be smart to move the metalog_emit to libutil later so it can be used by other tools

markj added inline comments.
usr.sbin/pw/pw_utils.c
97

Ok, I will rename it to metalog_emit_record().

116

I'm not handling file flags here. I don't think pw sets any, but we should handle that anyway.

124

Maybe, yeah. It's a fairly simple routine though, and different consumers have different requirements (e.g., uname/gname vs. uid/gid, some consumers want to flock the metalog, ...).

This revision was automatically updated to reflect the committed changes.
markj marked an inline comment as done.