Commit graph

98 commits

Author SHA1 Message Date
Baptiste Daroussin 0f4e803733 kbdmap: fix typo preventing kbdmap to work under vt 2024-02-01 08:45:50 +01:00
Baptiste Daroussin f14ea00c8f kbdmap: remove debug 2024-02-01 08:45:50 +01:00
Warner Losh 4d65a7c695 usr.sbin: Automated cleanup of cdefs and other formatting
Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.

Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/
Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/
Remove /\n+#if.*\n#endif.*\n+/
Remove /^#if.*\n#endif.*\n/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/

Sponsored by:		Netflix
2023-11-26 22:24:01 -07:00
Warner Losh 05248206f7 Remove $FreeBSD$: one-line bare tag
Remove /^\s*\$FreeBSD\$$\n/
2023-08-16 11:55:20 -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 b3e7694832 Remove $FreeBSD$: two-line .h pattern
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
2023-08-16 11:54:16 -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
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
Dimitry Andric e17fede8ff Fix too small sscanf output buffers in kbdmap
This fixes the following warnings from clang 14:

usr.sbin/kbdmap/kbdmap.c:241:16: error: 'sscanf' may overflow; destination buffer in argument 5 has size 20, but the corresponding specifier may require size 21 [-Werror,-Wfortify-source]
                            &a, &b, buf);
                                    ^
usr.sbin/kbdmap/kbdmap.c:615:8: error: 'sscanf' may overflow; destination buffer in argument 3 has size 64, but the corresponding specifier may require size 65 [-Werror,-Wfortify-source]
                            keym, lng, desc);
                            ^
usr.sbin/kbdmap/kbdmap.c:615:14: error: 'sscanf' may overflow; destination buffer in argument 4 has size 64, but the corresponding specifier may require size 65 [-Werror,-Wfortify-source]
                            keym, lng, desc);
                                  ^
usr.sbin/kbdmap/kbdmap.c:615:19: error: 'sscanf' may overflow; destination buffer in argument 5 has size 256, but the corresponding specifier may require size 257 [-Werror,-Wfortify-source]
                            keym, lng, desc);
                                       ^

In each case, the buffer being sscanf'd into is one byte too small.

MFC after:	 3 days
2022-02-06 16:25:25 +01:00
Alfonso Siciliano 263660c061 bsddialog: import version 0.1
Import bsddialog 0.1 Utility and Library, fully refatorized, API stable,
manuals completed, easier to maintain and improve.

Update deps for new API:
add mixedgauge consts, delete __DECONST and add bsddialog_geterror()
info to avoid silent errors

* tzsetup
* kbdmap
* distextract

