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

Re: Info provided, help needed!



On Tue, Jan 25, 2011 at 12:11:53PM +0100, Marco Amadori wrote:
> This bug seems to rely on two missing bits on two packages (patches included).
> 
> the package "live-build" does not include console-setup-udeb in the cdrom 
> "pool/" directory and live-installer do not "Depends:" on console-setup-udeb.
> 
> So the "/target" system have default "/etc/default/keyboard" file instead of a 
> proper one.

Here's an alternative approach which I think is neater, because it
follows along with Daniel's previous attempt to fix this bug.  The
attached patch series reconfigures keyboard-configuration as well as
console-setup, and rearranges things a bit so that it actually
reconfigures effectively based on the information kbd-chooser provides
to /target in its post-base-installer hook.

So far I've only done a single test of this with a British English
keymap, but it worked fine for that case.  I plan to also test some
scenario where console-setup would normally use a different codeset to
see if that works.

Please review and comment.  I can go ahead and push these patches to
master if people like them.

> Fixing those two above mentioned quirks is not enough it seems, because the 
> resulting target, although having a proper configuration file, still needs a 
> "setupcon" after reboot in order to have things working.

I did not have this problem in my test.  (I don't think it would be
release-critical even if I did; this sort of problem is often a boot
race and likely only affects the console, not X.)

Cheers,

-- 
Colin Watson                                       [cjwatson@debian.org]
>From 8fd2fdf36ca109c85ed9f5113a497e9cec91e910 Mon Sep 17 00:00:00 2001
From: Colin Watson <cjwatson@debian.org>
Date: Wed, 26 Jan 2011 01:31:21 +0000
Subject: [PATCH 1/3] Move console-setup hook from live-installer.d to post-base-installer.d, so that it can pick up the value of debian-installer/keymap set by kbd-chooser's post-base-installer hook.

---
 debian/changelog                                   |    8 ++++++
 debian/live-installer.install                      |    1 +
 live-installer.d/console-setup                     |   24 --------------------
 .../25live-installer-console-setup                 |   24 ++++++++++++++++++++
 4 files changed, 33 insertions(+), 24 deletions(-)
 delete mode 100755 live-installer.d/console-setup
 create mode 100755 post-base-installer.d/25live-installer-console-setup

diff --git a/debian/changelog b/debian/changelog
index 01e8ea4..bc38ffd 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+live-installer (30) UNRELEASED; urgency=low
+
+  * Move console-setup hook from live-installer.d to post-base-installer.d,
+    so that it can pick up the value of debian-installer/keymap set by
+    kbd-chooser's post-base-installer hook.
+
+ -- Colin Watson <cjwatson@debian.org>  Wed, 26 Jan 2011 01:30:15 +0000
+
 live-installer (29) unstable; urgency=low
 
   [ Otavio Salvador ]
diff --git a/debian/live-installer.install b/debian/live-installer.install
index d96b1cd..6f6a5ba 100644
--- a/debian/live-installer.install
+++ b/debian/live-installer.install
@@ -1,3 +1,4 @@
 live-installer.d	/usr/lib
+post-base-installer.d	/usr/lib
 finish-install.d	/usr/lib
 support/*		/lib/live-installer
diff --git a/live-installer.d/console-setup b/live-installer.d/console-setup
deleted file mode 100755
index 0ab0b5b..0000000
--- a/live-installer.d/console-setup
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/sh -e
-
-# Unfortunately, we can't use in-target here as this doesn't allow to set the
-# debconf frontend to noninteractive.
-
-. /lib/chroot-setup.sh
-
-if ! chroot_setup; then
-	logger -t live-installer -- "Unexpected error; command not executed: '$@'"
-	exit 1
-fi
-
-DEBIAN_FRONTEND=noninteractive
-export DEBIAN_FRONTEND
-
-# Reconfigure console-setup
-if [ -e /target/var/lib/dpkg/info/console-setup.postinst ]; then
-	log-output -t live-installer chroot /target \
-	dpkg-reconfigure --no-reload console-setup
-
-	chroot /target setupcon --save-only
-fi
-
-chroot_cleanup
diff --git a/post-base-installer.d/25live-installer-console-setup b/post-base-installer.d/25live-installer-console-setup
new file mode 100755
index 0000000..0ab0b5b
--- /dev/null
+++ b/post-base-installer.d/25live-installer-console-setup
@@ -0,0 +1,24 @@
+#!/bin/sh -e
+
+# Unfortunately, we can't use in-target here as this doesn't allow to set the
+# debconf frontend to noninteractive.
+
+. /lib/chroot-setup.sh
+
+if ! chroot_setup; then
+	logger -t live-installer -- "Unexpected error; command not executed: '$@'"
+	exit 1
+fi
+
+DEBIAN_FRONTEND=noninteractive
+export DEBIAN_FRONTEND
+
+# Reconfigure console-setup
+if [ -e /target/var/lib/dpkg/info/console-setup.postinst ]; then
+	log-output -t live-installer chroot /target \
+	dpkg-reconfigure --no-reload console-setup
+
+	chroot /target setupcon --save-only
+fi
+
+chroot_cleanup
-- 
1.7.2.3

>From 09ae1f6deddd0c3abb6b9b68e4c74b323e09e814 Mon Sep 17 00:00:00 2001
From: Colin Watson <cjwatson@debian.org>
Date: Wed, 26 Jan 2011 01:33:11 +0000
Subject: [PATCH 2/3] skip post-base-installer hook if live-installer/enable is false

---
 .../25live-installer-console-setup                 |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/post-base-installer.d/25live-installer-console-setup b/post-base-installer.d/25live-installer-console-setup
index 0ab0b5b..6cb3055 100755
--- a/post-base-installer.d/25live-installer-console-setup
+++ b/post-base-installer.d/25live-installer-console-setup
@@ -3,6 +3,11 @@
 # Unfortunately, we can't use in-target here as this doesn't allow to set the
 # debconf frontend to noninteractive.
 
+if [ "$(debconf-get live-installer/enable)" != true ]; then
+	# live-installer wasn't run.  Skip this.
+	exit 0
+fi
+
 . /lib/chroot-setup.sh
 
 if ! chroot_setup; then
-- 
1.7.2.3

>From 572aca09f4c188ab7a056542c4d3e6b1028209c3 Mon Sep 17 00:00:00 2001
From: Colin Watson <cjwatson@debian.org>
Date: Wed, 26 Jan 2011 01:35:14 +0000
Subject: [PATCH 3/3] Try to reconfigure keyboard-configuration as well as console-setup. Remove existing configuration files in /target first so that this actually does effective reconfiguration (Closes: #603974).

---
 debian/changelog                                   |    3 ++
 .../25live-installer-console-setup                 |   26 +++++++++++++++++++-
 2 files changed, 28 insertions(+), 1 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index bc38ffd..4946f0d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,6 +3,9 @@ live-installer (30) UNRELEASED; urgency=low
   * Move console-setup hook from live-installer.d to post-base-installer.d,
     so that it can pick up the value of debian-installer/keymap set by
     kbd-chooser's post-base-installer hook.
+  * Try to reconfigure keyboard-configuration as well as console-setup.
+    Remove existing configuration files in /target first so that this
+    actually does effective reconfiguration (Closes: #603974).
 
  -- Colin Watson <cjwatson@debian.org>  Wed, 26 Jan 2011 01:30:15 +0000
 
diff --git a/post-base-installer.d/25live-installer-console-setup b/post-base-installer.d/25live-installer-console-setup
index 6cb3055..c1696ae 100755
--- a/post-base-installer.d/25live-installer-console-setup
+++ b/post-base-installer.d/25live-installer-console-setup
@@ -18,11 +18,35 @@ fi
 DEBIAN_FRONTEND=noninteractive
 export DEBIAN_FRONTEND
 
-# Reconfigure console-setup
+# Reconfigure keyboard-configuration and/or console-setup as appropriate.
+
+if [ -e /etc/default/keyboard ]; then
+	# console-setup-udeb will already have copied a reasonable
+	# /etc/default/keyboard into the chroot.  /etc/default/console-setup
+	# may still need work.
+	rm -f /target/etc/default/console-setup
+else
+	# kbd-chooser will have set debian-installer/keymap, but we need to
+	# clear out any existing configuration files in order for that to be
+	# noticed.
+	rm -f /target/etc/default/keyboard /target/etc/default/console-setup
+fi
+
+do_setupcon=
+if [ -e /target/var/lib/dpkg/info/keyboard-configuration.postinst ]; then
+	log-output -t live-installer chroot /target \
+	dpkg-reconfigure --no-reload keyboard-configuration
+
+	do_setupcon=1
+fi
 if [ -e /target/var/lib/dpkg/info/console-setup.postinst ]; then
 	log-output -t live-installer chroot /target \
 	dpkg-reconfigure --no-reload console-setup
 
+	do_setupcon=1
+fi
+
+if [ "$do_setupcon" ] && chroot /target which setupcon >/dev/null 2>&1; then
 	chroot /target setupcon --save-only
 fi
 
-- 
1.7.2.3


Reply to: