From nobody Mon Sep 22 09:23:30 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cVd2W6VTDz68rtn; Mon, 22 Sep 2025 09:23:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cVd2V6HrRz40Qg; Mon, 22 Sep 2025 09:23:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1758533010; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FKXUrw1cLpLTIkrqGRdgpCnwtuXvkzfC3nZORmpEpsw=; b=U/bH7vHo6ZrR3IyZhdHYKHO2Izly8u4wyyCjCqPFij9h0Lp2/XcjOU9y/kbgXweAdDIQUX Ngp9NomN2qGFNHi6eGGLFecnZ274Ktg9PpYggUtjRltVd6y0ixIq8Sv8TNjn3P2ISjlw9q mclh/JYoaCcWNhxXoCQ7TQMp6TMWu4Ds4x1WX8EgLS6mkzOrCDNfvajcX3kV7ls0CHzPa/ 8vk1tg2fzfNBMDtUjUMlBhCfgygl/6F8F6OT2ysieOZth2Ggp629Ed5klh6JEA2pAxS3P3 G/ZXhhhU3mmOkJo4zCHyTC19dS9x9o+pEeah8mQPa7elY1tNPEdqPW3YXD4RfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1758533010; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FKXUrw1cLpLTIkrqGRdgpCnwtuXvkzfC3nZORmpEpsw=; b=xkEfpblCsyGQTLjdmbhZXSpiIgEjWWcbqwnAxbsDor4Jhxc2C8YZvBGaZOYpeaFuCxrTdS XKP2oFWGvmIYEbf0ivNxa3O3GSIfLFGdcmhI5koIZOYG+l4VPISvyP7B8PDK1jxtAjUqKY puk9KgAsHLLNPglUaljY73rIcN5jlZr01NKw6A+g0z9UcV6Rgn45z4/KRQ0LkP83QQ3tiA fhmVLPuU2ZXf98swwiBjjAHBCpIrcEjAApGPAW9TfLQmGe3QCHQH3g9DreuGmdJ2iR3E5Z A5UEnGxG2i588al1wZNHSHu9+NQq1AjaMixids2DUfuo1KB2UewkAHYLqVK1eQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1758533010; a=rsa-sha256; cv=none; b=ZWb7X9pgKuznObnW7/f2PGnLN3iBQDAUEvHA+Lx8xhjuqr4tpiQj3OgKCqUWKSLMDQwogf v1jOIIhzPO/y42bKNQHC6oWJqwykB9rj9oBIzZ4/Kld7t8Ur5+lLXjquxW5IVGboj7M3rZ 28LeUHv8xo80hyEt9DP6glEbciuJIM1bodVPUCmTJ1uGAR05hfiFyO2b2AXq/Jmn7EKshH gtOLayHdhmqIRWbHFDLLiwfCLuDXy4fj/ekSUtT+iLQ/CLBY8uo0ImgstAMxx3a6NU2SUC jx1Omc74OfTRc666vBOs/FZeyIE4HPRcm95Mx3k2JHcZU9WW09XMLJHZ/cv1kQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cVd2V4999ztTh; Mon, 22 Sep 2025 09:23:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 58M9NUlT099995; Mon, 22 Sep 2025 09:23:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58M9NUsR099992; Mon, 22 Sep 2025 09:23:30 GMT (envelope-from git) Date: Mon, 22 Sep 2025 09:23:30 GMT Message-Id: <202509220923.58M9NUsR099992@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: a4417b9f9cde - stable/15 - moused(8): Start moused with devd List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: a4417b9f9cde5ab1ca1ff84da4847bd7d5141c29 Auto-Submitted: auto-generated The branch stable/15 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=a4417b9f9cde5ab1ca1ff84da4847bd7d5141c29 commit a4417b9f9cde5ab1ca1ff84da4847bd7d5141c29 Author: Vladimir Kondratyev AuthorDate: 2025-09-21 13:14:49 +0000 Commit: Vladimir Kondratyev CommitDate: 2025-09-22 09:22:24 +0000 moused(8): Start moused with devd It is appeared that currently starting of moused does not depend on moused_enable variable value in rc.conf. That leads to missing USB mice support in default configuration. Start moused in traditional per device mode with devd to follow POLA. One daemon per system mode still can be enabled with setting of moused_port="auto" moused_nondefault_enable="NO" variables in /etc/rc.conf To revert to sysmouse mode add moused_type="sysmouse" to /etc/rc.conf Reported by: many Requested by: glebius Reviewed by: glebius MFC after: 1 day Differential Revision: https://reviews.freebsd.org/D52430 (cherry picked from commit 66e7f048f0c8e9e726738fadd9dc819bfda3cbfe) --- libexec/rc/rc.conf | 4 ++-- libexec/rc/rc.d/moused | 11 ++++++----- sbin/devd/moused.conf | 9 +++++++++ 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/libexec/rc/rc.conf b/libexec/rc/rc.conf index 2506bd45a53f..7525f7c9d1fc 100644 --- a/libexec/rc/rc.conf +++ b/libexec/rc/rc.conf @@ -586,11 +586,11 @@ font8x14="NO" # font 8x14 from /usr/share/{syscons,vt}/fonts/* (or NO). font8x8="NO" # font 8x8 from /usr/share/{syscons,vt}/fonts/* (or NO). blanktime="300" # blank time (in seconds) or "NO" to turn it off. saver="NO" # screen saver: Uses /boot/kernel/${saver}_saver.ko -moused_nondefault_enable="NO" # Treat non-default mice as enabled unless +moused_nondefault_enable="YES" # Treat non-default mice as enabled unless # specifically overridden in rc.conf(5). moused_enable="NO" # Run the mouse daemon. moused_type="evdev" # See man page for rc.conf(5) for available settings. -moused_port="auto" # Set to your mouse port. +moused_port="/dev/psm0" # Set to your mouse port. moused_flags="" # Any additional flags to moused. mousechar_start="NO" # if 0xd0-0xd3 default range is occupied in your # language code table, specify alternative range diff --git a/libexec/rc/rc.d/moused b/libexec/rc/rc.d/moused index 64e4f815eea9..35a26bd57275 100755 --- a/libexec/rc/rc.d/moused +++ b/libexec/rc/rc.d/moused @@ -28,9 +28,10 @@ moused_svcj="NO" # expected to be the mouse device. # if [ -n "$2" ]; then - eval moused_$2_enable=\${moused_$2_enable-${moused_nondefault_enable}} - rcvar="moused_${2}_enable" - pidfile="${pidprefix}.$2.pid" + ms=`basename $2` + eval moused_${ms}_enable=\${moused_${ms}_enable-${moused_nondefault_enable}} + rcvar="moused_${ms}_enable" + pidfile="${pidprefix}.${ms}.pid" pidarg="-I $pidfile" fi @@ -45,10 +46,10 @@ moused_start() # the moused_port variable, which if not defined sets it to the # passed in device name. # - ms=$1 + ms=`basename $1` if [ -n "$ms" ]; then eval myflags=\${moused_${ms}_flags-$moused_flags} - eval myport=\${moused_${ms}_port-/dev/$ms} + eval myport=\${moused_${ms}_port-/dev/$1} eval mytype=\${moused_${ms}_type-$moused_type} if [ -n "$mytype" ] && check_kern_features evdev_support; then typearg="-t ${mytype}" diff --git a/sbin/devd/moused.conf b/sbin/devd/moused.conf index ed1060ffdf2e..8821c2bb8375 100644 --- a/sbin/devd/moused.conf +++ b/sbin/devd/moused.conf @@ -33,3 +33,12 @@ notify 100 { action "service moused quietstop $cdev"; }; + +notify 100 { + match "system" "DEVFS"; + match "subsystem" "CDEV"; + match "type" "CREATE"; + match "cdev" "input/event[0-9]+"; + + action "service moused quietstart $cdev"; +};