aboutsummaryrefslogtreecommitdiff
path: root/console-tools
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2016-11-23 10:39:27 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2016-11-23 10:39:27 +0100
commit6d9329935c0621ddc056aee0d30cec52a24da499 (patch)
tree8b78faf3893c364337b138a9e8c20bfa4a286273 /console-tools
parentc19f7584e14522043da141189711c8db72dfbc90 (diff)
downloadbusybox-6d9329935c0621ddc056aee0d30cec52a24da499.tar.gz
Convert all console-tools/* applets to "new style" applet definitions
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'console-tools')
-rw-r--r--console-tools/Config.src166
-rw-r--r--console-tools/Kbuild.src16
-rw-r--r--console-tools/chvt.c11
-rw-r--r--console-tools/clear.c9
-rw-r--r--console-tools/deallocvt.c10
-rw-r--r--console-tools/dumpkmap.c12
-rw-r--r--console-tools/fgconsole.c10
-rw-r--r--console-tools/kbd_mode.c10
-rw-r--r--console-tools/loadfont.c51
-rw-r--r--console-tools/loadkmap.c11
-rw-r--r--console-tools/openvt.c11
-rw-r--r--console-tools/reset.c13
-rw-r--r--console-tools/resize.c21
-rw-r--r--console-tools/setconsole.c18
-rw-r--r--console-tools/setkeycodes.c11
-rw-r--r--console-tools/setlogcons.c10
-rw-r--r--console-tools/showkey.c10
17 files changed, 213 insertions, 187 deletions
diff --git a/console-tools/Config.src b/console-tools/Config.src
index c65704478..e6587ade4 100644
--- a/console-tools/Config.src
+++ b/console-tools/Config.src
@@ -7,170 +7,4 @@ menu "Console Utilities"
INSERT
-config CHVT
- bool "chvt"
- default y
- select PLATFORM_LINUX
- help
- This program is used to change to another terminal.
- Example: chvt 4 (change to terminal /dev/tty4)
-
-config FGCONSOLE
- bool "fgconsole"
- default y
- select PLATFORM_LINUX
- help
- This program prints active (foreground) console number.
-
-config CLEAR
- bool "clear"
- default y
- help
- This program clears the terminal screen.
-
-config DEALLOCVT
- bool "deallocvt"
- default y
- select PLATFORM_LINUX
- help
- This program deallocates unused virtual consoles.
-
-config DUMPKMAP
- bool "dumpkmap"
- default y
- select PLATFORM_LINUX
- help
- This program dumps the kernel's keyboard translation table to
- stdout, in binary format. You can then use loadkmap to load it.
-
-config KBD_MODE
- bool "kbd_mode"
- default y
- select PLATFORM_LINUX
- help
- This program reports and sets keyboard mode.
-
-config LOADFONT
- bool "loadfont"
- default y
- select PLATFORM_LINUX
- help
- This program loads a console font from standard input.
-
-config LOADKMAP
- bool "loadkmap"
- default y
- select PLATFORM_LINUX
- help
- This program loads a keyboard translation table from
- standard input.
-
-config OPENVT
- bool "openvt"
- default y
- select PLATFORM_LINUX
- help
- This program is used to start a command on an unused
- virtual terminal.
-
-config RESET
- bool "reset"
- default y
- help
- This program is used to reset the terminal screen, if it
- gets messed up.
-
-config RESIZE
- bool "resize"
- default y
- help
- This program is used to (re)set the width and height of your current
- terminal.
-
-config FEATURE_RESIZE_PRINT
- bool "Print environment variables"
- default y
- depends on RESIZE
- help
- Prints the newly set size (number of columns and rows) of
- the terminal.
- E.g.:
- COLUMNS=80;LINES=44;export COLUMNS LINES;
-
-config SETCONSOLE
- bool "setconsole"
- default y
- select PLATFORM_LINUX
- help
- This program redirects the system console to another device,
- like the current tty while logged in via telnet.
-
-config FEATURE_SETCONSOLE_LONG_OPTIONS
- bool "Enable long options"
- default y
- depends on SETCONSOLE && LONG_OPTS
- help
- Support long options for the setconsole applet.
-
-config SETFONT
- bool "setfont"
- default y
- select PLATFORM_LINUX
- help
- Allows to load console screen map. Useful for i18n.
-
-config FEATURE_SETFONT_TEXTUAL_MAP
- bool "Support reading textual screen maps"
- default y
- depends on SETFONT
- help
- Support reading textual screen maps.
-
-config DEFAULT_SETFONT_DIR
- string "Default directory for console-tools files"
- default ""
- depends on SETFONT
- help
- Directory to use if setfont's params are simple filenames
- (not /path/to/file or ./file). Default is "" (no default directory).
-
-config SETKEYCODES
- bool "setkeycodes"
- default y
- select PLATFORM_LINUX
- help
- This program loads entries into the kernel's scancode-to-keycode
- map, allowing unusual keyboards to generate usable keycodes.
-
-config SETLOGCONS
- bool "setlogcons"
- default y
- select PLATFORM_LINUX
- help
- This program redirects the output console of kernel messages.
-
-config SHOWKEY
- bool "showkey"
- default y
- select PLATFORM_LINUX
- help
- Shows keys pressed.
-
-comment "Common options for loadfont and setfont"
- depends on LOADFONT || SETFONT
-
-config FEATURE_LOADFONT_PSF2
- bool "Support for PSF2 console fonts"
- default y
- depends on LOADFONT || SETFONT
- help
- Support PSF2 console fonts.
-
-config FEATURE_LOADFONT_RAW
- bool "Support for old (raw) console fonts"
- default y
- depends on LOADFONT || SETFONT
- help
- Support old (raw) console fonts.
-
endmenu
diff --git a/console-tools/Kbuild.src b/console-tools/Kbuild.src
index 94de9ad9f..6b4fb7470 100644
--- a/console-tools/Kbuild.src
+++ b/console-tools/Kbuild.src
@@ -7,19 +7,3 @@
lib-y:=
INSERT
-lib-$(CONFIG_CHVT) += chvt.o
-lib-$(CONFIG_FGCONSOLE) += fgconsole.o
-lib-$(CONFIG_CLEAR) += clear.o
-lib-$(CONFIG_DEALLOCVT) += deallocvt.o
-lib-$(CONFIG_DUMPKMAP) += dumpkmap.o
-lib-$(CONFIG_SETCONSOLE) += setconsole.o
-lib-$(CONFIG_KBD_MODE) += kbd_mode.o
-lib-$(CONFIG_LOADFONT) += loadfont.o
-lib-$(CONFIG_LOADKMAP) += loadkmap.o
-lib-$(CONFIG_OPENVT) += openvt.o
-lib-$(CONFIG_RESET) += reset.o
-lib-$(CONFIG_RESIZE) += resize.o
-lib-$(CONFIG_SETFONT) += loadfont.o
-lib-$(CONFIG_SETKEYCODES) += setkeycodes.o
-lib-$(CONFIG_SETLOGCONS) += setlogcons.o
-lib-$(CONFIG_SHOWKEY) += showkey.o
diff --git a/console-tools/chvt.c b/console-tools/chvt.c
index b9c974f4a..2b993eb62 100644
--- a/console-tools/chvt.c
+++ b/console-tools/chvt.c
@@ -6,6 +6,17 @@
*
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
*/
+//config:config CHVT
+//config: bool "chvt"
+//config: default y
+//config: select PLATFORM_LINUX
+//config: help
+//config: This program is used to change to another terminal.
+//config: Example: chvt 4 (change to terminal /dev/tty4)
+
+//applet:IF_CHVT(APPLET(chvt, BB_DIR_USR_BIN, BB_SUID_DROP))
+
+//kbuild:lib-$(CONFIG_CHVT) += chvt.o
//usage:#define chvt_trivial_usage
//usage: "N"
diff --git a/console-tools/clear.c b/console-tools/clear.c
index ac22b787e..b360d34d9 100644
--- a/console-tools/clear.c
+++ b/console-tools/clear.c
@@ -6,6 +6,15 @@
*
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
*/
+//config:config CLEAR
+//config: bool "clear"
+//config: default y
+//config: help
+//config: This program clears the terminal screen.
+
+//applet:IF_CLEAR(APPLET(clear, BB_DIR_USR_BIN, BB_SUID_DROP))
+
+//kbuild:lib-$(CONFIG_CLEAR) += clear.o
//usage:#define clear_trivial_usage
//usage: ""
diff --git a/console-tools/deallocvt.c b/console-tools/deallocvt.c
index b131c0a64..37c966af3 100644
--- a/console-tools/deallocvt.c
+++ b/console-tools/deallocvt.c
@@ -7,8 +7,16 @@
*
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
*/
+//config:config DEALLOCVT
+//config: bool "deallocvt"
+//config: default y
+//config: select PLATFORM_LINUX
+//config: help
+//config: This program deallocates unused virtual consoles.
-/* no options, no getopt */
+//applet:IF_DEALLOCVT(APPLET(deallocvt, BB_DIR_USR_BIN, BB_SUID_DROP))
+
+//kbuild:lib-$(CONFIG_DEALLOCVT) += deallocvt.o
//usage:#define deallocvt_trivial_usage
//usage: "[N]"
diff --git a/console-tools/dumpkmap.c b/console-tools/dumpkmap.c
index b6fd466dc..4a249868a 100644
--- a/console-tools/dumpkmap.c
+++ b/console-tools/dumpkmap.c
@@ -7,7 +7,17 @@
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
*
*/
-/* no options, no getopt */
+//config:config DUMPKMAP
+//config: bool "dumpkmap"
+//config: default y
+//config: select PLATFORM_LINUX
+//config: help
+//config: This program dumps the kernel's keyboard translation table to
+//config: stdout, in binary format. You can then use loadkmap to load it.
+
+//applet:IF_DUMPKMAP(APPLET(dumpkmap, BB_DIR_BIN, BB_SUID_DROP))
+
+//kbuild:lib-$(CONFIG_DUMPKMAP) += dumpkmap.o
//usage:#define dumpkmap_trivial_usage
//usage: "> keymap"
diff --git a/console-tools/fgconsole.c b/console-tools/fgconsole.c
index 54355bee6..019761726 100644
--- a/console-tools/fgconsole.c
+++ b/console-tools/fgconsole.c
@@ -6,6 +6,16 @@
*
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
*/
+//config:config FGCONSOLE
+//config: bool "fgconsole"
+//config: default y
+//config: select PLATFORM_LINUX
+//config: help
+//config: This program prints active (foreground) console number.
+
+//applet:IF_FGCONSOLE(APPLET(fgconsole, BB_DIR_USR_BIN, BB_SUID_DROP))
+
+//kbuild:lib-$(CONFIG_FGCONSOLE) += fgconsole.o
//usage:#define fgconsole_trivial_usage
//usage: ""
diff --git a/console-tools/kbd_mode.c b/console-tools/kbd_mode.c
index 138536721..f1238c6b4 100644
--- a/console-tools/kbd_mode.c
+++ b/console-tools/kbd_mode.c
@@ -8,6 +8,16 @@
*
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
*/
+//config:config KBD_MODE
+//config: bool "kbd_mode"
+//config: default y
+//config: select PLATFORM_LINUX
+//config: help
+//config: This program reports and sets keyboard mode.
+
+//applet:IF_KBD_MODE(APPLET(kbd_mode, BB_DIR_BIN, BB_SUID_DROP))
+
+//kbuild:lib-$(CONFIG_KBD_MODE) += kbd_mode.o
//usage:#define kbd_mode_trivial_usage
//usage: "[-a|k|s|u] [-C TTY]"
diff --git a/console-tools/loadfont.c b/console-tools/loadfont.c
index 58073e0dc..52605baa1 100644
--- a/console-tools/loadfont.c
+++ b/console-tools/loadfont.c
@@ -9,6 +9,57 @@
*
* Licensed under GPLv2, see file LICENSE in this source tree.
*/
+//config:config LOADFONT
+//config: bool "loadfont"
+//config: default y
+//config: select PLATFORM_LINUX
+//config: help
+//config: This program loads a console font from standard input.
+//config:
+//config:config SETFONT
+//config: bool "setfont"
+//config: default y
+//config: select PLATFORM_LINUX
+//config: help
+//config: Allows to load console screen map. Useful for i18n.
+//config:
+//config:config FEATURE_SETFONT_TEXTUAL_MAP
+//config: bool "Support reading textual screen maps"
+//config: default y
+//config: depends on SETFONT
+//config: help
+//config: Support reading textual screen maps.
+//config:
+//config:config DEFAULT_SETFONT_DIR
+//config: string "Default directory for console-tools files"
+//config: default ""
+//config: depends on SETFONT
+//config: help
+//config: Directory to use if setfont's params are simple filenames
+//config: (not /path/to/file or ./file). Default is "" (no default directory).
+//config:
+//config:comment "Common options for loadfont and setfont"
+//config: depends on LOADFONT || SETFONT
+//config:
+//config:config FEATURE_LOADFONT_PSF2
+//config: bool "Support for PSF2 console fonts"
+//config: default y
+//config: depends on LOADFONT || SETFONT
+//config: help
+//config: Support PSF2 console fonts.
+//config:
+//config:config FEATURE_LOADFONT_RAW
+//config: bool "Support for old (raw) console fonts"
+//config: default y
+//config: depends on LOADFONT || SETFONT
+//config: help
+//config: Support old (raw) console fonts.
+
+//applet:IF_LOADFONT(APPLET(loadfont, BB_DIR_USR_SBIN, BB_SUID_DROP))
+//applet:IF_SETFONT(APPLET(setfont, BB_DIR_USR_SBIN, BB_SUID_DROP))
+
+//kbuild:lib-$(CONFIG_LOADFONT) += loadfont.o
+//kbuild:lib-$(CONFIG_SETFONT) += loadfont.o
//usage:#define loadfont_trivial_usage
//usage: "< font"
diff --git a/console-tools/loadkmap.c b/console-tools/loadkmap.c
index f525ee5d1..70ab55a8e 100644
--- a/console-tools/loadkmap.c
+++ b/console-tools/loadkmap.c
@@ -6,6 +6,17 @@
*
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
*/
+//config:config LOADKMAP
+//config: bool "loadkmap"
+//config: default y
+//config: select PLATFORM_LINUX
+//config: help
+//config: This program loads a keyboard translation table from
+//config: standard input.
+
+//applet:IF_LOADKMAP(APPLET(loadkmap, BB_DIR_SBIN, BB_SUID_DROP))
+
+//kbuild:lib-$(CONFIG_LOADKMAP) += loadkmap.o
//usage:#define loadkmap_trivial_usage
//usage: "< keymap"
diff --git a/console-tools/openvt.c b/console-tools/openvt.c
index e52356692..5cbc717ec 100644
--- a/console-tools/openvt.c
+++ b/console-tools/openvt.c
@@ -7,6 +7,17 @@
*
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
*/
+//config:config OPENVT
+//config: bool "openvt"
+//config: default y
+//config: select PLATFORM_LINUX
+//config: help
+//config: This program is used to start a command on an unused
+//config: virtual terminal.
+
+//applet:IF_OPENVT(APPLET(openvt, BB_DIR_USR_BIN, BB_SUID_DROP))
+
+//kbuild:lib-$(CONFIG_OPENVT) += openvt.o
//usage:#define openvt_trivial_usage
//usage: "[-c N] [-sw] [PROG ARGS]"
diff --git a/console-tools/reset.c b/console-tools/reset.c
index 65940bdec..57cebb4ea 100644
--- a/console-tools/reset.c
+++ b/console-tools/reset.c
@@ -7,9 +7,18 @@
*
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
*/
+/* "Standard" version of this tool is in ncurses package */
-/* BTW, which "standard" package has this utility? It doesn't seem
- * to be ncurses, coreutils, console-tools... then what? */
+//config:config RESET
+//config: bool "reset"
+//config: default y
+//config: help
+//config: This program is used to reset the terminal screen, if it
+//config: gets messed up.
+
+//applet:IF_RESET(APPLET(reset, BB_DIR_USR_BIN, BB_SUID_DROP))
+
+//kbuild:lib-$(CONFIG_RESET) += reset.o
//usage:#define reset_trivial_usage
//usage: ""
diff --git a/console-tools/resize.c b/console-tools/resize.c
index a3342a195..567086f09 100644
--- a/console-tools/resize.c
+++ b/console-tools/resize.c
@@ -6,7 +6,26 @@
*
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
*/
-/* no options, no getopt */
+//config:config RESIZE
+//config: bool "resize"
+//config: default y
+//config: help
+//config: This program is used to (re)set the width and height of your current
+//config: terminal.
+//config:
+//config:config FEATURE_RESIZE_PRINT
+//config: bool "Print environment variables"
+//config: default y
+//config: depends on RESIZE
+//config: help
+//config: Prints the newly set size (number of columns and rows) of
+//config: the terminal.
+//config: E.g.:
+//config: COLUMNS=80;LINES=44;export COLUMNS LINES;
+
+//applet:IF_RESIZE(APPLET(resize, BB_DIR_USR_BIN, BB_SUID_DROP))
+
+//kbuild:lib-$(CONFIG_RESIZE) += resize.o
//usage:#define resize_trivial_usage
//usage: ""
diff --git a/console-tools/setconsole.c b/console-tools/setconsole.c
index c0051dcc8..58057268d 100644
--- a/console-tools/setconsole.c
+++ b/console-tools/setconsole.c
@@ -7,6 +7,24 @@
*
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
*/
+//config:config SETCONSOLE
+//config: bool "setconsole"
+//config: default y
+//config: select PLATFORM_LINUX
+//config: help
+//config: This program redirects the system console to another device,
+//config: like the current tty while logged in via telnet.
+//config:
+//config:config FEATURE_SETCONSOLE_LONG_OPTIONS
+//config: bool "Enable long options"
+//config: default y
+//config: depends on SETCONSOLE && LONG_OPTS
+//config: help
+//config: Support long options for the setconsole applet.
+
+//applet:IF_SETCONSOLE(APPLET(setconsole, BB_DIR_SBIN, BB_SUID_DROP))
+
+//kbuild:lib-$(CONFIG_SETCONSOLE) += setconsole.o
//usage:#define setconsole_trivial_usage
//usage: "[-r" IF_FEATURE_SETCONSOLE_LONG_OPTIONS("|--reset") "] [DEVICE]"
diff --git a/console-tools/setkeycodes.c b/console-tools/setkeycodes.c
index a6a7c2374..11fc37ae9 100644
--- a/console-tools/setkeycodes.c
+++ b/console-tools/setkeycodes.c
@@ -8,6 +8,17 @@
*
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
*/
+//config:config SETKEYCODES
+//config: bool "setkeycodes"
+//config: default y
+//config: select PLATFORM_LINUX
+//config: help
+//config: This program loads entries into the kernel's scancode-to-keycode
+//config: map, allowing unusual keyboards to generate usable keycodes.
+
+//applet:IF_SETKEYCODES(APPLET(setkeycodes, BB_DIR_USR_BIN, BB_SUID_DROP))
+
+//kbuild:lib-$(CONFIG_SETKEYCODES) += setkeycodes.o
//usage:#define setkeycodes_trivial_usage
//usage: "SCANCODE KEYCODE..."
diff --git a/console-tools/setlogcons.c b/console-tools/setlogcons.c
index 2a11da329..2ea36f039 100644
--- a/console-tools/setlogcons.c
+++ b/console-tools/setlogcons.c
@@ -8,6 +8,16 @@
*
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
*/
+//config:config SETLOGCONS
+//config: bool "setlogcons"
+//config: default y
+//config: select PLATFORM_LINUX
+//config: help
+//config: This program redirects the output console of kernel messages.
+
+//applet:IF_SETLOGCONS(APPLET(setlogcons, BB_DIR_USR_SBIN, BB_SUID_DROP))
+
+//kbuild:lib-$(CONFIG_SETLOGCONS) += setlogcons.o
//usage:#define setlogcons_trivial_usage
//usage: "[N]"
diff --git a/console-tools/showkey.c b/console-tools/showkey.c
index b7b4c32a8..c2447b887 100644
--- a/console-tools/showkey.c
+++ b/console-tools/showkey.c
@@ -6,6 +6,16 @@
*
* Licensed under GPLv2, see file LICENSE in this source tree.
*/
+//config:config SHOWKEY
+//config: bool "showkey"
+//config: default y
+//config: select PLATFORM_LINUX
+//config: help
+//config: Shows keys pressed.
+
+//applet:IF_SHOWKEY(APPLET(showkey, BB_DIR_USR_BIN, BB_SUID_DROP))
+
+//kbuild:lib-$(CONFIG_SHOWKEY) += showkey.o
//usage:#define showkey_trivial_usage
//usage: "[-a | -k | -s]"