From 042b9d31bb3c0484a9e8e719816b6184980d1c14 Mon Sep 17 00:00:00 2001 From: Samuel Angebault Date: Thu, 1 Jun 2017 13:30:14 -0700 Subject: [PATCH 1/5] Bump sonic-platform-modules-arista submodule --- platform/broadcom/sonic-platform-modules-arista | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/broadcom/sonic-platform-modules-arista b/platform/broadcom/sonic-platform-modules-arista index 43ed7b2330f2..393e5e1f19fd 160000 --- a/platform/broadcom/sonic-platform-modules-arista +++ b/platform/broadcom/sonic-platform-modules-arista @@ -1 +1 @@ -Subproject commit 43ed7b2330f2c7928f8098ca6c78bd9533b918c5 +Subproject commit 393e5e1f19fd33853bb375d70a10fa7cf4613e4a From 133cd07c61ed7710a6ab592887a5abbe8efe6c12 Mon Sep 17 00:00:00 2001 From: Samuel Angebault Date: Thu, 1 Jun 2017 13:31:07 -0700 Subject: [PATCH 2/5] Use sonic_sfputil plugin from the arista library --- .../plugins/sfputil.py | 22 ++-------------- .../plugins/sfputil.py | 25 ++----------------- .../plugins/sfputil.py | 23 ++--------------- 3 files changed, 6 insertions(+), 64 deletions(-) diff --git a/device/arista/x86_64-arista_7050_qx32/plugins/sfputil.py b/device/arista/x86_64-arista_7050_qx32/plugins/sfputil.py index 5d2d28b8f328..b85e0f53653e 100644 --- a/device/arista/x86_64-arista_7050_qx32/plugins/sfputil.py +++ b/device/arista/x86_64-arista_7050_qx32/plugins/sfputil.py @@ -1,27 +1,9 @@ #!/usr/bin/env python try: - from sonic_sfp.sfputilbase import sfputilbase + import arista.utils.sonic_sfputil as arista_sfputil except ImportError, e: raise ImportError (str(e) + "- required module not found") -class sfputil(sfputilbase): - """Platform specific sfputil class""" - - port_start = 0 - port_end = 31 - ports_in_block = 32 - - eeprom_offset = 10 - - port_to_eeprom_mapping = {} - - _qsfp_ports = range(0, ports_in_block + 1) - - def __init__(self, port_num): - # Override port_to_eeprom_mapping for class initialization - eeprom_path = '/sys/class/i2c-adapter/i2c-{0}/{0}-0050/eeprom' - for x in range(0, self.port_end + 1): - self.port_to_eeprom_mapping[x] = eeprom_path.format(x + self.eeprom_offset) - sfputilbase.__init__(self, port_num) +sfputil = arista_sfputil.getSfpUtil() diff --git a/device/arista/x86_64-arista_7050_qx32s/plugins/sfputil.py b/device/arista/x86_64-arista_7050_qx32s/plugins/sfputil.py index 18472c44c55b..b85e0f53653e 100644 --- a/device/arista/x86_64-arista_7050_qx32s/plugins/sfputil.py +++ b/device/arista/x86_64-arista_7050_qx32s/plugins/sfputil.py @@ -1,30 +1,9 @@ #!/usr/bin/env python try: - from sonic_sfp.sfputilbase import sfputilbase + import arista.utils.sonic_sfputil as arista_sfputil except ImportError, e: raise ImportError (str(e) + "- required module not found") -class sfputil(sfputilbase): - """Platform specific sfputil class""" - - port_start = 0 - port_end = 31 - ports_in_block = 32 - - eeprom_offset = 10 - - port_to_eeprom_mapping = {} - - _qsfp_ports = range(0, ports_in_block + 1) - - # also has sfp[1-4] ports handled by a mux to choose against qsfp5 - # i2c-40 to i2c-43 - - def __init__(self, port_num): - # Override port_to_eeprom_mapping for class initialization - eeprom_path = '/sys/class/i2c-adapter/i2c-{0}/{0}-0050/eeprom' - for x in range(0, self.port_end + 1): - self.port_to_eeprom_mapping[x] = eeprom_path.format(x + self.eeprom_offset) - sfputilbase.__init__(self, port_num) +sfputil = arista_sfputil.getSfpUtil() diff --git a/device/arista/x86_64-arista_7060_cx32s/plugins/sfputil.py b/device/arista/x86_64-arista_7060_cx32s/plugins/sfputil.py index 0f7f0d2cac85..b85e0f53653e 100644 --- a/device/arista/x86_64-arista_7060_cx32s/plugins/sfputil.py +++ b/device/arista/x86_64-arista_7060_cx32s/plugins/sfputil.py @@ -1,28 +1,9 @@ #!/usr/bin/env python try: - from sonic_sfp.sfputilbase import sfputilbase + import arista.utils.sonic_sfputil as arista_sfputil except ImportError, e: raise ImportError (str(e) + "- required module not found") -class sfputil(sfputilbase): - """Platform specific sfputil class""" - - port_start = 0 - port_end = 33 - ports_in_block = 34 - - eeprom_offset = 18 - - port_to_eeprom_mapping = {} - - _qsfp_ports = range(0, 32 + 1) - _sfp_ports = range(33, 34 + 1) - - def __init__(self, port_num): - # Override port_to_eeprom_mapping for class initialization - eeprom_path = '/sys/class/i2c-adapter/i2c-{0}/{0}-0050/eeprom' - for x in range(0, self.port_end + 1): - self.port_to_eeprom_mapping[x] = eeprom_path.format(x + self.eeprom_offset) - sfputilbase.__init__(self, port_num) +sfputil = arista_sfputil.getSfpUtil() From 3aa7f2653e8bc23a7b81bb2449524b9b654796ad Mon Sep 17 00:00:00 2001 From: Samuel Angebault Date: Thu, 1 Jun 2017 13:42:05 -0700 Subject: [PATCH 3/5] Fix undefined variable varlog_size --- files/Aboot/boot0.j2 | 6 ++++-- files/initramfs-tools/arista-convertfs.j2 | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/files/Aboot/boot0.j2 b/files/Aboot/boot0.j2 index 7c2d202012fc..47d414d95b14 100644 --- a/files/Aboot/boot0.j2 +++ b/files/Aboot/boot0.j2 @@ -104,6 +104,10 @@ EOF platform_specific() { local platform="$(grep -Eo 'platform=[^ ]+' /etc/cmdline | cut -f2 -d=)" local sid="$(grep -Eo 'sid=[^ ]+' /etc/cmdline | cut -f2 -d=)" + + # set varlog size to 100MB + echo "varlog_size=100" >>/tmp/append + # This is temporary as the platform= and sid= parameters don't provide enough # information to identify the SKU # An initramfs hook or a later processing done by the initscripts will be @@ -111,8 +115,6 @@ platform_specific() { if [ "$platform" = "raven" ]; then aboot_machine=arista_7050_qx32 echo "modprobe.blacklist=radeon" >>/tmp/append - # set varlog size to 100MB - echo "varlog_size=100" >>/tmp/append fi if [ "$platform" = "crow" ]; then aboot_machine=arista_7050_qx32s diff --git a/files/initramfs-tools/arista-convertfs.j2 b/files/initramfs-tools/arista-convertfs.j2 index 7f873e7771f3..a15233615f98 100644 --- a/files/initramfs-tools/arista-convertfs.j2 +++ b/files/initramfs-tools/arista-convertfs.j2 @@ -84,7 +84,7 @@ run_cmd() { create_varlog_file() { local err_msg="Error: create var-log ext4 file" - local cmd="[ -n $varlog_size ] && mkdir -p $root_mnt/disk-img && dd if=/dev/zero of=$root_mnt/disk-img/var-log.ext4 count=$((2048*$varlog_size)) && mke2fs -t ext4 -q -F $root_mnt/disk-img/var-log.ext4" + local cmd="[ -n "$varlog_size" ] && mkdir -p $root_mnt/disk-img && dd if=/dev/zero of=$root_mnt/disk-img/var-log.ext4 count=$((2048*$varlog_size)) && mke2fs -t ext4 -q -F $root_mnt/disk-img/var-log.ext4" run_cmd "$cmd" "$err_msg" } From cfc508718fb9453dbeb239812618b236b3016f00 Mon Sep 17 00:00:00 2001 From: Samuel Angebault Date: Thu, 1 Jun 2017 13:53:50 -0700 Subject: [PATCH 4/5] Prevent minigraph.xml to be removed from the flash --- files/Aboot/boot0.j2 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/files/Aboot/boot0.j2 b/files/Aboot/boot0.j2 index 47d414d95b14..48c5c5010213 100644 --- a/files/Aboot/boot0.j2 +++ b/files/Aboot/boot0.j2 @@ -44,7 +44,10 @@ parse_environment_config() { clean_flash() { ## Remove all the other unnecssary files except swi file, boot-config for f in $(ls -A $target_path); do - if [ $f != "${swipath##*/}" ] && [ $f != "boot-config" ]; then + if [ $f != "${swipath##*/}" ] && + [ $f != "boot-config" ] && + [ $f != "minigraph.xml" ] + then rm -rf "$target_path/$f" fi done From a4c0dee00245558d0e9b3daaeb98f802203d68e5 Mon Sep 17 00:00:00 2001 From: Samuel Angebault Date: Thu, 1 Jun 2017 14:01:19 -0700 Subject: [PATCH 5/5] Update DCS-7050QX-32 sensors config --- .../x86_64-arista_7050_qx32/sensors.conf | 47 ++++++++++--------- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/device/arista/x86_64-arista_7050_qx32/sensors.conf b/device/arista/x86_64-arista_7050_qx32/sensors.conf index 7745054a05ca..dde0d35df8cb 100644 --- a/device/arista/x86_64-arista_7050_qx32/sensors.conf +++ b/device/arista/x86_64-arista_7050_qx32/sensors.conf @@ -1,7 +1,7 @@ -# libsensors configuration file -# ---------------------------------------------- -# - +# libsensors configuration file for DCS-7050QX-32 +# ------------------------------------------------ +# + bus "i2c-2" "SCD SMBus master 0 bus 0" bus "i2c-3" "SCD SMBus master 0 bus 1" bus "i2c-5" "SCD SMBus master 0 bus 3" @@ -13,31 +13,33 @@ chip "k10temp-pci-00c3" chip "lm73-i2c-3-48" label temp1 "Rear Temp Sensor" - set temp1_max 65 + set temp1_max 65 #set temp1_max_alarm 75 # read-only -chip "lm86-i2c-2-4c" +chip "max6658-i2c-2-4c" label temp1 "Board Temp Sensor" - set temp1_max 65 + set temp1_max 65 set temp1_crit 75 label temp2 "Front-panel Temp Sensor" set temp2_max 65 set temp2_crit 75 - -chip "pmbus-i2c-3-4e" - label temp1 "Power Controller Sensor 1" - set temp1_max 60 - set temp1_crit 70 - - label temp2 "Power Controller Sensor 2" - set temp2_max 60 - set temp2_crit 70 - ignore curr1 - -chip "pmbus-i2c-5-58" +# disabled because of some eeprom corruption risks +#chip "pmbus-i2c-3-4e" +# label temp1 "Power Controller Sensor 1" +# set temp1_max 60 +# set temp1_crit 70 + +# label temp2 "Power Controller Sensor 2" +# set temp2_max 60 +# set temp2_crit 70 + +# ignore curr1 + +chip "dps460-i2c-5-58" label temp1 "Power Supply 1 Sensor 1" + # maximum and critical thresholds are not supported for this psu set temp1_max 60 set temp1_crit 70 @@ -56,16 +58,17 @@ chip "pmbus-i2c-5-58" set curr1_crit 5.30 set curr2_max 36 set curr2_crit 37 - -chip "pmbus-i2c-6-58" + +chip "dps460-i2c-6-58" label temp1 "Power Supply 2 Sensor 1" + # maximum and critical thresholds are not supported for this psu set temp1_max 60 set temp1_crit 70 label temp2 "Power Supply 2 Sensor 2" set temp2_max 60 set temp2_crit 70 - + ignore temp3 set in1_max 250