Bug#992457: Broken by irresponsible removal of tempfile in debianutils

2021-08-19 Thread Joseph Carter
Control: retitle -1 FTBFS: uses tempfile in build, appears to use deprecated 
which(1)

A closer look indicates that tempfile is only actually used to build the 
package. The apparent use of which(1) is actually a shell function, however…

On Wed, Aug 18, 2021, at 16:18, Cyril Brulebois wrote:
> > Presumably /installer-team/console-setup would be a better package to
> > patch, unless cdebconf uses tempfile somehow.  I'll see what I can
> > do this evening. 
> 
> Sure thing, miscompleted in my browser history plus slightly distracted,
> sorry.

As suggested before, I'm fluent in IRC, so I read what you meant.  

MY goof was breaking my initramfs, being _completely_ unable to read the tiny 
font, reverting to backup, futzing with it, seeing tempfile and which being 
called in setupcon, and having to go to work before I could dig much deeper.

As noted, tempfile is only actually used to build the package. Fixed that. Left 
the function in setupcon alone.

The apparent use of which all over the place is also a shell function, but the 
shell function just emulates command -v, so I subbed that out and removed the 
functions while I was at it. Tested the result on amd64 with amdgpu added to 
initramfs for early KMS so that I can take advantage of Plymouth for status 
messages I have some chance of being able to use, and a crypttab prompt that 
doesn't get lost in the impossibly small console text.

I realized while composing the email that my patch has some trailing whitespace 
removal—nvim is configured to do that to source files as it's usually desirable 
for git sanity, but I should've trimmed those hunks out of the patch and 
retested. I don't have time to do that tonight because I can't conveniently 
just reboot right now, so I'll send you the patch as tested. Feel free to omit 
purely whitespace change hunks.

You can maybe guess the major thrust of my attempts to fiddle with 
console-setup around the time this all happened: You don't even try to set the 
font in the initramfs anymore, and I've never actually figured out why Ubuntu's 
combination of console-setup and plymouth manages to just work and Debian's 
just doesn't—I've spent a little time prodding at packages from both.

I mostly know my way around a Debian system I think—when I reinstalled this 
machine about two weeks ago, I found that neither old nor new installer was 
really set up to preserve my LUKS devices with LVM on them, keep some 
partitions and format others, etc … so I just grabbed a live USB and installed 
the system with debootstrap. It … was faster than trying ti figure out if or 
how Calamares could do that, and I know the shell of the old debian installer 
didn't provide shell UI I'd need to open the LUKS partitions so the partitioner 
could use them without obliterating anything "helpfully" for me. *shrug*

I've gotten way off topic now, but I think I just need to write a hook to throw 
in setfont and the font to set along with some quick and dirty initramfs 
scripts to make sure it dances around plymouth. I had to do something similar 
with a MBP to work around proprietary Apple crap.

Anyway, hope this is useful. Salsa didn't exist when last I might've had an 
account on it to be able to actually finish this up as a PR. I've considered 
changing that a time or two. Perhaps when the Covidium passes.

Joseph

diff -Nru console-setup.orig/debian/console-setup.config console-setup/debian/console-setup.config
--- console-setup.orig/debian/console-setup.config	2021-08-18 22:17:59.892444554 -0700
+++ console-setup/debian/console-setup.config	2021-08-18 22:42:21.524213193 -0700
@@ -64,7 +64,7 @@
 # fontsets='Arabic-Fixed15
 # Arabic-Fixed16
 # Arabic-VGA14
-# ... 
+# ...
 # Vietnamese-Fixed18
 # '
 
@@ -104,18 +104,6 @@
 
 db_capb backup
 
-which () {
-local IFS
-IFS=:
-for i in $PATH; do
-	if [ -f "$i/$1" -a -x "$i/$1" ]; then
-	echo "$i/$1"
-	return 0
-	fi
-done
-return 1
-}
-
 available_fontfaces () {
 local prefix
 case "$CODESET" in
@@ -195,14 +183,14 @@
 }
 
 kernel=unknown
-if which uname >/dev/null; then
+if command -v uname >/dev/null; then
 case "`uname`" in
 *Linux*) kernel=linux ;;
 *FreeBSD*) kernel=freebsd ;;
 esac
 fi
 
-if which locale 2>/dev/null >/dev/null; then
+if command -v locale 2>/dev/null >/dev/null; then
 eval `locale`
 fi
 
@@ -217,7 +205,7 @@
 if [ "$locale" = C ]; then
 CHARMAP=ISO-8859-15
 charmap_priority=high
-elif which locale 2>/dev/null >/dev/null; then
+elif command -v locale 2>/dev/null >/dev/null; then
 CHARMAP=`locale charmap`
 else
 CHARMAP=unknown
diff -Nru console-setup.orig/debian/console-setup-udeb.postinst console-setup/debian/console-setup-udeb.postinst
--- console-setup.orig/debian/console-setup-udeb.postinst	2021-08-18 22:17:59.892444554 -0700
+++ console-setup/debian/console-setup-udeb.postinst	2021-08-18 22:43:48.226081884 -0700
@@ -5,20 +5,6 @@
 # Source debconf library.
 . /usr/share/debconf/confmodule

Processed: Re: Bug#992457: Broken by irresponsible removal of tempfile in debianutils

2021-08-19 Thread Debian Bug Tracking System
Processing control commands:

> retitle -1 FTBFS: uses tempfile in build, appears to use deprecated which(1)
Bug #992457 [console-setup] Broken by removal of tempfile in debianutils
Changed Bug title to 'FTBFS: uses tempfile in build, appears to use deprecated 
which(1)' from 'Broken by removal of tempfile in debianutils'.

-- 
992457: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=992457
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems



Bug#992457: Broken by irresponsible removal of tempfile in debianutils

2021-08-18 Thread Cyril Brulebois
Joseph Carter  (2021-08-18):
> Presumably /installer-team/console-setup would be a better package to
> patch, unless cdebconf uses tempfile somehow.  I'll see what I can
> do this evening. 

Sure thing, miscompleted in my browser history plus slightly distracted,
sorry.


Cheers,
-- 
Cyril Brulebois (k...@debian.org)
D-I release manager -- Release team member -- Freelance Consultant


signature.asc
Description: PGP signature


Bug#992457: Broken by irresponsible removal of tempfile in debianutils

2021-08-18 Thread Joseph Carter
On Wed, Aug 18, 2021, at 14:01, Cyril Brulebois wrote:
> T. Joseph Carter  (2021-08-18):
> > It's debianutils' bug, really, and the bugs keep getting filed (and
> > resolved), but there's a half a dozen packages on my system that are
> > broken by it. Yours happens to be used at boot time and for general
> > system operation.
> 
> It's an ongoing conversation on IRC apparently, and yes, some kind of
> advance warning would have been appreciated.

O yes, I'm sure there is. I've missed those over the years. 
 

> That being said, it's not entirely crazy to attempt such changes very
> early in the release cycle, and if we ought to move away from those
> tools, I don't mind much.

Yes, but you "try" to do that by marking the packages deprecated and filing 
bugs that version 5, due out X weeks, and ask them to make changes or allow 
NMU.  Ideally, you then keep it around for a release or so AFTER you make 
Debian no longer dependent upon the tools.

Dunno who else would miss tempfile, but I'm kinda partial to which since 
command -v will NOT give you the path to a file if you typically alias that 
file, and type -P is not POSIX and does not work with dash.


> > If you're busy and debianutils' change doesn't get reverted, I can
> > prepare a patch. It's literally replacing tempfile and which with
> > their more generic equivalents, after all.
> 
> I think we'd be happy to have a patch or a merge request to review, even
> more so if you've tested it on a real system.
> 
> The git repo is at:
>   https://salsa.debian.org/installer-team/cdebconf/
> 
> but a patch against the source package would be fine too.
> 
> Thanks for the heads-up!

Presumably /installer-team/console-setup would be a better package to patch, 
unless cdebconf uses tempfile somehow.  I'll see what I can do this evening. 

Joseph



Bug#992457: Broken by irresponsible removal of tempfile in debianutils

2021-08-18 Thread Cyril Brulebois
Control: retitle -1 Broken by removal of tempfile in debianutils

Hi,

T. Joseph Carter  (2021-08-18):
> Debianutils >= 5 removes tempname and puts a deprecation notice on the
> which command. The setupcon script (at least) uses both of these,
> causing people's initramfs's to be subtly broken and leaving them
> without a keymap in the event of a boot error., Since the maintainer
> of Debianutils seems to be content to put out fires as they come up
> with the excuse that the stable version of Debian declares these to be
> deprecated (y'know, the one that was released a week ago at time of
> writing), it is apparently incumbent upon others to fix this in their
> packages.
> 
> It's debianutils' bug, really, and the bugs keep getting filed (and
> resolved), but there's a half a dozen packages on my system that are
> broken by it. Yours happens to be used at boot time and for general
> system operation.

It's an ongoing conversation on IRC apparently, and yes, some kind of
advance warning would have been appreciated.

That being said, it's not entirely crazy to attempt such changes very
early in the release cycle, and if we ought to move away from those
tools, I don't mind much.

> If you're busy and debianutils' change doesn't get reverted, I can
> prepare a patch. It's literally replacing tempfile and which with
> their more generic equivalents, after all.

I think we'd be happy to have a patch or a merge request to review, even
more so if you've tested it on a real system.

The git repo is at:
  https://salsa.debian.org/installer-team/cdebconf/

but a patch against the source package would be fine too.

Thanks for the heads-up!


Cheers,
-- 
Cyril Brulebois (k...@debian.org)
D-I release manager -- Release team member -- Freelance Consultant


signature.asc
Description: PGP signature


Processed: Re: Bug#992457: Broken by irresponsible removal of tempfile in debianutils

2021-08-18 Thread Debian Bug Tracking System
Processing control commands:

> retitle -1 Broken by removal of tempfile in debianutils
Bug #992457 [console-setup] Broken by irresponsible removal of tempfile in 
debianutils
Changed Bug title to 'Broken by removal of tempfile in debianutils' from 
'Broken by irresponsible removal of tempfile in debianutils'.

-- 
992457: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=992457
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems



Bug#992457: Broken by irresponsible removal of tempfile in debianutils

2021-08-18 Thread T. Joseph Carter
Package: console-setup
Version: 1.205
Severity: important
X-Debbugs-Cc: 

Debianutils >= 5 removes tempname and puts a deprecation notice on the
which command. The setupcon script (at least) uses both of these,
causing people's initramfs's to be subtly broken and leaving them
without a keymap in the event of a boot error., Since the maintainer of
Debianutils seems to be content to put out fires as they come up with
the excuse that the stable version of Debian declares these to be
deprecated (y'know, the one that was released a week ago at time of
writing), it is apparently incumbent upon others to fix this in their
packages.

It's debianutils' bug, really, and the bugs keep getting filed (and
resolved), but there's a half a dozen packages on my system that are
broken by it. Yours happens to be used at boot time and for general
system operation.

If you're busy and debianutils' change doesn't get reverted, I can
prepare a patch. It's literally replacing tempfile and which with their
more generic equivalents, after all.

-- System Information:
Debian Release: 11.0
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 5.10.0-8-amd64 (SMP w/16 CPU threads)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE, 
TAINT_UNSIGNED_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages console-setup depends on:
ii  console-setup-linux 1.205
ii  debconf 1.5.77
ii  keyboard-configuration  1.205
ii  xkb-data2.33-1

console-setup recommends no packages.

Versions of packages console-setup suggests:
ii  locales   2.31-16
ii  lsb-base  11.1.0

Versions of packages keyboard-configuration depends on:
ii  debconf 1.5.77
ii  liblocale-gettext-perl  1.07-4+b1

Versions of packages console-setup-linux depends on:
ii  init-system-helpers 1.60
ii  kbd 2.3.0-3
ii  keyboard-configuration  1.205

console-setup-linux suggests no packages.

Versions of packages console-setup is related to:
pn  console-common
pn  console-data  
pn  console-tools 
ii  gnome-control-center  1:3.38.4-1
ii  kbd   2.3.0-3
ii  systemd   247.9-1

-- debconf information:
  keyboard-configuration/layout:
  keyboard-configuration/unsupported_config_options: true
  keyboard-configuration/ctrl_alt_bksp: false
* console-setup/codeset47: # Latin1 and Latin5 - western Europe and Turkic 
languages
* console-setup/fontsize-fb47: 16x32 (framebuffer only)
  keyboard-configuration/store_defaults_in_debconf_db: true
  debian-installer/console-setup-udeb/title:
  keyboard-configuration/xkb-keymap: us
  console-setup/fontsize: 16x32
  keyboard-configuration/unsupported_layout: true
  keyboard-configuration/switch: No temporary switch
  keyboard-configuration/model: Generic 105-key PC (intl.)
  keyboard-configuration/toggle: No toggling
  console-setup/framebuffer_only:
  keyboard-configuration/layoutcode: us
  keyboard-configuration/optionscode:
  keyboard-configuration/compose: No compose key
  keyboard-configuration/modelcode: pc105
  keyboard-configuration/variantcode:
  keyboard-configuration/unsupported_config_layout: true
  console-setup/fontsize-text47: 16x32 (framebuffer only)
  console-setup/store_defaults_in_debconf_db: true
  keyboard-configuration/altgr: The default for the keyboard layout
  keyboard-configuration/unsupported_options: true
  keyboard-configuration/other:
* console-setup/fontface47: TerminusBold
  console-setup/guess_font:
* keyboard-configuration/variant: English (US)
* console-setup/charmap47: UTF-8
  console-setup/codesetcode: Lat15
  console-setup/use_system_font: