Identifying platform on sonic

483 views
Skip to first unread message

Shantanu Shrivastava

unread,
Sep 21, 2022, 4:16:00 AM9/21/22
to sonicproject
Hi Team,
One general question. How does a sonic platform identify which hardware it is. Is configuring hwsku in config_db.json the only way to differentiate?
Or does sonic read some fru number from h/w and save it in config_db?

Regards,
Shantanu

Samuel Angebault

unread,
Sep 21, 2022, 4:32:19 AM9/21/22
to Shantanu Shrivastava, sonicproject
Hi,

Usually ONIE (or a bootloader) will populate the /host/machine.conf with platform specific information.
From there a few places will use this information, most notably /etc/rc.local
I've always found the `platform` and `hwsku` kinda confusing,
 - `platform` means your hardware platform which initially comes from /host/machine.conf
    configurations under /usr/share/sonic/device/$platform
 - `hwsku` refers to a default port configuration for your platform which initially comes from minigraph.xml or default_sku
    configurations under /usr/share/sonic/device/$platform/$hwsku

Thanks,

--
You received this message because you are subscribed to the Google Groups "sonicproject" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonicproject...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonicproject/4848d091-2664-44b7-b170-952339af2e8en%40googlegroups.com.


--
Samuel Angebault - Staphylo

Ashwin H

unread,
Sep 22, 2022, 4:37:20 AM9/22/22
to sonicproject

Hi Samuel,

Thanks for the info. Does that mean we don't read anything from fru eeprom to differentiate the platform in Platform Independent code ?

 Is eeprom contents vendor dependent or is there any format to which fru eeprom needs to be programmed ?


Thanks,
Ashwin

Samuel Angebault

unread,
Sep 22, 2022, 5:35:41 AM9/22/22
to Ashwin H, sonicproject
Hi Ashwin,

At a later stage of the boot, the system eeprom is being read by SONiC.
If you have the choice, the recommendation is to use the ONIE eeprom format.
If you use the ONIE format things will be painless as you'll just need some glue logic.
We use a different eeprom format and it takes work to make it fit into the model.

You should check these links:

Thanks,

Ashwin H

unread,
Sep 23, 2022, 1:57:18 AM9/23/22
to sonicproject
Hi Samuel,

Thanks for the details. I will go thru this and come back if i have any questions.

Thanks,
Ashwin

Reply all
Reply to author
Forward
0 new messages