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

Bug#376310: kbd-chooser: install keymap to target system before initramfs image is generated



Package: kbd-chooser
Version: 1.28
Severity: wishlist
Tags: patch

In order to make it possible for initramfs generators to support the users keymap, it would be good if it's installed into the target system before the initramfs image is generated.

The attached patch moves the finish-install.d script to post-base-installer.d and changes it to install the console-* packages at the same time. If the console is via serial or no keymap was chosen, no packages are installed and no keymap generated (which should mimic the old behaviour).

Regards,
David Härdeman
Index: debian/postinst
===================================================================
--- debian/postinst	(revision 38567)
+++ debian/postinst	(working copy)
@@ -6,9 +6,4 @@
 
 kbd-chooser
 
-db_get debian-installer/serial-console
-if [ "$RET" = false ]; then
-	apt-install console-tools console-data console-common || true
-fi
-
 exit 0
Index: debian/finish-install
===================================================================
--- debian/finish-install	(revision 38567)
+++ debian/finish-install	(working copy)
@@ -2,14 +2,22 @@
 
 . /usr/share/debconf/confmodule
 
+# Silently exit if we're using a serial console
+db_get debian-installer/serial-console
+if [ "$RET" != false ]; then
+	exit 0
+
+fi
+
+# Silently exit if no keymap is set
 db_get debian-installer/keymap
 KEYMAP=$RET
-if [ -z "$KEYMAP" ]; 
-then
-	# keymap not set; probably didn't call kbd-chooser
+if [ -z "$KEYMAP" ]; then
 	exit 0
 fi
 
+apt-install console-tools console-data console-common || true
+
 # Install non-Unicode variants of Turkish keymaps
 if [ "$KEYMAP" = "trqu" ]; then
 	KEYMAP="trq"
@@ -20,19 +28,16 @@
 	db_set debian-installer/keymap $KEYMAP
 fi
 
-db_get debian-installer/serial-console
-if [ "$RET" = "false" ] ; then
-	# FIXME Workaround to install some keymaps properly
-	case "$KEYMAP" in
-		trq|trf|hebrew|lt|lv-latin4|ua)
-			kbd_mode_temp="ascii" ;;
-		*)
-			kbd_mode_temp=""      ;;
-	esac
+# FIXME Workaround to install some keymaps properly
+case "$KEYMAP" in
+	trq|trf|hebrew|lt|lv-latin4|ua)
+		kbd_mode_temp="ascii" ;;
+	*)
+		kbd_mode_temp=""      ;;
+esac
 
-	[ -n "$kbd_mode_temp" ] && kbd-mode --$kbd_mode_temp
-	chroot /target install-keymap $KEYMAP
-	[ -n "$kbd_mode_temp" ] && kbd-mode --unicode
-fi
+[ -n "$kbd_mode_temp" ] && kbd-mode --$kbd_mode_temp
+chroot /target install-keymap $KEYMAP
+[ -n "$kbd_mode_temp" ] && kbd-mode --unicode
 
 exit 0
Index: debian/rules
===================================================================
--- debian/rules	(revision 38567)
+++ debian/rules	(working copy)
@@ -21,7 +21,7 @@
 	dh_clean -k
 	dh_installdirs
 	$(MAKE) install DESTDIR=$(CURDIR)/debian/kbd-chooser
-	install -m0755 debian/finish-install debian/$(PACKAGE)/usr/lib/finish-install.d/70kbd-chooser
+	install -m0755 debian/finish-install debian/$(PACKAGE)/usr/lib/post-base-installer.d/70kbd-chooser
 	install -m0644 debian/S55kbd-chooser debian/$(PACKAGE)/lib/debian-installer-startup.d/S55kbd-chooser
 
 binary-indep: 
Index: debian/dirs
===================================================================
--- debian/dirs	(revision 38567)
+++ debian/dirs	(working copy)
@@ -1,3 +1,3 @@
 usr/bin
-usr/lib/finish-install.d
+usr/lib/post-base-installer.d
 lib/debian-installer-startup.d

Reply to: