Page MenuHomeFreeBSD

D35588.diff
No OneTemporary

D35588.diff

diff --git a/usr.sbin/bsdinstall/bsdinstall.8 b/usr.sbin/bsdinstall/bsdinstall.8
--- a/usr.sbin/bsdinstall/bsdinstall.8
+++ b/usr.sbin/bsdinstall/bsdinstall.8
@@ -343,6 +343,15 @@
If this directory does not already exist, it will be created.
Default:
.Dq Pa $TMPDIR/bsdinstall_boot
+.It Ev ROOTPASS_ENC
+Encrypted string to set the root password to in the format expected by
+.Xr pw 8
+.Fl H Ar 0 .
+This option is used if both it and
+.Ev ROOTPASS_PLAIN
+are set.
+.It Ev ROOTPASS_PLAIN
+Plain text string to set the root password to.
.It Ev ZFSBOOT_POOL_NAME
Name for the pool containing the base system.
Default:
diff --git a/usr.sbin/bsdinstall/scripts/rootpass b/usr.sbin/bsdinstall/scripts/rootpass
--- a/usr.sbin/bsdinstall/scripts/rootpass
+++ b/usr.sbin/bsdinstall/scripts/rootpass
@@ -33,7 +33,13 @@
echo "========================"
echo
-echo "Please select a password for the system management account (root):"
-echo "Typed characters will not be visible."
+if [ -n "$ROOTPASS_ENC" ]; then
+ printf '%s\n' "$ROOTPASS_ENC" | pw -R $BSDINSTALL_CHROOT usermod root -H 0
+elif [ -n "$ROOTPASS_PLAIN" ]; then
+ printf '%s\n' "$ROOTPASS_PLAIN" | pw -R $BSDINSTALL_CHROOT usermod root -h 0
+else
+ echo "Please select a password for the system management account (root):"
+ echo "Typed characters will not be visible."
-chroot $BSDINSTALL_CHROOT passwd root 2>&1
+ chroot $BSDINSTALL_CHROOT passwd root 2>&1
+fi

File Metadata

Mime Type
text/plain
Expires
Sat, Feb 8, 1:46 PM (20 h, 34 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16527195
Default Alt Text
D35588.diff (1 KB)

Event Timeline