From eb3abcaf76209364b85dd5cd1e3afe39b525b1db Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 27 May 2013 11:55:47 +0200 Subject: Initial import --- etc/05-keymap.conf | 5 +++++ etc/vconsole.conf | 2 ++ hook/chkeymap | 25 +++++++++++++++++++++++++ install/chkeymap | 9 +++++++++ 4 files changed, 41 insertions(+) create mode 100644 etc/05-keymap.conf create mode 100644 etc/vconsole.conf create mode 100644 hook/chkeymap create mode 100644 install/chkeymap diff --git a/etc/05-keymap.conf b/etc/05-keymap.conf new file mode 100644 index 0000000..18b17b1 --- /dev/null +++ b/etc/05-keymap.conf @@ -0,0 +1,5 @@ +Section "InputClass" + Identifier "Keyboard Defaults" + MatchIsKeyboard "true" + Option "XkbLayout" "en" +EndSection diff --git a/etc/vconsole.conf b/etc/vconsole.conf new file mode 100644 index 0000000..9c179b7 --- /dev/null +++ b/etc/vconsole.conf @@ -0,0 +1,2 @@ +KEYMAP="en" +FONT="ter-116b" diff --git a/hook/chkeymap b/hook/chkeymap new file mode 100644 index 0000000..0f0f5a9 --- /dev/null +++ b/hook/chkeymap @@ -0,0 +1,25 @@ +#!/bin/sh + +run_latehook() { + local newroot="/new_root/" + + if [[ "${keymap}" = "interactive" ]]; then + echo + echo -n "Please give keymap to use: " + read keymap + fi + msg ":: Setting keymap for main system to '${keymap}'..." + sed -i "/^KEYMAP=/c KEYMAP=\"${keymap}\"" "${newroot}/etc/vconsole.conf" + sed -i "/XkbLayout/c Option \"XkbLayout\" \"${keymap}\"" "${newroot}/etc/X11/xorg.conf.d/05-keymap.conf" + + if [[ "${timezone}" = "interactive" ]]; then + echo + echo -n "Please give timezone to use: " + read timezone + fi + if [[ -z "${timezone}" ]] || [[ ! -e "${newroot}/usr/share/zoneinfo/${timezone}" ]]; then + timezone="UTC" + fi + msg ":: Setting timezone for main system to '${timezone}'..." + ln -sf "/usr/share/zoneinfo/${timezone}" "${newroot}/etc/localtime" +} diff --git a/install/chkeymap b/install/chkeymap new file mode 100644 index 0000000..1398064 --- /dev/null +++ b/install/chkeymap @@ -0,0 +1,9 @@ +#!/bin/sh + +build() { + add_runscript +} + +help() { + echo "This hook changes system keymap and timezone from inside initramfs." +} -- cgit v1.2.3-70-g09d2