Differential Revision:	https://reviews.freebsd.org/D34066
2022-01-28 09:56:21 +01:00
Alfonso Siciliano 1de4665dfc kbdmap: adapt to the new libbsddialog API
Differential Revision:	https://reviews.freebsd.org/D33398
2021-12-13 09:08:09 +01:00
Baptiste Daroussin 998959cd61 kbdmap: adapt to the new bsddialog api 2021-12-06 13:58:25 +01:00
Baptiste Daroussin 24b05d7a61 kbdmap: use libbsddialog instead of calling dialog(1) via system(3) 2021-11-24 11:55:26 +01:00
Ed Maste 29f64e28ba kbdmap: allow INDEX.keymaps to provide the dialog title
Previously kbdmap had a localized menu heading ("Choose your keyboard
layout") but not the dialog title ("Keyboard Menu").

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2019-12-11 17:19:36 +00:00
Stefan Eßer 5f81babdee Silence a CI warning regarding the use of strcpy().
While this is a false positive (a sufficiently large buffer has been
allocated in the line above), the use of strdup() simplifies and clarifies
the code.

MFC after:	2 weeks
2019-01-22 13:11:15 +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 632ddb8753 kbdmap: include filename when reporting fopen() failure
Previously only one of two cases reported the file name. Use the same
error string in both cases.

Sponsored by:	The FreeBSD Foundation
2015-11-27 21:27:39 +00:00
Ed Maste 1b4e36949a vidfont: with vt(4) omit size from vidcontrol -f
When using syscons, vidfont extracts the font size from the filename
passes it to vidcontrol -f. In vt(4) mode the size argument is not
required, and some of the fonts in /usr/share/vt/fonts do not have the
size in the filename, which caused vidfont to fail. Thus, just omit the
size argument in vt(4) mode.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2015-11-27 00:04:39 +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
Ed Maste 92ee8e8fd6 kbdmap(1): increase description size to 256 bytes
After conversion to UTF-8 some INDEX.keymaps descriptions are longer
than the previous limit of 64 bytes.

PR:		193656
Sponsored by:	The FreeBSD Foundation
2015-05-14 14:20:50 +00:00
Simon J. Gerraty 9268022b74 Merge from head@274682 2014-11-19 01:07:58 +00:00
Stefan Eßer f071b64ed3 More man pages that need to know about vt in addition to syscons.
MFC after:	3 dayS
2014-08-26 10:55:08 +00:00
Simon J. Gerraty ee7b0571c2 Merge head from 7/28 2014-08-19 06:50:54 +00:00
Stefan Eßer 6fe6b12f07 Add support for NEWCONS to kbdmap and vidfont.
The path to keymaps and fonts is selected based on the existence and value
of "sysctl kern.vty".

MFC after:	1 week
2014-08-14 14:22:12 +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
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 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
Simon J. Gerraty 23090366f7 Sync from head 2012-11-04 02:52:03 +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
Eitan Adler c84c09f445 Remove variables which are initialized but never used thereafter reported by gcc46 warning
Approved by:	cperciva
MFC After:	3 days
2012-06-19 06:10:31 +00:00
Ulrich Spörlein 3df5ecac8c Spelling fixes for usr.sbin/ 2011-12-30 10:58:14 +00:00
Nathan Whitehorn 5d920ef704 Place quotes around the output of kbdmap(1), designed to be pasted into
/etc/rc.conf.

PR:		bin/161711
Submitted by:	manolis
MFC after:	1 week
2011-10-16 16:05:23 +00:00
Jaakko Heinonen b2ce2d693f Don't try to close the stream if fopen(3) fails.
PR:		bin/155349
Submitted by:	Urankar Mikael
2011-06-01 15:48:43 +00:00
Nathan Whitehorn c5199e9706 Use auto-sizing syntax appropriate for the new dialog(1). This should
probably be modified to use libdialog.
2011-01-13 16:42:16 +00:00
Kevin Lo b77a4a441b Fix fd leak in get_font 2010-11-29 09:21:26 +00:00
Daniel Gerzo 425dcfa4eb - fix path for locale.alias
PR:		docs/134070
Submitted by:	Frank Shute <frank@shute.org.uk>
MFC after:	1 week
2009-04-28 20:20:13 +00:00
Murray Stokely 262185e9d2 Output keymap choice to stderr so it is easier to parse for apps chained to
this curses based app.

Submitted by:	ivoras
Approved by:	re@ (bmah@)
2007-08-27 21:56:42 +00:00
Kevin Lo d069140339 Use sizeof() for calculating the buffer size instead of hard-coded values. 2007-03-06 09:32:41 +00:00
Ruslan Ermilov e36f056f97 Simplify and improve the markup. 2006-12-25 18:36:53 +00:00
Florent Thoumie 61927b8299 Fix -r causing SIGSEGV due to parse_args() being called before font_current is set.
Approved by:	krion
MFC after:	3 days
2006-01-09 19:54:28 +00:00
Ruslan Ermilov 76c6134966 Fixed two bugs in Perl to C conversion that prevented locale name
from being parsed correctly.

OK'ed by:	markm
Approved by:	re (scottl)
MFC after:	3 days
2005-06-30 05:31:01 +00:00
Ruslan Ermilov 254dd1666e Let bsd.prog.mk set SRCS and MAN to their default values. 2005-01-28 16:08:11 +00:00