From 675721e5521c52b1d46babeb1c2d9fa388a34b10 Mon Sep 17 00:00:00 2001 From: Ying Xie Date: Thu, 18 Jan 2018 17:59:46 +0000 Subject: [PATCH 1/2] [Arista7260cx3] Add platform specific reboot tool --- .../x86_64-arista_7260cx3_64/platform_reboot | 87 +++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100755 device/arista/x86_64-arista_7260cx3_64/platform_reboot diff --git a/device/arista/x86_64-arista_7260cx3_64/platform_reboot b/device/arista/x86_64-arista_7260cx3_64/platform_reboot new file mode 100755 index 00000000000..8a372246115 --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/platform_reboot @@ -0,0 +1,87 @@ +#!/usr/bin/env python +# Copyright (c) 2018 Arista Networks, Inc. All rights reserved. +# Arista Networks, Inc. Confidential and Proprietary. + +# Reboot script for 7260CX3 + +from __future__ import print_function +import sys +import mmap, os +import subprocess +from struct import pack, unpack + +class MmapResource( object ): + """Resource implementation for a directly-mapped memory region.""" + + def __init__( self, path ): + try: + fd = os.open( path, os.O_RDWR ) + except EnvironmentError: + print( "FAIL can not open scd memory-map resource file" ) + print( "FAIL are you running on the proper platform?" ) + sys.exit( 1 ) + try: + size = os.fstat( fd ).st_size + except EnvironmentError: + print( "FAIL can not fstat scd memory-map resource file" ) + print( "FAIL are you running on the proper platform?" ) + sys.exit( 1 ) + try: + self.mmap_ = mmap.mmap( fd, size, mmap.MAP_SHARED, + mmap.PROT_READ | mmap.PROT_WRITE ) + except EnvironmentError: + print( "FAIL can not map scd memory-map file" ) + print( "FAIL are you running on the proper platform?" ) + sys.exit( 1 ) + finally: + try: + # Note that closing the file descriptor has no effect on the memory map + os.close( fd ) + except EnvironmentError: + print( "FAIL failed to close scd memory-map file" ) + sys.exit( 1 ) + + def read32( self, addr ): + return unpack( ' Date: Thu, 18 Jan 2018 23:55:06 +0000 Subject: [PATCH 2/2] [utilities] update sonic-utilities submodule --- src/sonic-utilities | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-utilities b/src/sonic-utilities index 495584bd2f2..26c3709786a 160000 --- a/src/sonic-utilities +++ b/src/sonic-utilities @@ -1 +1 @@ -Subproject commit 495584bd2f228af81934b23e4cf19648ab387fab +Subproject commit 26c3709786a4072625d7f3ebb9f2e52d798a3ba0