Write a kernel driver to support identity on x86 |
||||||||
Issue descriptionAt present cros_config directly reads the SMBIOS tables to figure out the SMBIOS name and the SKU ID. We can provide a kernel driver to export this information, and then cros_config will not need to read the SMBIOS tables, which involves a few hundred lines of parsing logic. It seems like a good time to look at this.
,
Jan 2 2018
,
Mar 27 2018
,
Apr 25 2018
A patch for this has been sent upstream https://patchwork.kernel.org/patch/10361089/
,
Apr 25 2018
,
May 1 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/third_party/kernel/+/2b79d333664cefe4da748144da4e099c004b0c97 commit 2b79d333664cefe4da748144da4e099c004b0c97 Author: Simon Glass <sjg@chromium.org> Date: Tue May 01 15:31:48 2018 FROMLIST: firmware: dmi: Add access to the SKU ID string This is used in some systems from user space for determining the identity of the device. Expose this as a file so that that user-space tools don't need to read from /sys/firmware/dmi/tables/DMI BUG= chromium:795122 TEST=manually on grunt Change-Id: I10c7c303f53e8676d9ea2290add6bc528103e642 Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Jean Delvare <jdelvare@suse.de> Reviewed-on: https://chromium-review.googlesource.com/1012266 Reviewed-by: Aaron Durbin <adurbin@chromium.org> [modify] https://crrev.com/2b79d333664cefe4da748144da4e099c004b0c97/include/linux/mod_devicetable.h [modify] https://crrev.com/2b79d333664cefe4da748144da4e099c004b0c97/drivers/firmware/dmi-id.c [modify] https://crrev.com/2b79d333664cefe4da748144da4e099c004b0c97/drivers/firmware/dmi_scan.c
,
May 4 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/third_party/kernel/+/4f441db5e291add1a5f5ec0bc86bbb5ca8fac555 commit 4f441db5e291add1a5f5ec0bc86bbb5ca8fac555 Author: Simon Glass <sjg@chromium.org> Date: Fri May 04 10:02:34 2018 FROMLIST: firmware: dmi: Add access to the SKU ID string This is used in some systems from user space for determining the identity of the device. Expose this as a file so that that user-space tools don't need to read from /sys/firmware/dmi/tables/DMI BUG= chromium:795122 TEST=manually on santa: $ cat /sys/class/dmi/id/product_sku sku3 $ mosys platform sku 3 Change-Id: I442417ce88005f77cbb7f67daa70c7e9088b12b4 Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Jean Delvare <jdelvare@suse.de> Reviewed-on: https://chromium-review.googlesource.com/1037587 Reviewed-by: Aaron Durbin <adurbin@chromium.org> [modify] https://crrev.com/4f441db5e291add1a5f5ec0bc86bbb5ca8fac555/include/linux/mod_devicetable.h [modify] https://crrev.com/4f441db5e291add1a5f5ec0bc86bbb5ca8fac555/drivers/firmware/dmi-id.c [modify] https://crrev.com/4f441db5e291add1a5f5ec0bc86bbb5ca8fac555/drivers/firmware/dmi_scan.c
,
May 30 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/platform2/+/dbaaa798c982abfca9e84cc9bc2a5d9f5604ca16 commit dbaaa798c982abfca9e84cc9bc2a5d9f5604ca16 Author: Simon Glass <sjg@chromium.org> Date: Wed May 30 04:22:46 2018 chromeos-config: Use the kernel driver instead of smbios tables Now that the kernel provides a driver for accessing the SMBIOS name and SKU ID, we can use that instead of decoding the binary SMBIOS tables. This removes a significant amount of code and complexity. It also makes x86 work in a similar way to ARM, in that it can just look at files provided by the kernel. Also drop creation of the SMBIOS file used by this code. BUG= chromium:795122 TEST=FEATURES=test sudo -E emerge --nodeps chromeos-config-tools Also manual test on santa with /var/run/cros_config/SMBIOS removed Change-Id: Idb78f5568b3c2cbe483859895cb642dfbaa8f04b Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1062212 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Jason Clinton <jclinton@chromium.org> [modify] https://crrev.com/dbaaa798c982abfca9e84cc9bc2a5d9f5604ca16/chromeos-config/libcros_config/identity_x86.h [modify] https://crrev.com/dbaaa798c982abfca9e84cc9bc2a5d9f5604ca16/init/chromeos_startup [modify] https://crrev.com/dbaaa798c982abfca9e84cc9bc2a5d9f5604ca16/chromeos-config/libcros_config/cros_config.cc [modify] https://crrev.com/dbaaa798c982abfca9e84cc9bc2a5d9f5604ca16/chromeos-config/libcros_config/cros_config.h [modify] https://crrev.com/dbaaa798c982abfca9e84cc9bc2a5d9f5604ca16/chromeos-config/libcros_config/identity_x86.cc
,
May 30 2018
This has landed now. It only works on kernels to which this patch is landed: FROMLIST: firmware: dmi: Add access to the SKU ID string For now this is v4.4 and v4.14. So for x86 identity support for devices which run an older kernel, we'll need to cherry-pick that patch.
,
Jul 19
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/platform2/+/506bc9bcf07c4300fcddccc1c9eb12b0fb75a903 commit 506bc9bcf07c4300fcddccc1c9eb12b0fb75a903 Author: Simon Glass <sjg@chromium.org> Date: Thu Jul 19 02:28:21 2018 chromeos-config: Use the kernel driver instead of smbios tables Now that the kernel provides a driver for accessing the SMBIOS name and SKU ID, we can use that instead of decoding the binary SMBIOS tables. This removes a significant amount of code and complexity. It also makes x86 work in a similar way to ARM, in that it can just look at files provided by the kernel. Also drop creation of the SMBIOS file used by this code. BUG= chromium:795122 TEST=FEATURES=test sudo -E emerge --nodeps chromeos-config-tools Also manual test on santa with /var/run/cros_config/SMBIOS removed Change-Id: Idb78f5568b3c2cbe483859895cb642dfbaa8f04b Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1062212 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Jason Clinton <jclinton@chromium.org> (cherry picked from commit dbaaa798c982abfca9e84cc9bc2a5d9f5604ca16) Reviewed-on: https://chromium-review.googlesource.com/1141998 Reviewed-by: Marco Chen <marcochen@chromium.org> Commit-Queue: Marco Chen <marcochen@chromium.org> Tested-by: Marco Chen <marcochen@chromium.org> [modify] https://crrev.com/506bc9bcf07c4300fcddccc1c9eb12b0fb75a903/chromeos-config/libcros_config/identity_x86.h [modify] https://crrev.com/506bc9bcf07c4300fcddccc1c9eb12b0fb75a903/init/chromeos_startup [modify] https://crrev.com/506bc9bcf07c4300fcddccc1c9eb12b0fb75a903/chromeos-config/libcros_config/cros_config.cc [modify] https://crrev.com/506bc9bcf07c4300fcddccc1c9eb12b0fb75a903/chromeos-config/libcros_config/cros_config.h [modify] https://crrev.com/506bc9bcf07c4300fcddccc1c9eb12b0fb75a903/chromeos-config/libcros_config/identity_x86.cc |
||||||||
►
Sign in to add a comment |
||||||||
Comment 1 by sjg@chromium.org
, Jan 2 2018