[brcm-th-svk]: Fix errors in BCM956960K switch (#4390)
Fix Broadcom TH SVK boot up crash
This commit is contained in:
parent
a2cc6b6594
commit
606db589b8
@ -1 +1 @@
|
|||||||
SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/config_th_32x100.bcm
|
SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/th_32x100.config.bcm
|
||||||
|
@ -8,10 +8,12 @@
|
|||||||
# - the eeprom format definition
|
# - the eeprom format definition
|
||||||
# - specific encoder/decoder if there is special need
|
# - specific encoder/decoder if there is special need
|
||||||
#
|
#
|
||||||
# Note: the file /etc/sys_eeprom.bin is generated by the script
|
# Note: the file /usr/share/sonic/platform/sys_eeprom.bin is generated
|
||||||
# brcm-xlr-gts-create-eeprom-file.py
|
# by the script brcm-xlr-gts-create-eeprom-file.py
|
||||||
#############################################################################
|
#############################################################################
|
||||||
|
|
||||||
|
import os
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from sonic_eeprom import eeprom_tlvinfo
|
from sonic_eeprom import eeprom_tlvinfo
|
||||||
except ImportError, e:
|
except ImportError, e:
|
||||||
@ -21,7 +23,9 @@ except ImportError, e:
|
|||||||
class board(eeprom_tlvinfo.TlvInfoDecoder):
|
class board(eeprom_tlvinfo.TlvInfoDecoder):
|
||||||
|
|
||||||
def __init__(self, name, path, cpld_root, ro):
|
def __init__(self, name, path, cpld_root, ro):
|
||||||
self.eeprom_path = "/etc/sys_eeprom.bin"
|
self.eeprom_path = "/usr/share/sonic/platform/sys_eeprom.bin"
|
||||||
|
if os.path.isfile(self.eeprom_path) is False:
|
||||||
|
self.eeprom_path = "/usr/share/sonic/device/x86_64-bcm_xlr-r0/sys_eeprom.bin"
|
||||||
super(board, self).__init__(self.eeprom_path, 0, '', False, True)
|
super(board, self).__init__(self.eeprom_path, 0, '', False, True)
|
||||||
|
|
||||||
def serial_number_str(self, e):
|
def serial_number_str(self, e):
|
||||||
|
@ -93,13 +93,13 @@ def main():
|
|||||||
tlvinfo_header.totallen = len(tlvinfo_data.dump())+4;
|
tlvinfo_header.totallen = len(tlvinfo_data.dump())+4;
|
||||||
|
|
||||||
try:
|
try:
|
||||||
f = open('/etc/sys_eeprom.bin', 'w+')
|
f = open('/usr/share/sonic/device/x86_64-bcm_xlr-r0/sys_eeprom.bin', 'w+')
|
||||||
f.write(tlvinfo_header.dump())
|
f.write(tlvinfo_header.dump())
|
||||||
f.write(tlvinfo_data.dump())
|
f.write(tlvinfo_data.dump())
|
||||||
f.write(crc(tlvinfo_header.dump(), tlvinfo_data.dump()))
|
f.write(crc(tlvinfo_header.dump(), tlvinfo_data.dump()))
|
||||||
f.close()
|
f.close()
|
||||||
except:
|
except:
|
||||||
print('Unable to write file /etc/sys_eeprom.bin')
|
print('Unable to write file /usr/share/sonic/device/x86_64-bcm_xlr-r0/sys_eeprom.bin')
|
||||||
|
|
||||||
if __name__== "__main__":
|
if __name__== "__main__":
|
||||||
main()
|
main()
|
||||||
|
Loading…
Reference in New Issue
Block a user