[brcm-th-svk]: Fix errors in BCM956960K switch (#4390)
Fix Broadcom TH SVK boot up crash
This commit is contained in:
parent
db5da0f712
commit
e843d994d0
@ -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
|
||||
# - specific encoder/decoder if there is special need
|
||||
#
|
||||
# Note: the file /etc/sys_eeprom.bin is generated by the script
|
||||
# brcm-xlr-gts-create-eeprom-file.py
|
||||
# Note: the file /usr/share/sonic/platform/sys_eeprom.bin is generated
|
||||
# by the script brcm-xlr-gts-create-eeprom-file.py
|
||||
#############################################################################
|
||||
|
||||
import os
|
||||
|
||||
try:
|
||||
from sonic_eeprom import eeprom_tlvinfo
|
||||
except ImportError, e:
|
||||
@ -21,7 +23,9 @@ except ImportError, e:
|
||||
class board(eeprom_tlvinfo.TlvInfoDecoder):
|
||||
|
||||
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)
|
||||
|
||||
def serial_number_str(self, e):
|
||||
|
@ -93,13 +93,13 @@ def main():
|
||||
tlvinfo_header.totallen = len(tlvinfo_data.dump())+4;
|
||||
|
||||
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_data.dump())
|
||||
f.write(crc(tlvinfo_header.dump(), tlvinfo_data.dump()))
|
||||
f.close()
|
||||
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__":
|
||||
main()
|
||||
|
Loading…
Reference in New Issue
Block a user