-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 /root/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 [ ! -z "${KBD}" ]; then
+ kbd="${KBD}"
+fi
+if [ ! -z "${CSLAYOUT}" ]; then
+ cslayout="${CSLAYOUT}"
+fi
+if [ ! -z "${CSVARIANT}" ]; then
+ csvariant="${CSVARIANT}"
+fi
+if [ ! -z "${CSMODEL}" ]; then
+ csmodel="${CSMODEL}"
+fi
+
+if [ -x /root/bin/setupcon ] && [ -f /root/etc/default/console-setup ]; then
+ if [ "$cslayout" ]; then
+ chroot /root sed -i "s/^XKBLAYOUT=.*/XKBLAYOUT=\"$cslayout\"/" \