diff --git a/hwdb.d/20-dmi-id.hwdb b/hwdb.d/20-dmi-id.hwdb index c7bf6cfab10..905d6923bb8 100644 --- a/hwdb.d/20-dmi-id.hwdb +++ b/hwdb.d/20-dmi-id.hwdb @@ -1,5 +1,28 @@ # This file is part of systemd +# Filter out mostly meaningless names +dmi:*:svnDefaultstring:* +dmi:*:svnN/A:* +dmi:*:svnO.E.M.:* +dmi:*:svnOEM:* +dmi:*:svnSystemmanufacturer:* +dmi:*:svnSystemManufacturer:* +dmi:*:svnTobefilledbyO.E.M.:* +dmi:*:svnToBeFilledByO.E.M.:* + ID_SYS_VENDOR_IS_RUBBISH=1 + +dmi:*:pnDefaultstring:* +dmi:*:pnN/A:* +dmi:*:pnO.E.M.:* +dmi:*:pnOEM:* +dmi:*:pnSystemproductname:* +dmi:*:pnSystemProductName:* +dmi:*:pnSystemname:* +dmi:*:pnSystemName:* +dmi:*:pnTobefilledbyO.E.M.:* +dmi:*:pnToBeFilledByO.E.M.:* + ID_PRODUCT_NAME_IS_RUBBISH=1 + # Fix "Lenovo" capitalization in /sys/class/dmi/id/sys_vendor dmi:bvnLENOVO* ID_SYSFS_ATTRIBUTE_MODEL=product_version diff --git a/rules.d/50-udev-default.rules.in b/rules.d/50-udev-default.rules.in index 0394530479d..843bdaf9ce7 100644 --- a/rules.d/50-udev-default.rules.in +++ b/rules.d/50-udev-default.rules.in @@ -110,8 +110,9 @@ SUBSYSTEM=="ptp", ATTR{clock_name}=="KVM virtual PTP", SYMLINK += "ptp_kvm" SUBSYSTEM=="ptp", ATTR{clock_name}=="hyperv", SYMLINK += "ptp_hyperv" SUBSYSTEM!="dmi", GOTO="dmi_end" -ENV{ID_VENDOR}="$attr{sys_vendor}" -ENV{ID_SYSFS_ATTRIBUTE_MODEL}=="|product_name", ENV{ID_MODEL}="$attr{product_name}" +ENV{ID_SYS_VENDOR_IS_RUBBISH}!="1", ENV{ID_VENDOR}="$attr{sys_vendor}" +ENV{ID_SYSFS_ATTRIBUTE_MODEL}=="", ENV{ID_PRODUCT_NAME_IS_RUBBISH}!="1", ENV{ID_MODEL}="$attr{product_name}" +ENV{ID_SYSFS_ATTRIBUTE_MODEL}=="product_name", ENV{ID_MODEL}="$attr{product_name}" ENV{ID_SYSFS_ATTRIBUTE_MODEL}=="product_version", ENV{ID_MODEL}="$attr{product_version}" # fallback to board information ENV{ID_VENDOR}=="", ENV{ID_VENDOR}="$attr{board_vendor}"