-for x in $(cat /proc/cmdline); do
- case $x in
- kbd-chooser/method=*)
- kbd=${x#kbd-chooser/method=}
- ;;
- console-setup/layoutcode=*)
- cslayout=${x#console-setup/layoutcode=}
- ;;
- console-setup/variantcode=*)
- csvariant=${x#console-setup/variantcode=}
- ;;
- esac
-done
-
-if [ "$cslayout" ] && [ -x /root/bin/setupcon ] && \
- [ -f /etc/default/console-setup ]; then
- chroot /root sed -i "s/^XKBLAYOUT=.*/XKBLAYOUT=\"$cslayout\"/" \
- /etc/default/console-setup
- if [ "$csvariant" ]; then
- chroot /root sed -i "s/^XKBVARIANT=.*/XKBVARIANT=\"$csvariant\"/" \
+# commandline
+if [ -n "${KBD}" ]; then
+ kbd="${KBD}"
+else
+ kbd=us
+fi
+
+really_export kbd
+
+if [ -n "${KLAYOUT}" ]; then
+ cslayout="${KLAYOUT}"
+fi
+if [ -n "${KVARIANT}" ]; then
+ csvariant="${KVARIANT}"
+fi
+if [ -n "${KMODEL}" ]; then
+ csmodel="${KMODEL}"
+fi
+
+if [ -x /root/bin/setupcon ] && [ -f /root/etc/default/console-setup ]; then
+ if [ "$cslayout" ]; then
+ chroot /root sed -i "s/^XKBLAYOUT=.*/XKBLAYOUT=\"$cslayout\"/" \