https://people.freebsd.org/~brd/patches/users-r.diff
I worked on this patch with Bapt to support cross installs when doing Crochet builds. It works for my testing with pkg installing users/groups for isc-dhcpd in crochet for ARM images.
+.if ${OSVERSION} < 1002000 does pw -R work or not on dragonfly?
No it does not
(In reply to Baptiste Daroussin from comment #3) So the patch has to be adjusted for this (something like .if ${OPSYS} != FreeBSD || ${OSVERSION} < 1002000 )
Created attachment 162041 [details] patch Updated patch to support DFly
Exp-run results on 10.1 i386: http://pb2.nyi.freebsd.org/jail.html?mastername=101i386-default-PR203489 Exp-run results on 10.2 i386: http://package18.nyi.freebsd.org/jail.html?mastername=102i386-default-PR203489 No new failures, looks fine.
A commit references this bug: Author: brd Date: Thu Oct 22 16:25:52 UTC 2015 New revision: 399992 URL: https://svnweb.freebsd.org/changeset/ports/399992 Log: Teach the ports framework to handle creating users/groups when PKG_ROOTDIR is set. This will enable help support pkg cross installs. PR: 203489 Reviewed by: bapt Approved by: portmgr (bapt) Approved by: bdrewery (mentor) Changes: head/Mk/bsd.port.mk
A commit references this bug: Author: brd Date: Thu Oct 29 15:30:36 UTC 2015 New revision: 400469 URL: https://svnweb.freebsd.org/changeset/ports/400469 Log: Fix a bug introduced in r399992, where creating only a user would fail due to $PW not being set. This only occurred when just a user was being created without a group. Solve this by setting $PW outside of the group creation and above both the user and group creation parts. PR: 203489 Reviewed by: bapt Approved by: portmgr (bapt) Approved by: bdrewery (mentor) Changes: head/Mk/bsd.port.mk