git: 8cfbeb56aa16 - main - bsdinstall services: Improve mouse configuration

From: Alfonso S. Siciliano <asiciliano_at_FreeBSD.org>
Date: Sat, 21 May 2022 14:42:54 UTC
The branch main has been updated by asiciliano:

URL: https://cgit.FreeBSD.org/src/commit/?id=8cfbeb56aa160de1ea4f492abeb3aa029e84269f

commit 8cfbeb56aa160de1ea4f492abeb3aa029e84269f
Author:     Alfonso S. Siciliano <asiciliano@FreeBSD.org>
AuthorDate: 2022-05-21 14:37:53 +0000
Commit:     Alfonso S. Siciliano <asiciliano@FreeBSD.org>
CommitDate: 2022-05-21 14:42:23 +0000

    bsdinstall services: Improve mouse configuration
    
    bsdinstall(8) has an option to enable moused support.
    However, if it is not selected, moused is still started
    through the configuration of nondefault devices.
    So, automatically add the moused_nondefault_enable="NO"
    setting to rc.conf unless moused support is selected.
    
    PR:                     227999
    Reported by:            bcran
    Reviewed by:            bapt
    Differential Revision:  https://reviews.freebsd.org/D35193
---
 usr.sbin/bsdinstall/scripts/services | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/usr.sbin/bsdinstall/scripts/services b/usr.sbin/bsdinstall/scripts/services
index f9141a523a31..1ac69fa63b2d 100755
--- a/usr.sbin/bsdinstall/scripts/services
+++ b/usr.sbin/bsdinstall/scripts/services
@@ -61,11 +61,17 @@ if [ $retval -ne $BSDDIALOG_OK ]; then
 fi
 
 havedump=
+havemouse=
 for daemon in $DAEMONS; do
 	[ "$daemon" = "dumpdev" ] && havedump=1 continue
+	[ "$daemon" = "moused" ] && havemouse=1
 	echo ${daemon}_enable=\"YES\" >> $BSDINSTALL_TMPETC/rc.conf.services
 done
 
+if [ ! "$havemouse" ]; then
+	echo moused_nondefault_enable=\"NO\" >> $BSDINSTALL_TMPETC/rc.conf.services
+fi
+
 echo '# Set dumpdev to "AUTO" to enable crash dumps, "NO"' \
      'to disable' >> $BSDINSTALL_TMPETC/rc.conf.services
 if [ "$havedump" ]; then