From 03ac71f0b1b8f27e6c133b2c076538496dd1c5de Mon Sep 17 00:00:00 2001 From: gjb Date: Mon, 8 Jun 2015 15:08:09 +0000 Subject: MFC r283894, r283895, r283913, r284004, r284010: r283894 [1]: Disable arm_create_user(). r283895 [1]: Re-enable arm_create_user(), and pass the '-V DESTDIR/etc' to pw(8) to set the correct /etc directory for the user/group files. r283913: Pass the '-b' argument to pw(8) so the '/home' directory is created in the correct place. r284004: Make sure /home exists within the DESTDIR before creating the 'freebsd' user account. r284010 [2]: Work around a potential bug in pw(8) when '-m' is specified. [1] For recording merge history only. [2] This commit post-dates the pw(8) '-R' addition in head/, which is needed for conflict resolution from r284004. Sponsored by: The FreeBSD Foundation --- release/tools/arm.subr | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'release/tools') diff --git a/release/tools/arm.subr b/release/tools/arm.subr index 5cc61e3..628a8be 100644 --- a/release/tools/arm.subr +++ b/release/tools/arm.subr @@ -80,11 +80,16 @@ arm_create_disk() { arm_create_user() { # Create a default user account 'freebsd' with the password 'freebsd', # and set the default password for the 'root' user to 'root'. - chroot ${CHROOTDIR} /usr/sbin/pw groupadd freebsd -g 1001 - chroot ${CHROOTDIR} /usr/sbin/pw useradd freebsd \ + chroot ${CHROOTDIR} /usr/sbin/pw -V ${DESTDIR}/etc \ + groupadd freebsd -g 1001 + chroot ${CHROOTDIR} mkdir -p ${DESTDIR}/home/freebsd + chroot ${CHROOTDIR} /usr/sbin/pw -V ${DESTDIR}/etc \ + useradd freebsd \ -m -M 0755 -w yes -n freebsd -u 1001 -g 1001 -G 0 \ - -c 'FreeBSD User' -d '/home/freebsd' -s '/bin/csh' - chroot ${CHROOTDIR} /usr/sbin/pw usermod root -w yes + -c 'FreeBSD User' -d '/home/freebsd' -s '/bin/csh' \ + -b "${DESTDIR}/home" + chroot ${CHROOTDIR} /usr/sbin/pw -V ${DESTDIR}/etc \ + usermod root -w yes return 0 } -- cgit v1.1