Skip to content
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

pillar: hardware: Read SoC serial number from sysfs #3024

Merged
merged 1 commit into from
Feb 9, 2023

Conversation

rene
Copy link
Contributor

@rene rene commented Feb 6, 2023

SoC platform driver exports SoC unique serial number through sysfs, which usually can be read in /sys/devices/soc0/serial_number. Pillar doesn't consider this resource to look at it for device's serial number.

This PR does the following:

  • Adds /sys/devices/soc0/serial_number as a resource to look at it for device's serial number

  • Fixes checking of dmidecode result: Pillar uses primarily dmidecode to find device's serial number. If no serial number is found, dmidecode can return the "Not Specified" string, instead of null. If "" or "Not Specified" is returned, call getCPUSerial() to look into auxiliary resources.

PS1: This issue was observed in i.MX8MP platform. PR was tested successfully using changes from PR #3022

PS2: Yetus is failing because of ioutils deprecated errors (fixed in #3021). This PR uses os.ReadFile() already.

Signed-off-by: Renê de Souza Pinto rene@renesp.com.br

SoC platform driver exports SoC unique serial number through sysfs, which
usually can be read in /sys/devices/soc0/serial_number. Pillar doesn't
consider this resource to look at it for device's serial number.

This commit does the following:

- Adds /sys/devices/soc0/serial_number as a resource to look at it for
  device's serial number

- Fixes checking of dmidecode result: Pillar uses primarily dmidecode to
  find device's serial number. If no serial number is found, dmidecode can
  return the "Not Specified" string, instead of null. If "" or "Not
  Specified" is returned, call getCPUSerial() to look into auxiliary
  resources.

Signed-off-by: Renê de Souza Pinto <rene@renesp.com.br>
Copy link
Contributor

@eriknordmark eriknordmark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@eriknordmark eriknordmark merged commit 3501abf into lf-edge:master Feb 9, 2023
@rene rene deleted the soc-id branch March 15, 2023 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants