summaryrefslogtreecommitdiffstats
path: root/hook
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2013-05-27 11:55:47 +0200
committerGravatar Christian Hesse <mail@eworm.de>2013-05-27 11:55:47 +0200
commiteb3abcaf76209364b85dd5cd1e3afe39b525b1db (patch)
tree2def61b6209150772da68cb65a9e49d1f99a33dc /hook
parent3ca6032ac8e930e323fce9fa720fc22ed8137275 (diff)
downloadmkinitcpio-chkeymap-eb3abcaf76209364b85dd5cd1e3afe39b525b1db.tar.gz
mkinitcpio-chkeymap-eb3abcaf76209364b85dd5cd1e3afe39b525b1db.tar.zst
Initial import0.1.0
Diffstat (limited to 'hook')
-rw-r--r--hook/chkeymap25
1 files changed, 25 insertions, 0 deletions
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"
+}