-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RFE] systemd-hostnamed: Add device/hardware model field #15493
Comments
Is this something that would be wanted/accepted? I am willing to propose a Pull Request. |
I'm fairly confident that thise would be accepted, can you prepare a PR for this? |
It would need some filtering for common wrong values. 2 out of 3 systems I've checked have |
That's the whole point of having something in between system apps and the raw data exported by the firmware. |
Yes, product_family was indeed a draft that worked for me. The implementation should also account for empty/place holder values https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/sound/soc/soc-core.c#n1535 Hans advised me that product_family isn't present on most devices, that we should use product_name instead (except for Lenovo, which we should use product_version). |
Does anybody have a suggestion for the human-readable name for this field? I have been thinking of "Device Model", but my low-level vocabulary is limited. :) |
|
This corresponds to a device model, like X1 Carbon G7, X1 Carbon G8. Such information is important for hardware vendors who want to try to figure out users problems based on device. Fixes systemd#15493
So, adding this makes sense I guess. But let's do this properly, i.e. support that this information is supplied via hwdb, and then also fix #7390 at the same time. i.e. hostnamed should read the modalias string from |
Sounds like a good approach. Thank you! I guess I should go about adding a new hwdb for this. How would you prefer that I name this specific .hwdb file? Are there any docs regarding the priority prefix used in hwdb.d? Also, which properties (other than Model and Chassis) make sense to add to this db? Sorry for the amount of questions, it is my first time playing with systemd's codebase. |
Yes, the idea would be to ship a hwdb file for this that is initially relatively empty, but I am pretty sure we can populate it quickly with some basic entries, I hope @hadess, @jwrdegoede might have a few devices they'd be keen to contribute entries for. Hmm, so in my mind I have been going forth and back how to best to the hwdb integration. I see too options:
I think I am now leading towards option 2. It has the benefit we can also use udev rules on the DMI device, which we can use to filter the bogus fields such as "To be filled by O.E.M.". or in other words, let's make sure that Note that udev implicitly appends all matching sd-hwdb to udev devices, hence to implement this there wouldn't even have to be any manual hwdb lookups added anywhere. If we go this approach I figure we should follow our usually naming scheme for udev fields, i.e.
And then These four fields are used for various kinds of devices already this way, hence re-using them on the DMI device appears very natural to me. For the chassis we'd introduce a new prop ID_CHASSIS or so. the two xyz_FROM_DATABASE props and ID_CHASSIS would come from the hwdb, the ID_VENDOR/ID_MODEL props would be determined via udev rules. What I am wondering about: this will work on x86 machines, i.e. where DMI is a thing. I wonder how we can open this up on other systems, where DMI is not a thing. i.e. let's say a raspberry pi or so (which is devicetree iirc?). do they expose some identifying blob as a sysfs device somewhere, so that we can neatly run udev on it? Do they expose modalias strings? anyone knows? I figure hostnamed could check for a couple of different devices if need be, but it would be good to have at least some idea how this would look on other archs, even if we don't implement this initially. |
Some info from a rpi4 B 1.1: With fedora rawhide aarch64 there is a modalias:
On rasbian there is not. One way to get the model info for the rpi is from the end of /proc/cpui nfo.
|
I needed host identification for bolt (!233) the other day and @jwrdegoede sent me this github repo which contains a lot of info for various devices: https://github.com/linuxhw/DMI.git (Lenovo is the most obvious special case with |
Is your feature request related to a problem? Please describe.
With more vendors shipping Linux desktops out of the box, we started to have a necessity of telling machines apart for better bug triaging. In GNOME Control Center we want to show a "Model" field with this information, so users can provide hardware information while reporting bugs. See https://gitlab.gnome.org/GNOME/gnome-control-center/-/merge_requests/723
Describe the solution you'd like
I suggest we add a field in hostnamed to query this info from /sys/class/dm/id/... so GNOME and other DEs can consume this over DBus and show this info in the UI appropriately.
Describe alternatives you've considered
Reading this directly instead of relying on hostnamed. :)
The text was updated successfully, but these errors were encountered: