summaryrefslogtreecommitdiffstats
path: root/install/keymap
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2011-07-11 04:12:23 +0200
committerDave Reisner <dreisner@archlinux.org>2011-07-24 00:43:13 +0200
commit7143433a883287b3dc74288e92100f78443f386f (patch)
tree3b207dc256ecf7767262ab38a1d1a70c9f478131 /install/keymap
parentd8505d4a4b646083ccdc959713951cb8174bbf47 (diff)
downloadmkinitcpio-7143433a883287b3dc74288e92100f78443f386f.tar.gz
mkinitcpio-7143433a883287b3dc74288e92100f78443f386f.tar.xz
keymap/consolefont: source rc.conf properly from $BASEDIR
This is partially in response to FS#24685, which should hopefully cut back on configuration duplication on non-sysvinit systems. This does, however, also fix a bug with keymap/consolefont pulling the wrong rc.conf when BASEDIR is not '/' or unset. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Diffstat (limited to 'install/keymap')
-rw-r--r--install/keymap24
1 files changed, 14 insertions, 10 deletions
diff --git a/install/keymap b/install/keymap
index 34b744a..2cf4d15 100644
--- a/install/keymap
+++ b/install/keymap
@@ -1,18 +1,22 @@
#!/bin/bash
build() {
- SCRIPT=keymap
- eval "$(grep -E "^(LOCALE|KEYMAP)=" /etc/rc.conf)"
- if [[ $KEYMAP ]]; then
- if [[ $LOCALE = *[Uu][Tt][Ff]-8 ]]; then
- printf '%s\n' "UTF8=yes" > "$BUILDROOT/keymap.utf8"
- /bin/loadkeys -q -u $KEYMAP -b > "$BUILDROOT/keymap.bin"
- else
- printf '%s\n' "UTF8=no" > "$BUILDROOT/keymap.utf8"
- /bin/loadkeys -q $KEYMAP -b > "$BUILDROOT/keymap.bin"
+ # subshell to avoid namespace pollution
+ (
+ . "$BASEDIR/etc/rc.conf"
+ if [[ $KEYMAP ]]; then
+ if [[ $LOCALE = *[Uu][Tt][Ff]-8 ]]; then
+ printf '%s\n' "UTF8=yes" > "$BUILDROOT/keymap.utf8"
+ /bin/loadkeys -q -u $KEYMAP -b > "$BUILDROOT/keymap.bin"
+ else
+ printf '%s\n' "UTF8=no" > "$BUILDROOT/keymap.utf8"
+ /bin/loadkeys -q $KEYMAP -b > "$BUILDROOT/keymap.bin"
+ fi
fi
- fi
+ )
+
+ (( $? == 0 )) && SCRIPT=keymap
}
help() {