#1101211 isenkram: add support for generating and installing system-specific task-hardware-support metapackages

#1101211#5
Date:
2025-03-24 23:33:30 UTC
From:
To:
I would like to be able to mark all my hardware-support packages as
automatically installed and have a metapackage to keep them installed.

That way, when I move my Debian install between computers, I can create
a new metapackage for the new hardware, and purge the old one, which
would then also remove any packages only needed for the old hardware.

I could also create multiple task-hardware-support-* packages when
moving back and forth between multiple different home/work computers.

I can't find any easy way to get the name of the hardware from systemd,
so I suggest that the metapackage be named task-hardware-support and
there be a suffix option for users to add the hardware/hostname/etc.

I can do this manually but it would be nice to have a script for it,
and isenkram seems like the best place for that script to exist.

PS: Another similar thing is the find-dbgsym-packages --deb option.

#1101211#10
Date:
2025-03-25 05:16:38 UTC
From:
To:
[Paul Wise]

I suspect running dmidecode and the equivalent modalias entry is a
better source for hardware model, try for example this:

  find /sys/devices -name modalias -print0 | xargs -0 sort -u|grep dmi

For my Thinkpad X230 I get svnLENOVO and pvrThinkPadX230.

#1101211#15
Date:
2025-03-26 04:34:33 UTC
From:
To:
It turns out that since systemd 248, the hardware info is exposed
by hostnamectl (no root), which also has machine-readable output.

   $ hostnamectl | grep Hardware

This is sourced from either DMI or DeviceTree (for ARM) and can be
customised in /etc/machine-info. Presumably it will get expanded
over time to support other mechanisms on other platforms too.

https://www.freedesktop.org/software/systemd/man/latest/machine-info.html#HARDWARE_VENDOR=

In addition, lshw can do this too, but it requires root access.

   $ sudo lshw | head -n4

DMI/DT hardware info also contains arbitrary bytes, so you would need
to safely convert it to the package name character set.

Also, some users might want to name their packages after hostnames
or hardware pet names or locations etc. So some ability to customise,
from a default based on the hardware name, would be useful.

#1101211#20
Date:
2025-04-12 00:35:47 UTC
From:
To:
One caveat to that is that the system serial number exposed as
HardwareSerial in the JSON output, is only available as root.

Since different machines of the same hardware vendor/model could have
different peripherals plugged into them; when available, it might be
worth optionally using the system serial number as a differentiator.