Kaynağa Gözat

add support for keyboard layout as a runtime option

Waldemar Brodkorb 15 yıl önce
ebeveyn
işleme
e4c70cd1be

+ 8 - 0
Config.in

@@ -206,6 +206,14 @@ config ADK_RUNTIME_TIMEZONE
 	string "timezone for the embedded system"
 	default "Europe/Berlin"
 	help
+	  Predefine the timezone for the embedded system.
+
+config ADK_RUNTIME_KBD_LAYOUT
+	string "keyboard layout for the embedded system"
+	default "en"
+	depends on ADK_TARGET_WITH_INPUT
+	help
+	  Predefine the keyboard layout for the embedded system.
 
 endmenu
 

+ 33 - 0
package/bkeymaps/Makefile

@@ -0,0 +1,33 @@
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=		bkeymaps
+PKG_VERSION:=		1.13
+PKG_RELEASE:=		1
+PKG_MD5SUM:=		a68058ab4a81cf9a8dcbaaa7a5df5b11
+PKG_DESCR:=		binary keymaps for busybox loadkmap
+PKG_SECTION:=		utils
+PKG_URL:=		http://dev.alpinelinux.org/bkeymaps/
+PKG_SITES:=		http://dev.alpinelinux.org/bkeymaps/
+
+PKG_DFLT_BKEYMAPS:=	y if ADK_TARGET_WITH_INPUT
+
+include $(TOPDIR)/mk/package.mk
+
+$(eval $(call PKG_template,BKEYMAPS,$(PKG_NAME),$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
+
+CONFIG_STYLE:=		manual
+BUILD_STYLE:=		manual
+INSTALL_STYLE:=		manual
+
+KBD_LAYOUT:=$(strip $(subst ",, $(ADK_RUNTIME_KBD_LAYOUT)))
+KBD_DIR:=$(shell echo $(KBD_LAYOUT)|cut -c 1-2)
+
+do-install:
+	$(INSTALL_DIR) $(IDIR_BKEYMAPS)/usr/share/keymaps/
+	$(INSTALL_DATA) $(WRKBUILD)/bkeymaps/$(KBD_DIR)/$(KBD_LAYOUT).bmap \
+		$(IDIR_BKEYMAPS)/usr/share/keymaps/keymap.bmap
+
+include ${TOPDIR}/mk/pkg-bottom.mk

+ 4 - 0
package/bkeymaps/files/bkeymaps.postinst

@@ -0,0 +1,4 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+
+add_rcconf bkeymaps kbd NO

+ 26 - 0
package/bkeymaps/files/kbd.init

@@ -0,0 +1,26 @@
+#!/bin/sh
+#PKG bkeymaps
+#INIT 6
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+	[[ $kbd = NO ]] && exit 0
+	exec sh $0 start
+	;;
+start)
+	[ -f /usr/share/keymaps/keymap.bmap ] || exit
+	loadkmap < /usr/share/keymaps/keymap.bmap
+	;;
+stop)
+	;;
+restart)
+	sh $0 stop
+	sh $0 start
+	;;
+*)
+	echo "Usage: $0 {start | stop | restart}"
+	;;
+esac
+exit $?

+ 2 - 0
package/busybox/config/console-tools/Config.in

@@ -39,6 +39,7 @@ config BUSYBOX_DUMPKMAP
 
 config BUSYBOX_KBD_MODE
 	bool "kbd_mode"
+	default y if ADK_TARGET_WITH_INPUT
 	default n
 	help
 	  This program reports and sets keyboard mode.
@@ -51,6 +52,7 @@ config BUSYBOX_LOADFONT
 
 config BUSYBOX_LOADKMAP
 	bool "loadkmap"
+	default y if ADK_TARGET_WITH_INPUT
 	default n
 	help
 	  This program loads a keyboard translation table from