diff -pruN 2.5.1-1/debian/changelog 2.5.1-1ubuntu1/debian/changelog
--- 2.5.1-1/debian/changelog	2022-10-08 19:24:51.000000000 +0000
+++ 2.5.1-1ubuntu1/debian/changelog	2022-11-16 00:21:19.000000000 +0000
@@ -1,3 +1,30 @@
+kbd (2.5.1-1ubuntu1) lunar; urgency=medium
+
+  * Merge from Debian unstable.  Remaining changes:
+    - Add setfont, kbd_mode, and loadkeys to initramfs for console-setup.
+    - Added initramfs hook to have setfont/loadkeys available in initramfs.
+    - Use ckbcomp to get the keyboard layout if other data files are not
+      available.
+    - Change loadkeys to find any console not in raw mode when invoked
+      without an explicit console parameter, in case the foreground console
+      is in raw mode.
+    - Add setvtrgb to kbd-udeb.
+    - Fix incorrect keymap sanity check in loadkeys_ckbcomp.diff.
+    - debian/control: Depend on console-setup | console-setup-mini, since
+      console-setup-mini also Depends on kbd now through console-setup-linux.
+    - debian/patches/loadkeys_find_usable_console.diff: fix wrong type
+      argument to ioctl(..., KDGKBMODE), which causes consoles to not be
+      correctly detected on 64-bit archs.  LP: #1621824.
+
+  * Removed obsolete patches/changes:
+    -  d/p/fix_use_after_free.patch to clean up a use-after-free of
+       pipe_cmd, now merged upstream.
+
+  * New upstream release drops deprecated ioctls removed in Linux v5.12.
+    LP: #1996619.
+
+ -- dann frazier <dannf@ubuntu.com>  Tue, 15 Nov 2022 17:21:19 -0700
+
 kbd (2.5.1-1) unstable; urgency=medium
 
   * Team upload.
@@ -21,6 +48,59 @@ kbd (2.5.1-1) unstable; urgency=medium
 
  -- Andreas Henriksson <andreas@fatal.se>  Sat, 08 Oct 2022 21:24:51 +0200
 
+kbd (2.3.0-3ubuntu4) jammy; urgency=high
+
+  * No change rebuild for ppc64el baseline bump.
+
+ -- Julian Andres Klode <juliank@ubuntu.com>  Thu, 24 Mar 2022 13:06:40 +0100
+
+kbd (2.3.0-3ubuntu3) impish; urgency=medium
+
+  * No-change rebuild to build packages with zstd compression.
+
+ -- Matthias Klose <doko@ubuntu.com>  Thu, 07 Oct 2021 12:13:36 +0200
+
+kbd (2.3.0-3ubuntu2) hirsute; urgency=medium
+
+  * No-change rebuild to drop the udeb package.
+
+ -- Matthias Klose <doko@ubuntu.com>  Mon, 22 Feb 2021 10:34:16 +0100
+
+kbd (2.3.0-3ubuntu1) hirsute; urgency=low
+
+  * Merge from Debian unstable.  Remaining changes:
+    - Add setfont, kbd_mode, and loadkeys to initramfs for console-setup.
+    - Added initramfs hook to have setfont/loadkeys available in initramfs.
+    - Use ckbcomp to get the keyboard layout if other data files are not
+      available.
+    - Change loadkeys to find any console not in raw mode when invoked
+      without an explicit console parameter, in case the foreground console
+      is in raw mode.
+    - Add setvtrgb to kbd-udeb.
+    - Fix incorrect keymap sanity check in loadkeys_ckbcomp.diff.
+    - debian/control: Depend on console-setup | console-setup-mini, since
+      console-setup-mini also Depends on kbd now through console-setup-linux.
+    - debian/patches/loadkeys_find_usable_console.diff: fix wrong type
+      argument to ioctl(..., KDGKBMODE), which causes consoles to not be
+      correctly detected on 64-bit archs.  LP: #1621824.
+
+  * Added d/p/fix_use_after_free.patch to clean up a use-after-free of
+    pipe_cmd
+
+  * Removed obsolete patches/changes:
+    - Simplify maintainer scripts for conffile removal, using new features
+      in debhelper 8.1.0.
+    - debian/patches/loadkeys_ckbcomp.diff: Include xmalloc.h to avoid
+      implicit declaration causing crashes with newer gcc. LP: #1631504.
+    - kbd_mode: Add -f option and don't perform dangerous mode switches
+      without it. In the back-ported fix kbd_mode exits with success, even
+      when the dangerous mode change is skipped, just prints an error, to not
+      break old scripts. (LP: #520546)
+    - Add d/p/fix-duplicate-progname.patch to fix duplicate progname linker
+      error under gcc-10 (LP: #1891316)
+
+ -- Dave Jones <dave.jones@canonical.com>  Sun, 11 Oct 2020 15:45:31 +0000
+
 kbd (2.3.0-3) unstable; urgency=medium
 
   * Team upload.
@@ -81,6 +161,52 @@ kbd (2.2.0-1) unstable; urgency=medium
 
  -- Andreas Henriksson <andreas@fatal.se>  Fri, 21 Aug 2020 13:52:04 +0200
 
+kbd (2.0.4-4ubuntu4) groovy; urgency=medium
+
+  * Add d/p/fix-duplicate-progname.patch to fix duplicate progname linker
+    error under gcc-10 (LP: #1891316)
+
+ -- Dave Jones <dave.jones@canonical.com>  Wed, 12 Aug 2020 12:01:20 +0100
+
+kbd (2.0.4-4ubuntu3) groovy; urgency=medium
+
+  * No change rebuild against new CET ABI.
+
+ -- Dimitri John Ledkov <xnox@ubuntu.com>  Fri, 10 Jul 2020 18:27:45 +0100
+
+kbd (2.0.4-4ubuntu2) eoan; urgency=medium
+
+  * kbd_mode: Add -f option and don't perform dangerous mode switches without
+    it. In the back-ported fix kbd_mode exits with success, even when the
+    dangerous mode change is skipped, just prints an error, to not break old
+    scripts. (LP: #520546)
+
+ -- Balint Reczey <rbalint@ubuntu.com>  Thu, 09 May 2019 17:22:51 +0200
+
+kbd (2.0.4-4ubuntu1) disco; urgency=low
+
+  * Merge from Debian unstable.  Remaining changes:
+    - Add setfont, kbd_mode, and loadkeys to initramfs for console-setup.
+    - Use ckbcomp to get the keyboard layout if other data files are not
+      available.
+    - Change loadkeys to find any console not in raw mode when invoked
+      without an explicit console parameter, in case the foreground console
+      is in raw mode.
+    - Simplify maintainer scripts for conffile removal, using new features
+      in debhelper 8.1.0.
+    - Add setvtrgb to kbd-udeb.
+    - Fix incorrect keymap sanity check in loadkeys_ckbcomp.diff.
+    - debian/control: Depend on console-setup | console-setup-mini, since
+      console-setup-mini also Depends on kbd now through console-setup-linux.
+    - Added initramfs hook to have setfont/loadkeys available in initramfs.
+    - debian/patches/loadkeys_find_usable_console.diff: fix wrong type argument
+      to ioctl(..., KDGKBMODE), which causes consoles to not be correctly
+      detected on 64-bit archs.  LP: #1621824.
+    - debian/patches/loadkeys_ckbcomp.diff: Include xmalloc.h to avoid implicit
+      declaration causing crashes with newer gcc. LP: #1631504.
+
+ -- Julian Andres Klode <juliank@ubuntu.com>  Mon, 12 Nov 2018 11:38:20 +0100
+
 kbd (2.0.4-4) unstable; urgency=medium
 
   * Team upload.
@@ -97,6 +223,30 @@ kbd (2.0.4-3) unstable; urgency=medium
 
  -- Andreas Henriksson <andreas@fatal.se>  Wed, 30 May 2018 19:22:04 +0200
 
+kbd (2.0.4-2ubuntu1) bionic; urgency=low
+
+  * Merge from Debian unstable.  Remaining changes:
+    - Add setfont, kbd_mode, and loadkeys to initramfs for console-setup.
+    - Use ckbcomp to get the keyboard layout if other data files are not
+      available.
+    - Change loadkeys to find any console not in raw mode when invoked
+      without an explicit console parameter, in case the foreground console
+      is in raw mode.
+    - Simplify maintainer scripts for conffile removal, using new features
+      in debhelper 8.1.0.
+    - Add setvtrgb to kbd-udeb.
+    - Fix incorrect keymap sanity check in loadkeys_ckbcomp.diff.
+    - debian/control: Depend on console-setup | console-setup-mini, since
+      console-setup-mini also Depends on kbd now through console-setup-linux.
+    - Added initramfs hook to have setfont/loadkeys available in initramfs.
+    - debian/patches/loadkeys_find_usable_console.diff: fix wrong type argument
+      to ioctl(..., KDGKBMODE), which causes consoles to not be correctly
+      detected on 64-bit archs.  LP: #1621824.
+    - debian/patches/loadkeys_ckbcomp.diff: Include xmalloc.h to avoid implicit
+      declaration causing crashes with newer gcc. LP: #1631504.
+ 
+ -- Julian Andres Klode <juliank@ubuntu.com>  Mon, 22 Jan 2018 14:49:48 +0100
+
 kbd (2.0.4-2) unstable; urgency=medium
 
   * Drop obsolete lsb-base dependency
@@ -120,6 +270,40 @@ kbd (2.0.4-1) unstable; urgency=medium
 
  -- Andreas Henriksson <andreas@fatal.se>  Tue, 11 Jul 2017 02:43:37 +0200
 
+kbd (2.0.3-2ubuntu3) zesty; urgency=medium
+
+  * debian/patches/loadkeys_ckbcomp.diff: Include xmalloc.h to avoid implicit
+    declaration causing crashes with newer gcc. LP: #1631504.
+
+ -- Jason Conti <jason.conti@gmail.com>  Thu, 13 Oct 2016 13:51:28 -0400
+
+kbd (2.0.3-2ubuntu2) yakkety; urgency=medium
+
+  * debian/patches/loadkeys_find_usable_console.diff: fix wrong type argument
+    to ioctl(..., KDGKBMODE), which causes consoles to not be correctly
+    detected on 64-bit archs.  LP: #1621824.    
+
+ -- Steve Langasek <steve.langasek@ubuntu.com>  Tue, 20 Sep 2016 10:53:30 -0700
+
+kbd (2.0.3-2ubuntu1) yakkety; urgency=low
+
+  * Merge from Debian unstable.  Remaining changes:
+    - Add setfont, kbd_mode, and loadkeys to initramfs for console-setup.
+    - Use ckbcomp to get the keyboard layout if other data files are not
+      available.
+    - Change loadkeys to find any console not in raw mode when invoked
+      without an explicit console parameter, in case the foreground console
+      is in raw mode.
+    - Simplify maintainer scripts for conffile removal, using new features
+      in debhelper 8.1.0.
+    - Add setvtrgb to kbd-udeb.
+    - Fix incorrect keymap sanity check in loadkeys_ckbcomp.diff.
+    - debian/control: Depend on console-setup | console-setup-mini, since
+      console-setup-mini also Depends on kbd now through console-setup-linux.
+    - Added initramfs hook to have setfont/loadkeys available in initramfs.
+
+ -- Mathieu Trudel-Lapierre <cyphermox@ubuntu.com>  Fri, 29 Apr 2016 23:50:28 -0400
+
 kbd (2.0.3-2) unstable; urgency=medium
 
   * Team upload.
@@ -214,6 +398,52 @@ kbd (1.15.5-2) unstable; urgency=medium
 
  -- Michael Schutte <michi@debian.org>  Sat, 25 Oct 2014 19:46:15 +0200
 
+kbd (1.15.5-1ubuntu4) wily; urgency=medium
+
+  * debian/conffiles.d/config: Disable automatic virtual console screen blank
+    - Don't blank screen on virtual consoles, because most systems running
+      without X are headless and when they are connected to a monitor for
+      debugging the screen should not be blank
+    - LP: #869017
+
+ -- Wesley Wiedenmeier <wesley.wiedenmeier@canonical.com>  Tue, 04 Aug 2015 18:32:04 +0000
+
+kbd (1.15.5-1ubuntu3) wily; urgency=medium
+
+  * Drop initramfs-tools dependency. It causes other providers of
+    linux-initramfs-tool (like dracut) to become uninstallable, and is an
+    ancient Ubuntu-ism which has never been forwarded, nor is it kbd's place
+    to dictate whether or not you should have an initramfs.
+
+ -- Martin Pitt <martin.pitt@ubuntu.com>  Tue, 08 Sep 2015 12:50:53 +0200
+
+kbd (1.15.5-1ubuntu2) vivid; urgency=medium
+
+  * debian/control: Depend on console-setup | console-setup-mini, since
+    console-setup-mini also Depends on kbd now through console-setup-linux.
+
+ -- Mathieu Trudel-Lapierre <mathieu-tl@ubuntu.com>  Wed, 04 Mar 2015 09:45:39 -0500
+
+kbd (1.15.5-1ubuntu1) raring; urgency=low
+
+  * Resynchronise with Debian.  Remaining changes:
+    - Add setfont, kbd_mode, and loadkeys to initramfs for console-setup.
+    - Use ckbcomp to get the keyboard layout if other data files are not
+      available.
+    - Depend on console-setup, and remove config file; we now only support
+      systems using console-setup and so it no longer serves a purpose. The
+      removed config file for console-screen has changed names from
+      /etc/init.d/console-screen.kbd.sh to /etc/init.d/kbd.
+    - Change loadkeys to find any console not in raw mode when invoked
+      without an explicit console parameter, in case the foreground console
+      is in raw mode.
+    - Simplify maintainer scripts for conffile removal, using new features
+      in debhelper 8.1.0.
+    - Add setvtrgb to kbd-udeb.
+  * Fix incorrect keymap sanity check in loadkeys_ckbcomp.diff.
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Mon, 18 Feb 2013 13:25:55 +0000
+
 kbd (1.15.5-1) unstable; urgency=low
 
   * New upstream release.
@@ -247,6 +477,46 @@ kbd (1.15.5-1) unstable; urgency=low
 
  -- Michael Schutte <michi@debian.org>  Sun, 17 Feb 2013 19:37:26 +0100
 
+kbd (1.15.3-9ubuntu4) raring; urgency=low
+
+  * Use autotools-dev to update config.guess and config.sub automatically.
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Sat, 09 Feb 2013 00:08:33 +0000
+
+kbd (1.15.3-9ubuntu3) raring; urgency=low
+
+  * Revert build-dependency from gettext:any to gettext, now that gettext is
+    Multi-Arch: foreign.
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Thu, 29 Nov 2012 15:18:21 +0000
+
+kbd (1.15.3-9ubuntu2) raring; urgency=low
+
+  * Restore setvtrgb to kbd-udeb, since rootskel uses it.  This appears to
+    have been lost in 1.15.2-3ubuntu1.
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Wed, 21 Nov 2012 12:41:46 +0000
+
+kbd (1.15.3-9ubuntu1) quantal; urgency=low
+
+  * Resynchronise with Debian.  Remaining changes:
+    - Add setfont, kbd_mode, and loadkeys to initramfs for console-setup.
+    - Use ckbcomp to get the keyboard layout if other data files are not
+      available.
+    - Depend on console-setup, and remove config file; we now only support
+      systems using console-setup and so it no longer serves a purpose. The
+      removed config file for console-screen has changed names from
+      /etc/init.d/console-screen.kbd.sh to /etc/init.d/kbd.
+    - Change loadkeys to find any console not in raw mode when invoked
+      without an explicit console parameter, in case the foreground console
+      is in raw mode.
+    - Simplify maintainer scripts for conffile removal, using new features
+      in debhelper 8.1.0.
+    - Build-depend on gettext:any, since we only need it to run tools at
+      build-time.
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Tue, 22 May 2012 23:47:28 +0100
+
 kbd (1.15.3-9) unstable; urgency=low
 
   * Revert the build-dependency change towards gettext:any and let the buildds
@@ -275,6 +545,30 @@ kbd (1.15.3-8) unstable; urgency=low
 
  -- Michael Schutte <michi@debian.org>  Sat, 28 Apr 2012 11:47:07 +0200
 
+kbd (1.15.3-7ubuntu1) quantal; urgency=low
+
+  * Resynchronise with Debian.  Remaining changes:
+    - Add setfont, kbd_mode, and loadkeys to initramfs for console-setup.
+    - Use ckbcomp to get the keyboard layout if other data files are not
+      available.
+    - Depend on console-setup, and remove config file; we now only support
+      systems using console-setup and so it no longer serves a purpose. The
+      removed config file for console-screen has changed names from
+      /etc/init.d/console-screen.kbd.sh to /etc/init.d/kbd.
+    - Change loadkeys to find any console not in raw mode when invoked
+      without an explicit console parameter, in case the foreground console
+      is in raw mode.
+    - Simplify maintainer scripts for conffile removal, using new features
+      in debhelper 8.1.0.
+    - Build-depend on gettext:any, since we only need it to run tools at
+      build-time.
+    - Fix cross-building:
+      + Use dh_auto_configure.
+      + Pass CC=$(DEB_HOST_GNU_TYPE)-gcc when cross-building contrib.
+  * Fix some previous mismerges and tidy up Ubuntu-specific patches.
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Fri, 27 Apr 2012 16:52:36 +0100
+
 kbd (1.15.3-7) unstable; urgency=low
 
   * Use dpkg-buildflags to pass build options on to the configure
@@ -365,6 +659,52 @@ kbd (1.15.3-1) unstable; urgency=low
 
  -- Michael Schutte <michi@debian.org>  Wed, 25 May 2011 21:48:07 +0200
 
+kbd (1.15.2-3ubuntu4) precise; urgency=low
+
+  * Fix cross-building (LP: #872422):
+    - Use dh_auto_configure.
+    - Pass CC=$(DEB_HOST_GNU_TYPE)-gcc when cross-building contrib.
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Sat, 31 Mar 2012 21:54:20 +0100
+
+kbd (1.15.2-3ubuntu3) precise; urgency=low
+
+  * Build-depend on gettext:any, since we only need it to run tools at
+    build-time.
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Sat, 31 Mar 2012 02:17:56 +0100
+
+kbd (1.15.2-3ubuntu2) precise; urgency=low
+
+  * Pre-Depend on a sufficient version of dpkg for dpkg-maintscript-helper.
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Sat, 11 Feb 2012 14:51:26 +0000
+
+kbd (1.15.2-3ubuntu1) oneiric; urgency=low
+
+  * Merge from debian unstable (LP: #779388). Remaining changes:
+    - Add setfont, kbd_mode, and loadkeys to initramfs for console-setup.
+    - Use ckbcomp to get the keyboard layout if other data files are not
+      available.
+    - Depend on console-setup, and remove config file; we now only
+      support systems using console-setup and so it no longer serves
+      a purpose. The removed config file for console-screen has changed
+      names from /etc/init.d/console-screen.kbd.sh to /etc/init.d/kbd.
+    - Change loadkeys to find any console not in raw mode when invoked
+      without an explicit console parameter. (In case the foreground
+      console is in raw mode.)
+    - Add a 'setvtrgb' utility to configure vt/console colors.
+  * debian/control:
+    - Bump Standards-Version to 3.9.2, no changes needed.
+    - Update Build-Depends for debhelper to version 8.1.0.
+  * Simplify maintainer scripts for conffile removal, using new
+    features in updated version of debhelper.
+  * Add 'setvtrgb' manpage to man8 makefile, so it will install.
+  * debian/rules: Move 'setvtrgb' binary to extra binaries, as udeb
+    binaries are now handled differently.
+
+ -- Allison Randal <allison@canonical.com>  Tue, 10 May 2011 14:10:03 +0200
+
 kbd (1.15.2-3) unstable; urgency=low
 
   * Bump Priority: to optional (while downgrading console-tools to extra),
@@ -510,6 +850,55 @@ kbd (1.15-2) unstable; urgency=low
 
  -- Michael Schutte <michi@uiae.at>  Fri, 24 Jul 2009 13:00:49 +0200
 
+kbd (1.15-1ubuntu5) natty; urgency=low
+
+  * src/setvtrgb.c: fix bug where the green and blue values of the
+    first tuple weren't being set properly
+
+ -- Dustin Kirkland <kirkland@ubuntu.com>  Thu, 17 Mar 2011 18:27:16 -0500
+
+kbd (1.15-1ubuntu4) natty; urgency=low
+
+  * src/setvtrgb.c, man/man8/setvtrgb.8, COPYING, debian/rules,
+    debian/copyright: LP: #730672
+    - Add a 'setvtrgb' utility to configure vt/console colors
+    - add to udeb (so that this can improve installer usability)
+    - add to /sbin, run by root
+    - update copyright statement
+
+ -- Dustin Kirkland <kirkland@ubuntu.com>  Tue, 08 Mar 2011 15:32:10 +0000
+
+kbd (1.15-1ubuntu3) lucid; urgency=low
+
+  * loadkeys: If not invoked with an explicit console parameter, try to find
+    any console not in raw mode.  This makes it safer to run loadkeys if the
+    foreground console might be in raw mode, for example if Plymouth or X
+    might be running.
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Fri, 12 Mar 2010 00:35:34 +0000
+
+kbd (1.15-1ubuntu2) lucid; urgency=low
+
+  * rebuild rest of main for armel armv7/thumb2 optimization;
+    UbuntuSpec:mobile-lucid-arm-gcc-v7-thumb2
+
+ -- Alexander Sack <asac@ubuntu.com>  Sat, 06 Mar 2010 13:29:36 +0100
+
+kbd (1.15-1ubuntu1) karmic; urgency=low
+
+  * Resynchronise with Debian. Remaining changes:
+    - Prefer console-setup to console-common and console-data.
+    - debian/console-screen.kbd.sh: Don't run at all if setupcon (from
+      console-setup) is present.
+    - Add setfont, kbd_mode, and loadkeys to initramfs for console-setup.
+    - Use ckbcomp to get the keyboard layout if other data files are not
+      available.
+    - Depend on console-setup, and remove /etc/init.d/console-screen.kbd.sh;
+      we now only support systems using console-setup and so it no longer
+      serves a purpose.
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Wed, 24 Jun 2009 17:10:18 +0100
+
 kbd (1.15-1) unstable; urgency=low
 
   * New upstream release.
@@ -538,6 +927,44 @@ kbd (1.15-1) unstable; urgency=low
 
  -- Michael Schutte <michi@uiae.at>  Fri, 20 Feb 2009 17:52:16 +0100
 
+kbd (1.14.1-4ubuntu4) jaunty; urgency=low
+
+  * debian/control: Depend on initramfs-tools so system is not potentially
+    rendered unbootable (LP: #358654).
+
+ -- Kees Cook <kees@ubuntu.com>  Thu, 09 Apr 2009 12:31:48 -0700
+
+kbd (1.14.1-4ubuntu3) jaunty; urgency=low
+
+  * Depend on console-setup, and remove /etc/init.d/console-screen.kbd.sh;
+    we now only support systems using console-setup and so it no longer
+    serves a purpose (LP: #282216).
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Mon, 16 Feb 2009 16:02:08 +0000
+
+kbd (1.14.1-4ubuntu2) jaunty; urgency=low
+
+  * Resynchronise debian/console-screen.kbd.sh with console-screen.sh from
+    console-tools, fixing dubious grepping of /etc/environment and
+    /etc/default/locale (LP: #18448).
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Thu, 20 Nov 2008 14:04:35 +0000
+
+kbd (1.14.1-4ubuntu1) jaunty; urgency=low
+
+  * Resynchronise with Debian. Remaining changes:
+    - Prefer console-setup to console-common and console-data.
+    - debian/console-screen.kbd.sh: Don't run at all if setupcon (from
+      console-setup) is present.
+    - Move console-screen.kbd.sh to rcS/S90.
+    - Add setfont, kbd_mode, and loadkeys to initramfs for console-setup.
+    - Use ckbcomp to get the keyboard layout if other data files are not
+      available.
+    - Fix segfault when dealing with Unicode characters that happen to
+      collide with internal special symbol tables when XORed with 0xF000.
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Thu, 06 Nov 2008 09:48:40 +0000
+
 kbd (1.14.1-4) unstable; urgency=medium
 
   * Read /etc/environment or /etc/default/locale earlier in the init script,
@@ -555,6 +982,34 @@ kbd (1.14.1-4) unstable; urgency=medium
 
  -- Michael Schutte <m.schutte.jr@gmail.com>  Sun, 22 Jun 2008 12:45:38 +0200
 
+kbd (1.14.1-3ubuntu3) intrepid; urgency=low
+
+  * Fix segfault when dealing with Unicode characters that happen to collide
+    with internal special symbol tables when XORed with 0xF000. (This will
+    doubtless still get some Unicode characters wrong, so isn't a perfect
+    solution.)
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Thu, 25 Sep 2008 09:49:59 +0100
+
+kbd (1.14.1-3ubuntu2) intrepid; urgency=low
+
+  * Properly apply ckbcomp patch; I hadn't regenerated loadkeys.c.
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Fri, 19 Sep 2008 02:19:36 +0100
+
+kbd (1.14.1-3ubuntu1) intrepid; urgency=low
+
+  * Resynchronise with Debian. Remaining changes:
+    - Prefer console-setup to console-common and console-data.
+    - debian/console-screen.kbd.sh: Don't run at all if setupcon (from
+      console-setup) is present.
+    - Move console-screen.kbd.sh to rcS/S90.
+    - Add setfont, kbd_mode, and loadkeys to initramfs for console-setup.
+    - Use ckbcomp to get the keyboard layout if other data files are not
+      available.
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Thu, 19 Jun 2008 01:03:50 +0100
+
 kbd (1.14.1-3) unstable; urgency=low
 
   * Change the LSB header of /etc/init.d/console-screen.kbd.sh to provide the
@@ -619,12 +1074,41 @@ kbd (1.12-19.1) unstable; urgency=low
 
  -- Marc 'HE' Brockschmidt <he@debian.org>  Sun, 09 Mar 2008 10:44:02 +0100
 
+kbd (1.12-19ubuntu2) hardy; urgency=low
+
+  * loadkeys_console-setup.patch: Use ckbcomp to get the keyboard layout if
+    other data files are not available (LP: #83487).
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Mon, 04 Feb 2008 14:19:21 +0000
+
+kbd (1.12-19ubuntu1) hardy; urgency=low
+
+  * Resynchronise with Debian. Remaining changes:
+    - Prefer console-setup to console-common and console-data.
+    - debian/console-screen.kbd.sh: Don't run if setupcon (from
+      console-setup) is present.
+    - Move console-screen.kbd.sh to rcS/S90.
+    - Add setfont, kbd_mode, and loadkeys to initramfs for console-setup.
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Mon, 10 Dec 2007 13:18:26 +0000
+
 kbd (1.12-19) unstable; urgency=low
 
   * Apply a patch by Colin Watson to add setfont to the udeb.
 
  -- Anton Zinoviev <zinoviev@debian.org>  Mon, 02 Jul 2007 15:14:32 +0300
 
+kbd (1.12-18ubuntu1) gutsy; urgency=low
+
+  * Prefer console-setup to console-common and console-data.
+  * debian/console-screen.kbd.sh: Don't run if setupcon (from console-setup)
+    is present.
+  * Add setfont to kbd-udeb.
+  * Move console-screen.kbd.sh to rcS/S90.
+  * Add setfont, kbd_mode, and loadkeys to initramfs for console-setup.
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Thu, 31 May 2007 13:33:22 +0100
+
 kbd (1.12-18) unstable; urgency=low
 
   * Add me to uploaders
@@ -1745,11 +2229,8 @@ kbd (0.91-6) unstable; urgency=low
  -- Dominik Kubla <Dominik.Kubla@Uni-Mainz.DE>  Thu, 31 Oct 1996 16:52:16 +0100
 
 0.91-5:
-
 	Added support for multi-resolution fonts (fixes bug #4258).
-
         Added support for 84-key keyboards on m68k.
-
         Added some more *.cp files (which hold fonts for all three common
 	font resolutions - 8x8, 8x14 and 8x16):
 	437.cp	-  Default for IBM compatibles
@@ -1762,45 +2243,27 @@ kbd (0.91-6) unstable; urgency=low
 	863.cp  -  Kanada (french)
 	865.cp  -  Norway, Danmark
 	869.cp  -  ???
-
 	added commands from the contrib directory to the install list
-
 	addded unicode scripts from src directory to the install list
-
 	added misc. documentation to the install list.
-
 	started to clean up code
-
 	added cp437.uni translation table from the kernel sources.
-
         added m68000 patches provided by Geert Uyterhoeven
-
 	removed serial console setup (it is moved to sysvinit,
 	where it belongs)
-
 	fixed some spelling errors
-
 0.91-4: changed Makefile to build and install additional programs.
-
 0.91-3: fixed nasty nesting error in kbdconfig script
-
 0.91-2: fixed stupid mistake in the kbdconfig script
-
 0.91-1: upgraded to latest upstream version
-
 	showfont will be installed as shfont to resolve the name clash
 	with the X11 utility of the same name
-
 	added /usr/sbin/kbdconfig to (re)configure the package
-
 	resizecons will not be installed on Debian Linux for m68k
-
 	added keytables for m68k systems contributed by Frank Neumann
-
 	split configuration data and initscript.  The conffile is named
 	/etc/kbd/config.
-
 	changed all references to /dev/console to /dev/tty0 to support
 	serial consoles
-
 	changed all references to "virtual consoles" to "virtual terminals"
+
diff -pruN 2.5.1-1/debian/control 2.5.1-1ubuntu1/debian/control
--- 2.5.1-1/debian/control	2022-10-08 19:23:47.000000000 +0000
+++ 2.5.1-1ubuntu1/debian/control	2022-11-15 18:38:37.000000000 +0000
@@ -1,7 +1,8 @@
 Source: kbd
 Section: utils
 Priority: optional
-Maintainer: Console utilities maintainers <pkg-kbd-devel@lists.alioth.debian.org>
+Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
+XSBC-Original-Maintainer: Console utilities maintainers <pkg-kbd-devel@lists.alioth.debian.org>
 Uploaders: Michael Schutte <michi@debian.org>, Anton Zinoviev <zinoviev@debian.org>
 Build-Depends: dpkg-dev (>= 1.16.1), debhelper-compat (= 13),
     linuxdoc-tools, gettext, flex, bison, pkg-config, check
@@ -12,8 +13,8 @@ Vcs-Browser: https://salsa.debian.org/de
 
 Package: kbd
 Architecture: linux-any
-Depends: ${shlibs:Depends}, ${misc:Depends}
-Recommends: console-setup | console-data
+Pre-Depends: ${misc:Pre-Depends}
+Depends: ${shlibs:Depends}, ${misc:Depends}, console-setup | console-setup-mini
 Provides: console-utilities
 Conflicts: console-utilities
 Description: Linux console font and keytable utilities
diff -pruN 2.5.1-1/debian/kbd.dirs 2.5.1-1ubuntu1/debian/kbd.dirs
--- 2.5.1-1/debian/kbd.dirs	2020-08-21 11:50:45.000000000 +0000
+++ 2.5.1-1ubuntu1/debian/kbd.dirs	2022-11-15 18:38:37.000000000 +0000
@@ -2,3 +2,4 @@ bin
 sbin
 usr/bin
 usr/sbin
+usr/share/initramfs-tools/hooks
diff -pruN 2.5.1-1/debian/kbd.initramfs-hook 2.5.1-1ubuntu1/debian/kbd.initramfs-hook
--- 2.5.1-1/debian/kbd.initramfs-hook	1970-01-01 00:00:00.000000000 +0000
+++ 2.5.1-1ubuntu1/debian/kbd.initramfs-hook	2022-11-15 18:38:37.000000000 +0000
@@ -0,0 +1,23 @@
+#! /bin/sh -e
+
+PREREQ="kernelextras"
+
+prereqs () {
+	echo "$PREREQ"
+}
+
+case $1 in
+prereqs)
+	prereqs
+	exit 0
+	;;
+esac
+
+. /usr/share/initramfs-tools/hook-functions
+
+# Console utilities needed for console-setup
+copy_exec /bin/setfont /bin
+copy_exec /bin/kbd_mode /bin
+copy_exec /bin/loadkeys /bin
+
+exit 0
diff -pruN 2.5.1-1/debian/patches/loadkeys_ckbcomp.diff 2.5.1-1ubuntu1/debian/patches/loadkeys_ckbcomp.diff
--- 2.5.1-1/debian/patches/loadkeys_ckbcomp.diff	1970-01-01 00:00:00.000000000 +0000
+++ 2.5.1-1ubuntu1/debian/patches/loadkeys_ckbcomp.diff	2022-11-15 18:42:43.000000000 +0000
@@ -0,0 +1,111 @@
+Description: Extend loadkeys to allow using ckbcomp
+ Use ckbcomp to get the keyboard layout if other data files are not
+ available.
+Author: Colin Watson <cjwatson@ubuntu.com>
+Author: Dave Jones <dave.jones@canonical.com>
+Forwarded: no
+Last-Update: 2020-11-09
+
+--- a/src/loadkeys.c
++++ b/src/loadkeys.c
+@@ -274,8 +274,10 @@
+ 			kbdfile_set_pathname(fp, "<stdin>");
+ 
+ 		} else if (kbdfile_find(argv[i], dirpath, suffixes, fp)) {
+-			kbd_warning(0, _("Unable to open file: %s: %m"), argv[i]);
+-			goto fail;
++			if (kbdfile_compile(argv[i], fp)) {
++				kbd_warning(0, _("Unable to open file: %s: %m"), argv[i]);
++				goto fail;
++			}
+ 		}
+ 
+ 		rc = lk_parse_keymap(ctx, fp);
+--- a/src/libkbdfile/kbdfile.c
++++ b/src/libkbdfile/kbdfile.c
+@@ -10,6 +10,7 @@
+ #include <unistd.h>
+ #include <dirent.h>
+ #include <errno.h>
++#include <ctype.h>
+ 
+ #include <kbdfile.h>
+ 
+@@ -435,6 +436,67 @@
+ 	return 1;
+ }
+ 
++int
++kbdfile_compile(const char *xkb_desc, struct kbdfile *fp)
++{
++	int i;
++
++	if (fp->fd != NULL) {
++		ERR(fp->ctx, "can't compile `%s', because kbdfile already opened: %s", xkb_desc, fp->pathname);
++		return -1;
++	}
++
++	for (i = 0; xkb_desc[i]; i++)
++		if (!isalpha((unsigned char) xkb_desc[i]) &&
++			!isdigit((unsigned char) xkb_desc[i]) &&
++			/* - and _ in variant names; / in a layout name; : as separator */
++			!strchr("-/_:", xkb_desc[i]))
++			break;
++
++	if (!xkb_desc[i]) {
++		char *layout, *variant;
++		char *colon;
++		size_t cmdsize;
++		char *cmd;
++		int rc = 0;
++
++		layout = strdup(xkb_desc);
++		colon = strchr(layout, ':');
++		if (colon) {
++			*colon = '\0';
++			variant = strdup(colon + 1);
++		} else
++			variant = NULL;
++
++		cmdsize = sizeof("ckbcomp -model pc105 ");
++		if (variant) {
++			cmdsize += strlen(layout) + 1 + strlen(variant);
++			cmd = malloc(cmdsize);
++			sprintf(cmd, "ckbcomp -model pc105 %s %s", layout, variant);
++		} else {
++			cmdsize += strlen(layout);
++			cmd = malloc(cmdsize);
++			sprintf(cmd, "ckbcomp -model pc105 %s", layout);
++		}
++
++		kbdfile_set_pathname(fp, xkb_desc);
++		fp->fd = popen(cmd, "r");
++		fp->flags |= KBDFILE_PIPE;
++		if (!(fp->fd)) {
++			char buf[200];
++			strerror_r(errno, buf, sizeof(buf));
++			ERR(fp->ctx, "popen: %s: %s", cmd, buf);
++			rc = -1;
++		}
++
++		free(variant);
++		free(layout);
++		free(cmd);
++		return rc;
++	}
++	return 1;
++}
++
+ struct kbdfile *
+ kbdfile_open(struct kbdfile_ctx *ctx, const char *filename)
+ {
+--- a/src/libkbdfile/kbdfile.h
++++ b/src/libkbdfile/kbdfile.h
+@@ -38,6 +38,7 @@
+ void kbdfile_close(struct kbdfile *fp);
+ 
+ int kbdfile_find(const char *fnam, const char *const *dirpath, const char *const *suffixes, struct kbdfile *fp);
++int kbdfile_compile(const char *xkb_desc, struct kbdfile *fp);
+ 
+ char *kbdfile_get_pathname(struct kbdfile *fp);
+ int kbdfile_set_pathname(struct kbdfile *fp, const char *pathname);
diff -pruN 2.5.1-1/debian/patches/loadkeys_find_usable_console.diff 2.5.1-1ubuntu1/debian/patches/loadkeys_find_usable_console.diff
--- 2.5.1-1/debian/patches/loadkeys_find_usable_console.diff	1970-01-01 00:00:00.000000000 +0000
+++ 2.5.1-1ubuntu1/debian/patches/loadkeys_find_usable_console.diff	2022-11-15 18:38:37.000000000 +0000
@@ -0,0 +1,96 @@
+Description: Make it safer to run loadkeys with foreground console in raw mode
+ If not invoked with an explicit console parameter, try to find any console
+ not in raw mode.  This makes it safer to run loadkeys if the foreground
+ console might be in raw mode, for example if Plymouth or X might be
+ running.
+Author: Colin Watson <cjwatson@ubuntu.com>
+Author: Steve Langasek <steve.langasek@ubuntu.com>
+Forwarded: no
+Last-Update: 2016-09-20
+
+---
+ src/libcommon/getfd.c    |   53 +++++++++++++++++++++++++++++++++++++++++++++++++++++
+ src/libcommon/getfd.h    |    2 +
+ src/loadkeys.c |    5 ++++-
+ 3 files changed, 58 insertions(+), 1 deletion(-)
+
+--- a/src/libcommon/getfd.c
++++ b/src/libcommon/getfd.c
+@@ -91,3 +91,56 @@
+ 	/* total failure */
+ 	exit(1);
+ }
++
++static int
++kbmode(int fd) {
++	int mode;
++
++	if (ioctl(fd, KDGKBMODE, &mode) < 0)
++		return -1;
++	else
++		return mode;
++}
++
++/* Get a file descriptor suitable for setting the keymap.  Anything not in
++ * raw mode will do - it doesn't have to be the foreground console - but we
++ * prefer Unicode if we can get it.
++ */
++int
++getfd_keymap(void) {
++	int fd, bestfd = -1;
++	char ttyname[sizeof("/dev/ttyNN")] = "/dev/tty";
++	int i;
++
++#define CHECK_FD_KEYMAP do { \
++	if (is_a_console(fd)) { \
++		int mode = kbmode(fd); \
++		if (mode == K_UNICODE) { \
++			if (bestfd != -1) \
++				close(bestfd); \
++			return fd; \
++		} else if (mode == K_XLATE && bestfd == -1) \
++			bestfd = fd; \
++		else \
++			close(fd); \
++	} else \
++		close(fd); \
++} while (0)
++
++	for (i = 0; conspath[i]; i++) {
++		if ((fd = open_a_console(conspath[i])) >= 0)
++			CHECK_FD_KEYMAP;
++	}
++
++	for (i = 1; i <= 12; ++i) {
++		snprintf(ttyname + sizeof("/dev/tty") - 1, 3, "%d", i);
++		if ((fd = open_a_console(ttyname)) >= 0)
++			CHECK_FD_KEYMAP;
++	}
++
++	fprintf(stderr,
++		_("Couldn't get a file descriptor referring to the console\n"));
++
++	/* total failure */
++	exit(1);
++}
+--- a/src/libcommon/libcommon.h
++++ b/src/libcommon/libcommon.h
+@@ -41,6 +41,7 @@
+ 
+ // getfd.c
+ int getfd(const char *fnam);
++int getfd_keymap(void);
+ 
+ // version.c
+ const char *get_progname(void);
+--- a/src/loadkeys.c
++++ b/src/loadkeys.c
+@@ -200,7 +200,7 @@
+ 
+ 	if (!(options & OPT_M) && !(options & OPT_B)) {
+ 		/* get console */
+-		if ((fd = getfd(console)) < 0)
++		if ((fd = console ? getfd(console) : getfd_keymap()) < 0)
+ 			kbd_error(EXIT_FAILURE, 0, _("Couldn't get a file descriptor referring to the console."));
+ 
+ 		/* check whether the keyboard is in Unicode mode */
diff -pruN 2.5.1-1/debian/patches/series 2.5.1-1ubuntu1/debian/patches/series
--- 2.5.1-1/debian/patches/series	2022-08-24 11:35:29.000000000 +0000
+++ 2.5.1-1ubuntu1/debian/patches/series	2022-11-15 18:42:15.000000000 +0000
@@ -3,3 +3,6 @@ Miscellaneous-manpage-corrections-and-ad
 Various-fixes-to-the-openvt-utility.patch
 Check-for-X-in-kbd_mode.patch
 Support-KT_DEAD2-diacritics.patch
+
+loadkeys_find_usable_console.diff
+loadkeys_ckbcomp.diff
diff -pruN 2.5.1-1/debian/rules 2.5.1-1ubuntu1/debian/rules
--- 2.5.1-1/debian/rules	2020-10-11 10:08:44.000000000 +0000
+++ 2.5.1-1ubuntu1/debian/rules	2022-11-15 18:38:37.000000000 +0000
@@ -6,7 +6,7 @@ KBD_DOC = $(KBD)/usr/share/doc/kbd
 KBD_UDEB = $(TOPDIR)/debian/kbd-udeb
 
 # build these twice, once optimized for size (for kbd-udeb)
-UDEB_BINARIES = loadkeys kbd_mode setfont
+UDEB_BINARIES = loadkeys kbd_mode setfont setvtrgb
 
 # non-standard binaries to build
 EXTRA_BINARIES = screendump setlogcons setvesablank
@@ -14,7 +14,7 @@ CONTRIB_BINARIES = codepage splitfont vc
 
 # we don’t want these in /usr/bin
 MOVE_TO_BIN = kbd_mode setfont fgconsole openvt chvt dumpkeys unicode_start loadkeys
-MOVE_TO_SBIN = kbdrate
+MOVE_TO_SBIN = kbdrate setvtrgb
 MOVE_TO_USR_SBIN = vcstime setvesablank
 
 include /usr/share/dpkg/architecture.mk
@@ -73,6 +73,8 @@ override_dh_auto_install:
 	mv $(addprefix debian/kbd/usr/bin/,$(MOVE_TO_BIN)) $(KBD)/bin/
 	mv $(addprefix debian/kbd/usr/bin/,$(MOVE_TO_SBIN)) $(KBD)/sbin/
 	mv $(addprefix debian/kbd/usr/bin/,$(MOVE_TO_USR_SBIN)) $(KBD)/usr/sbin/
+# initramfs
+	install -m 755 debian/kbd.initramfs-hook $(KBD)/usr/share/initramfs-tools/hooks/kbd
 # prepare udeb
 ifeq (, $(filter noudeb, $(DEB_BUILD_PROFILES)))
 	for ITEM in $(UDEB_BINARIES); do install -m755 src/$$ITEM-udeb $(KBD_UDEB)/bin/$$ITEM; done
