Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Drake <dsd@laptop.org>2012-09-12 19:48:05 (GMT)
committer Daniel Drake <dsd@laptop.org>2012-09-12 19:48:05 (GMT)
commit5257c94c119b2b20de489fbdb2a05597a1fe15d0 (patch)
tree3ebb45230d3d595ad24449e4ba20fefa110a991d
parente49c77cd7e14e84ffe254037eb346fa1833b1d19 (diff)
base: allow overriding of default keyboard/language (#6689)
We have found cases where deployments want to override what is set in manufacturing data and provide their own keyboard/language defaults. Hook up with olpc-configure's new scheme for overriding defaults here.
-rw-r--r--modules/base/README23
-rw-r--r--modules/base/kspost.50.lang_kbd_overrides.sh22
2 files changed, 45 insertions, 0 deletions
diff --git a/modules/base/README b/modules/base/README
index b8b2fe9..c7ad73a 100644
--- a/modules/base/README
+++ b/modules/base/README
@@ -43,3 +43,26 @@ Set the default timezone for the build. This can be later overridden by the
user in the Sugar control panel. The value should be an entry from
/usr/share/zoneinfo e.g. America/Managua
+- default_language (default unset)
+Override the default language used in the build. Normally, the language
+is automatically detected from the manufacturing data of the laptop on first
+boot. Only set this if you know of a good reason that you want to override
+the factory-programmed default.
+
+- default_kbd_model (default unset)
+Override the default XKB keyboard model used in the build. Normally, keyboard
+settings are automatically detected from the manufacturing data of the laptop
+on first boot. Only set this if you know of a good reason that you want to
+override the factory-programmed default.
+
+- default_kbd_layout (default unset)
+Override the default XKB keyboard layout used in the build. Normally, keyboard
+settings are automatically detected from the manufacturing data of the laptop
+on first boot. Only set this if you know of a good reason that you want to
+override the factory-programmed default.
+
+- default_kbd_variant (default unset)
+Override the default XKB keyboard variant used in the build. Normally, keyboard
+settings are automatically detected from the manufacturing data of the laptop
+on first boot. Only set this if you know of a good reason that you want to
+override the factory-programmed default.
diff --git a/modules/base/kspost.50.lang_kbd_overrides.sh b/modules/base/kspost.50.lang_kbd_overrides.sh
new file mode 100644
index 0000000..6e4263c
--- /dev/null
+++ b/modules/base/kspost.50.lang_kbd_overrides.sh
@@ -0,0 +1,22 @@
+# Copyright (C) 2012 One Laptop Per Child
+# Licensed under the terms of the GNU GPL v2 or later; see COPYING for details.
+
+. $OOB__shlib
+
+default_lang=$(read_config base default_language)
+default_kbd_model=$(read_config base default_kbd_model)
+default_kbd_variant=$(read_config base default_kbd_variant)
+default_kbd_layout=$(read_config base default_kbd_layout)
+[ -z "$default_lang" ] && [ -z "$default_kbd_model" ] && \
+ [ -z "$default_kbd_variant" ] && [ -z "$default_kbd_layout" ] && \
+ exit 0
+
+echo "mkdir -p /etc/olpc-configure"
+[ -n "$default_lang" ] && \
+ echo "echo '$default_lang' > /etc/olpc-configure/default-language"
+[ -n "$default_kbd_model" ] && \
+ echo "echo '$default_kbd_model' > /etc/olpc-configure/default-kbd-model"
+[ -n "$default_kbd_variant" ] && \
+ echo "echo '$default_kbd_variant' > /etc/olpc-configure/default-kbd-variant"
+[ -n "$default_kbd_layout" ] && \
+ echo "echo '$default_kbd_layout' > /etc/olpc-configure/default-kbd-layout"