Re: [PATCH] kbdmux(4) and devd(8)

From: Brooks Davis <brooks_at_one-eyed-alien.net>
Date: Thu, 2 Mar 2006 10:35:51 -0800
On Thu, Mar 02, 2006 at 10:28:37AM -0800, Maksim Yevmenkin wrote:
> Brooks Davis wrote:
> >On Wed, Mar 01, 2006 at 03:27:35PM -0800, Maksim Yevmenkin wrote:
> >
> >>Dear Hackers,
> >>
> >>any comments/objections/etc. to the following devd.conf patch? the idea 
> >>is to prevent devd(8) from trying to switch keyboards when kbdmux(4) is 
> >>the default keyboard.
> >>
> >>the 'attach' action will fail anyway, however, the 'detach' action may 
> >>succeed (if /dev/kbd0 is not is the kbdmux(4)).
> >
> >
> >This seems OK if a bit ugly to me.  Another idea might be to add some
> >new methods to /etc/rc.d/syscons (or create a new keyboard management
> >script) to hide the logic there.
> 
> do you mean something like

Yes, that's what I was thinking.

-- Brooks

> --- syscons.orig        Thu Jan  5 15:36:02 2006
> +++ syscons     Thu Mar  2 10:25:49 2006
> _at__at_ -34,8 +34,10 _at__at_
>  . /etc/rc.subr
> 
>  name="syscons"
> +extra_commands="setkeyboard"
>  start_precmd="syscons_precmd"
>  start_cmd="syscons_start"
> +setkeyboard_cmd="syscons_setkeyboard"
> 
>  # stdin must be redirected because it might be for a serial console
>  #
> _at__at_ -206,5 +208,19 _at__at_
>         echo '.'
>  }
> 
> +syscons_setkeyboard()
> +{
> +       kbd=$1
> +
> +       if [ -z "${kbd}" ]; then
> +               return 1
> +       fi
> +
> +       kbdcontrol -i < ${kbddev} | grep kbdmux > /dev/null 2>&1
> +       if [ $? != 0 ]; then
> +               kbdcontrol -k /dev/${kbd} < ${kbddev} > /dev/null 2>&1
> +       fi
> +}
> +
>  load_rc_config $name
> -run_rc_command "$1"
> +run_rc_command $*
> 
> 
> thanks,
> max
Received on Thu Mar 02 2006 - 17:35:52 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:53 UTC