[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Preliminary patches for console-setup (for g-i)



Hi,

console-setup is indeed quite hmm interesting to dig into. Please find
attached a few patches, which *might* help get to a slightly less
scary situation.

Summary:
========

 - 0001-Try-and-cp-console-setup-as-well.patch: I've described its
   effects in [1].

    1. http://lists.debian.org/debian-boot/2010/02/msg00334.html


 - 0002-Call-setxkbmap-in-postinst-if-available.patch: Checks for
   setxkbmap, for $DISPLAY, and for keyboard_present before calling
   setxkbmap accordingly. That's what I mentioned at the end of [1].


 - 0003-Try-and-preseed-a-bit-using-internal-stuff-only-for.patch:
   While I was looking for strings I could preseed the installed
   system with (as it's done for kbd-chooser), I've noticed c-s was
   using a bunch of them for internal use, so I chose to preseed using
   those (reverting the first patch at the same time). Once that done,
   the proper “model” (the question seems to be
   keyboard-configuration/model) which was selected in the 3rd screen
   in d-i was defaulted to when the installed system's screen showed
   up (which wouldn't be the case with a stock console-setup); but
   that screen still showed up, which isn't quite perfect yet…

   Then, I tried to set the keyboard-configuration/model bits as
   “seen” but it didn't seem to work; the config script seems to
   un-see it in various cases ($XKBMODEL being empty/unset), and since
   I've spent too much time on that already, I'll leave the maintainer
   speak up and come up with an elegant solution. :)


Conclusion:
===========

At the very least, without copying any file, just by pushing some
strings through debconf-set-selections, the proper entry (already
chosen in the very first screen) gets defaulted to; and keymap is set
up accordingly during the whole setup. That's not the case for VT$n
consoles, though, I guess it could be done by calling the appropriate
tool from the same place as for setxkbmap, though.

FWIW, I've tried both:
  Français → France    → Français – Autre          (fr/oss)
  Dutch    → Nederland → USA, Dvorak International

That's not really proper and systematic testing, but better than
nothing, I hope. :)

Mraw,
KiBi.
Try and cp console-setup as well.
--- a/packages/console-setup/debian/console-setup-udeb.base-installer
+++ b/packages/console-setup/debian/console-setup-udeb.base-installer
@@ -15,6 +15,7 @@ set -e
 
 if keyboard_present; then
     mkdir -p /target/etc/default
+    cp -a /etc/default/console-setup /target/etc/default/
     cp -a /etc/default/keyboard /target/etc/default/
     apt-install keyboard-configuration || true
     apt-install console-setup || true
Call setxkbmap in postinst if available.

“which” can’t be used as it’s not available in the very basic shell at
this point of the installlation process.
--- a/packages/console-setup/debian/keyboard-configuration.postinst
+++ b/packages/console-setup/debian/keyboard-configuration.postinst
@@ -70,4 +70,10 @@ then
     setupcon --force --save
 fi
 
+# There's no 'which' in d-i's shell:
+SETXKBMAP=/usr/bin/setxkbmap
+if [ -x "$SETXKBMAP" ] && [ ! -z "$DISPLAY" ] && keyboard_present; then
+    $SETXKBMAP "$layout" "$variant" $options
+fi
+
 #DEBHELPER#
Try and preseed a bit, using internal stuff only for now.
--- a/packages/console-setup/debian/console-setup-udeb.base-installer
+++ b/packages/console-setup/debian/console-setup-udeb.base-installer
@@ -14,9 +14,20 @@ set -e
 # }
 
 if keyboard_present; then
-    mkdir -p /target/etc/default
-    cp -a /etc/default/console-setup /target/etc/default/
-    cp -a /etc/default/keyboard /target/etc/default/
+    # Disable direct copy:
+    #mkdir -p /target/etc/default
+    #cp -a /etc/default/console-setup /target/etc/default/
+    #cp -a /etc/default/keyboard /target/etc/default/
+
+    # Try and preseed instead:
+    for i in layoutcode modelcode optionscode variantcode; do
+    db_get keyboard-configuration/$i
+    LC_ALL=C chroot /target debconf-set-selections <<EOF
+d-i keyboard-configuration/$i string $RET
+EOF
+    done
+
+    # Trigger installation:
     apt-install keyboard-configuration || true
     apt-install console-setup || true
 fi

Attachment: signature.asc
Description: Digital signature


Reply to: