Commit 1f0af753 authored by Sören Tempel's avatar Sören Tempel Committed by Ariadne Conill

main/kbd: add -openrc subpackage

OpenRC run scripts have been copied from the OpenRC source and contain
only minimal modifications.
parent 2d87b9a1
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# Maintainer: Natanael Copa <> # Maintainer: Natanael Copa <>
pkgname=kbd pkgname=kbd
pkgver=2.0.4 pkgver=2.0.4
pkgrel=2 pkgrel=3
pkgdesc="Tools for configuring the console (keyboard, virtual terminals, etc.)" pkgdesc="Tools for configuring the console (keyboard, virtual terminals, etc.)"
url="" url=""
arch="all" arch="all"
...@@ -10,12 +10,17 @@ license="GPL-2.0-or-later" ...@@ -10,12 +10,17 @@ license="GPL-2.0-or-later"
depends="kbd-misc" depends="kbd-misc"
makedepends="linux-headers linux-pam-dev check-dev ckbcomp xkeyboard-config" makedepends="linux-headers linux-pam-dev check-dev ckbcomp xkeyboard-config"
install="" install=""
subpackages="$pkgname-bkeymaps::noarch $pkgname-legacy::noarch $pkgname-misc::noarch $pkgname-doc $pkgname-vlock" subpackages="$pkgname-bkeymaps::noarch $pkgname-legacy::noarch
$pkgname-misc::noarch $pkgname-doc $pkgname-openrc $pkgname-vlock"
source="$pkgver.tar.gz source="$pkgver.tar.gz
error.h error.h
fix-tests.patch fix-tests.patch
" "
builddir="$srcdir"/kbd-$pkgver builddir="$srcdir"/kbd-$pkgver
_datadir=/usr/share _datadir=/usr/share
_xmapdir="$_datadir"/keymaps/xkb _xmapdir="$_datadir"/keymaps/xkb
_bmapdir="$_datadir"/bkeymaps _bmapdir="$_datadir"/bkeymaps
...@@ -62,6 +67,11 @@ package() { ...@@ -62,6 +67,11 @@ package() {
cd "$builddir" cd "$builddir"
make DESTDIR="$pkgdir" install make DESTDIR="$pkgdir" install
install -Dm755 "$srcdir"/loadkeys.initd \
install -Dm644 "$srcdir"/loadkeys.confd \
# Move and fixup legacy keymaps # Move and fixup legacy keymaps
mkdir legacy mkdir legacy
mv "$pkgdir"/usr/share/keymaps/* legacy mv "$pkgdir"/usr/share/keymaps/* legacy
...@@ -165,5 +175,7 @@ misc() { ...@@ -165,5 +175,7 @@ misc() {
} }
sha512sums="e37bc661c75a8363e9a5ba903310fa7f7ded4f381c2c77aa7edc0b1aca5a63224933fd113cddcf180e7fb85f55407e0d1f47be1cdf69dcf2787e83ac996bbf03 kbd-2.0.4.tar.gz sha512sums="e37bc661c75a8363e9a5ba903310fa7f7ded4f381c2c77aa7edc0b1aca5a63224933fd113cddcf180e7fb85f55407e0d1f47be1cdf69dcf2787e83ac996bbf03 kbd-2.0.4.tar.gz
64b5ab4c362350521da8f507d22c0b77784da99bbe1b32f0c001cd826f63c607e3f9cd6af01f06a61af8bd709760bbf2bb3cfe2010c33925f2987a1af6ef4998 loadkeys.initd
12028796552a5ffed1d5cb19d37fc6a73fb4f2e2bf34d837a81171c7ebee98d6c3f557715bf79706d79ce053b9b2450cd8cf1c4ea045428fb7d8a5915ae3ed78 loadkeys.confd
c66f6b0d8c8b8d285c740bdbe7130dee272ac01cd5e73b35a58cedf1a77fe8d9e062631b804fb58014d8eb9861c8f28aed07bc022ef31662bcc61b5c85a21752 error.h c66f6b0d8c8b8d285c740bdbe7130dee272ac01cd5e73b35a58cedf1a77fe8d9e062631b804fb58014d8eb9861c8f28aed07bc022ef31662bcc61b5c85a21752 error.h
bb67e5bb933a48f4a04402e07d7d67169a97485e6b469f8ccd4436466eb17ec2ddcf0ef74d22b3aae9e813feaee5bef0822ec50c384e0276a8c91f9325502a5f fix-tests.patch" bb67e5bb933a48f4a04402e07d7d67169a97485e6b469f8ccd4436466eb17ec2ddcf0ef74d22b3aae9e813feaee5bef0822ec50c384e0276a8c91f9325502a5f fix-tests.patch"
# Use keymap to specify the default console keymap. There is a complete tree
# of keymaps in /usr/share/keymaps to choose from.
# Should we first load the 'windowkeys' console keymap? Most x86 users will
# say "yes" here. Note that non-x86 users should leave it as "no".
# Loading this keymap will enable VT switching (like ALT+Left/Right)
# using the special windows keys on the linux console.
# The maps to load for extended keyboards. Most users will leave this as is.
#extended_keymaps="backspace keypad euro2"
# Tell dumpkeys(1) to interpret character action codes to be
# from the specified character set.
# This only matters if you set unicode="yes" in /etc/rc.conf.
# For a list of valid sets, run `dumpkeys --help`
# Some fonts map AltGr-E to the currency symbol instead of the Euro.
# To fix this, set to "yes"
# Copyright (c) 2007-2015 The OpenRC Authors.
# See the Authors file at the top-level directory of this distribution and
# This file is part of OpenRC. It is subject to the license terms in
# the LICENSE file found in the top-level directory of this
# distribution and at
# This file may not be copied, modified, propagated, or distributed
# except according to the terms contained in the LICENSE file.
description="Applies a keymap for the consoles."
provide keymaps
need localmount termencoding
after bootmisc
keyword -docker -lxc -openvz -prefix -systemd-nspawn -uml -vserver -xenu
: ${unicode:=$UNICODE}
: ${keymap:=$KEYMAP}
: ${extended_keymaps:=$EXTENDED_KEYMAPS}
: ${windowkeys:=$SET_WINDOWSKEYS}
: ${fix_euro:=$FIX_EURO}
: ${dumpkeys_charset:=${DUMPKEYS_CHARSET}}
if [ -z "$keymap" ]; then
eerror "You need to setup keymap in /etc/conf.d/${0##*/} first"
return 1
local ttydev=/dev/tty n=
[ -d /dev/vc ] && ttydev=/dev/vc/
# Force linux keycodes for PPC.
if [ -f /proc/sys/dev/mac_hid/keyboard_sends_linux_keycodes ]; then
echo 1 > /proc/sys/dev/mac_hid/keyboard_sends_linux_keycodes
local wkeys= kmode="-a" msg="ASCII"
if yesno $unicode; then
yesno $windowkeys && wkeys="windowkeys"
# Set terminal encoding to either ASCII or UNICODE.
# See utf-8(7) for more information.
ebegin "Setting keyboard mode [$msg]"
while [ $n -le $ttyn ]; do
kbd_mode $kmode -C $ttydev$n
: $(( n += 1 ))
eend 0
ebegin "Loading key mappings [$keymap]"
loadkeys -q $wkeys $keymap $extended_keymaps
eend $? "Error loading key mappings" || return $?
if yesno $fix_euro; then
ebegin "Fixing font for euro symbol"
# Fix some fonts displaying the Euro, #173528.
echo "altgr keycode 18 = U+20AC" | loadkeys -q -
eend $?
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment