#992457 FTBFS: uses tempfile in build, appears to use deprecated which(1)

#992457#5
Date:
2021-08-18 20:34:13 UTC
From:
To:
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.

#992457#10
Date:
2021-08-18 21:01:06 UTC
From:
To:
Hi,

T. Joseph Carter <tjcarter@spiritsubstance.com> (2021-08-18):

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.

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,

#992457#17
Date:
2021-08-18 22:51:27 UTC
From:
To:
Ohhhh yes, I'm sure there is. I've missed those over the years. 🍿

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.

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

#992457#22
Date:
2021-08-18 23:18:13 UTC
From:
To:
Joseph Carter <tjcarter@spiritsubstance.com> (2021-08-18):

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


Cheers,

#992457#27
Date:
2021-08-19 07:08:09 UTC
From:
To:
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…

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