Commit graph

150 commits

Author SHA1 Message Date
Elyes Haouas 338d9c35d5 kbdcontrol: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])
Pull Request: https://github.com/freebsd/freebsd-src/pull/888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
2024-04-28 21:24:47 -06:00
Warner Losh 8a7b612037 usr.sbin: Remove ancient SCCS tags.
Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a perl script.

Sponsored by:		Netflix
2023-11-26 22:23:56 -07:00
Jessica Clarke 968a3db715 kbdcontrol: Support building as a bootstrap tool on old and non-FreeBSD
Systems that predate 971bac5ace ("kbd: consolidate kb interfaces
(phase one)") cannot build kbdcontrol since kbdelays and kbrates moved
to sys/kbio.h. Moreover, on non-FreeBSD, it requires all kinds of ioctls
and sysctls that are highly FreeBSD-specific to build, but we use it as
a bootstrap tool to generate the keymaps used by some kernels (LINT ones
in particular). Thus, when bootstrapping kbdcontrol, disable everything
that's not needed for that singular use, and use the in-tree kbio.h to
get the definitions of the necessary structures.

This allows KBDMUX_DFLT_KEYMAP, UKBD_DFLT_KEYMAP and ATKBD_DFLT_KEYMAP
to be enabled when building on non-FreeBSD, and thus LINT kernels.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D41541
2023-08-22 21:00:28 +01:00
Warner Losh b2c76c41be Remove $FreeBSD$: one-line nroff pattern
Remove /^\.\\"\s*\$FreeBSD\$$\n/
2023-08-16 11:55:15 -06:00
Warner Losh fa9896e082 Remove $FreeBSD$: two-line nroff pattern
Remove /^\.\\"\n\.\\"\s*\$FreeBSD\$$\n/
2023-08-16 11:55:10 -06:00
Warner Losh d0b2dbfa0e Remove $FreeBSD$: one-line sh pattern
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
2023-08-16 11:55:03 -06:00
Warner Losh 1d386b48a5 Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
2023-08-16 11:54:42 -06:00
Warner Losh 2a63c3be15 Remove $FreeBSD$: one-line .c comment pattern
Remove /^/[*/]\s*\$FreeBSD\$.*\n/
2023-08-16 11:54:29 -06:00
Warner Losh b3e7694832 Remove $FreeBSD$: two-line .h pattern
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
2023-08-16 11:54:16 -06:00
Warner Losh 761ab48d6a kbdcontrol: Remove compat code for 4.x -> 5.x transition
I think we're safely past that now...

Sponsored by:		Netflix
2023-07-06 23:10:18 -06:00
Michael 971bac5ace kbd: consolidate kb interfaces (phase one)
Refactor to eliminate duplicated rate and delay tables, with minor style
tweaks for changed lines.  Remove an obsolete comment about needing to
convert from microseconds to ticks (that's done elsewhere). Remove
traiing whitespace in kbdcontrol.c.

Except for the new warning, no change in behavior

Sponsored by: 		DSS GmbH
Reviewed by:		imp [minor style tweaks as well]
Pull Request:		https://github.com/freebsd/pull/683
Differential Revision: 	https://reviews.freebsd.org/D38818
2023-07-06 23:10:18 -06:00
Warner Losh 4d846d260e spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with:		pfg
MFC After:		3 days
Sponsored by:		Netflix
2023-05-12 10:44:03 -06:00
Simon J. Gerraty d9a4274795 Update/fix Makefile.depend for userland 2023-04-18 17:14:23 -07:00
Stefan Eßer c2bb66023f kbdcontrol: enable pre-Unicode dead key table compatibility
The definition of pre-Unicode keymap ioctls will be made optional and
dependent on COMPAT_FREEBSD13 in a follow-up commit to 14-CURRENT.

While we generally provide ABI compatibility for older binaries on
a new kernel, but not functionally extended userland programs on an
old kernel, it has been specifically requested to preserve ABI
compatibility for the kbdcontrol program for both these cases.

Passing the kernel configuration option COMPAT_FREEBSD13 to the build
of kbdcontrol will make ioctls visible to the build that are normally
hidden, but required to implement compatibility with kernels that only
support 8 bit characters in dead key maps.

This commit is not to be merged to any previous FreeBSD version and
it shall be reverted as soon as this type of ABI compatibility is no
longer deemed necessary (probably before 14-STABLE is branched).

This commit is a part of review D38465 and split off to allow it to be
reverted using the commit ID.
2023-02-14 13:49:06 +01:00
Stefan Eßer b4eab621f2 kbdcontrol.c: make pre-Unicode compatibility conditional
Support for the full range of Unicode character codes has been added
to the main keymap back in 2009, with compatibility shims added in
2011 (to support an older kbdcontrol command on a new kernel during
an upgrade from FreeBSD-8 to FreeBSD-9).

Unicode support for accented characters that are reached via dead key
combinations has been added just recently, again with compatibility
shims to allow all combinations of old/new kernel and old/new
kbdcontrol command to load and display the keymaps including the dead
key table. (But full Unicode in the dead key table requires both a new
kernel and kbdcontrol command.)

This commit makes the compatibility shims depend on the respective
compatibility ioctls (OGIO_KEYMAP, OPIO_KEYMAP, OGIO_DEADKEYMAP, and
OPIO_DEADKEYMAP) being defined in sys/kbio.h. This is true for all of
them in 13-STABLE, none in 12-STABLE (as of now), and will become
optional due to a follow-up commit to sys/kbio.h in -CURRENT.

This commit is the only part of review D38465 that should be merged
back to 12-STABLE and 13-STABLE.

MFC after:	1 month
2023-02-14 13:27:27 +01:00
Emmanuel Vadot cab549c76c pkgbase: Create a FreeBSD-console-tools package
And put in it:
 - kbdcontrol
 - vidcontrol
 - moused
 - kbdmap

Those aren't useful in a jail or for a modern desktop.
While here, split the devd.conf part into some new files.

Reviewed by:	bapt
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D38321
2023-02-08 08:52:40 +01:00
Stefan Eßer b92f8e5c0d usr.sbin/kbdcontrol.c: Add backwards compatibility functions
This commit allows a kbdcontrol binary built with a version of kbio.h
that supports Unicode characters in dead key maps to load and display
keymaps including the dead key tables on a kernel built with a
previous version of kbio.h (that only supported 8 bit characters in
the dead key map).

This commit is meant as a temporary compatibility shim that will be
reverted when it can be assumed that all relevant systems have been
upgraded to a kernel that uses the updated kbio.h.

MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D38388
2023-02-06 23:56:44 +01:00
Baptiste Daroussin bcba42d1f8 Stop linking to libl by specifying we do not need yywrap
MFC after: 3 days
2019-09-10 07:26:38 +00:00
Warner Losh 73701bbe9d kbdcontrol -h prints two error messages.
We loop through getopt(3) twice. Once for -P args and once for the
rest. Catch '?' and print usage when that happens.
2019-06-24 21:05:14 +00:00
Stefan Eßer 96329ce7e2 Silence Clang Scan warning about use of unitialized variable.
While the warning is a false positive, it is possible to clarify the code by
always initializing the variable. This does also allow to make the sending
of the "beep" control sequence depend on the validity of its parameters.

I have left the redundant assignment of 0 to the now initialized variables
in place since this makes the code simpler to understand and does not add
any run-time overhead (the compiler completely removes the "else if" test
and the assignments).

There was an embedded literal escape character in a string, which messes up
diplaying the source code on a terminal that interprets ANSI sequences. The
literal escape has been replaced by \e (non-standard, but supported by all
relevant compilers, and already used in other source files in base).

MFC after:	2 weeks
2019-01-23 10:05:27 +00:00
Pedro F. Giffuni 1de7b4b805 various: general adoption of SPDX licensing ID tags.
Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

No functional change intended.
2017-11-27 15:37:16 +00:00
Bryan Drewery ea825d0274 DIRDEPS_BUILD: Update dependencies.
Sponsored by:	Dell EMC Isilon
2017-10-31 00:07:04 +00:00
Ed Maste 8c0d1b4798 kbdcontrol: add -P path option to add keymap search paths
PR:		193865
Reviewed by:	cem
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D5645
2016-03-16 04:05:02 +00:00
Bryan Drewery bd18fd57db DIRDEPS_BUILD: Regenerate without local dependencies.
These are no longer needed after the recent 'beforebuild: depend' changes
and hooking DIRDEPS_BUILD into a subset of FAST_DEPEND which supports
skipping 'make depend'.

Sponsored by:	EMC / Isilon Storage Division
2016-02-24 17:20:11 +00:00
Ed Maste 647129e382 kbdmap.5: Use current names for ASCII control codes lf, ff, us
Refer to the old names nl, np, ns as historical aliases.

PR:		205776, 205778
MFC After:	1 week
Sponsored by:	The FreeBSD Foundation
2016-01-02 18:35:11 +00:00
Simon J. Gerraty ccfb965433 Add META_MODE support.
Off by default, build behaves normally.
WITH_META_MODE we get auto objdir creation, the ability to
start build from anywhere in the tree.

Still need to add real targets under targets/ to build packages.

Differential Revision:       D2796
Reviewed by: brooks imp
2015-06-13 19:20:56 +00:00
Simon J. Gerraty 44d314f704 dirdeps.mk now sets DEP_RELDIR 2015-06-08 23:35:17 +00:00
Simon J. Gerraty 98e0ffaefb Merge sync of head 2015-05-27 01:19:58 +00:00
Joel Dahl f7e00d4bbd mdoc: remove EOL whitespace. 2014-12-29 13:50:59 +00:00
Baptiste Daroussin c6db8143ed Convert usr.sbin to LIBADD
Reduce overlinking
2014-11-25 16:57:27 +00:00
Simon J. Gerraty 9268022b74 Merge from head@274682 2014-11-19 01:07:58 +00:00
Stefan Eßer dd281ebb46 Update man-pages to correctly refer to changed pathes and naming conventions
for systems with vt(4) consoles.

MFC after:	3 days
2014-08-26 09:40:14 +00:00
Stefan Eßer 0ae9426c10 Remove band.aid that made kbdcontrol lookup keymap files in the syscons
path even under vt, which is no longer useful, since the syscons keymap
files have been converted and committed for use by vt.
2014-08-26 09:37:43 +00:00
Simon J. Gerraty ee7b0571c2 Merge head from 7/28 2014-08-19 06:50:54 +00:00
Stefan Eßer 895a99ef10 The previous commit (r269119) introduced a regression: It removed the
ability to specify the the full path name of the keymap file.

Instead leave the original search order intact, but insert the path for
newcons-specific fonts (if run on a system using newcons):

	- KEYMAP_PATH in environment
	- full path name
	- /usr/share/vt/keymaps		(only if newcons is in use!)
	- /usr/share/syscons/keymaps	(also as fall-back for newcons)

MFC after:	1 week
2014-07-26 13:14:28 +00:00
Stefan Eßer e34c3e1817 Fix obvious off by one error: prefix[1] should be set to the path of the
newcons specific keymap files, not prefix[2]. The result of this bug was
that kbdcontrol ignored the files in the syscons keymap directory, which
apparently still work under newcons, for most locales.

MFC after:	1 week
2014-07-26 12:17:26 +00:00
Ed Maste 6c79f78813 Fix vt(4) detection in kbdcontrol and vidcontrol
As sc(4) and vt(4) coexist and are both enabled in GENERIC, the existence
of a vt(4) sysctl is not sufficient to determine that vt(4) is in use.

Reported by:	Trond Endrestøl
2014-07-02 20:40:59 +00:00
Baptiste Daroussin 01c2b8ac0d use .Mt to mark up email addresses consistently (part2)
PR:		191174
Submitted by:	Franco Fichtner  <franco@lastsummer.de>
2014-06-20 09:57:27 +00:00
Aleksandr Rybalko 2f11ee6205 Enable kbdcontrol(1) to use maps from vt(4) keymaps dir /usr/share/vt/keymaps
if vt(4) is present.

MFC after:	7 days
Sponsored by:	The FreeBSD Foundation
2014-05-29 14:39:25 +00:00
Simon J. Gerraty fae50821ae Updated dependencies 2014-05-16 14:09:51 +00:00
Simon J. Gerraty 76b28ad6ab Updated dependencies 2014-05-10 05:16:28 +00:00
Simon J. Gerraty d1d0158641 Merge from head 2013-09-05 20:18:59 +00:00
Jung-uk Kim a7880d59c9 Improve compatibility with recent flex from flex.sourceforge.net. 2013-05-03 23:51:32 +00:00
Simon J. Gerraty 7cf3a1c6b2 Updated dependencies 2013-03-11 17:21:52 +00:00
Simon J. Gerraty f5f7c05209 Updated dependencies 2013-02-16 01:23:54 +00:00
Marcel Moolenaar 7750ad47a9 Sync FreeBSD's bmake branch with Juniper's internal bmake branch.
Requested by: Simon Gerraty <sjg@juniper.net>
2012-08-22 19:25:57 +00:00
Ulrich Spörlein f76b319989 Reencode files to UTF-8. Drop CP1252 em-dash. 2011-12-30 00:59:08 +00:00
Ed Schouten 4d9a3537ff Add missing static and const keywords to kbdcontrol.
None of the symbols provided by kbdcontrol.c are used by other source
files of this binary. Slightly reduce the binary size and make much more
symbols read-only by adding proper static and const keywords.
2011-12-12 12:33:38 +00:00
Rebecca Cran e267ef95d5 Don't generate input() since it's not used. 2010-11-22 14:16:22 +00:00
Oliver Fromme 863ae04c61 Fix some typos: flush vs. flash, and some others.
Approved by:	des (mentor, implicit)
MFC after:	1 week
2010-08-11 08:26:15 +00:00