Index: usr.sbin/bsdinstall/scripts/rootpass =================================================================== --- usr.sbin/bsdinstall/scripts/rootpass +++ usr.sbin/bsdinstall/scripts/rootpass @@ -33,7 +33,15 @@ echo "========================" echo -echo "Please select a password for the system management account (root):" -echo "Typed characters will not be visible." +if [ -z "$ROOTPASS_ENC" ] && [ -z "$ROOTPASS_PLAIN" ]; then + 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 +else + if [ -n "$ROOTPASS_PLAIN" ]; then + echo "$ROOTPASS_PLAIN" | pw -R $BSDINSTALL_CHROOT usermod root -h 0 + else + echo "$ROOTPASS_ENC" | pw -R $BSDINSTALL_CHROOT usermod root -H 0 + fi +fi