From 1dbcaeb04ae5ead4522a0c0b83ab7578b7dc47b3 Mon Sep 17 00:00:00 2001 From: Joe LeVeque Date: Thu, 1 Apr 2021 00:01:47 -0700 Subject: [PATCH] Remove gbsyncd_startup.py (#813) gbsyncd_startup.py has been replaced by gbsyncdmgrd. References have been updated in sonic-buildimage, so we can now safely remove gbsyncd_startup.py. --- syncd/scripts/gbsyncd_startup.py | 59 -------------------------------- 1 file changed, 59 deletions(-) delete mode 100755 syncd/scripts/gbsyncd_startup.py diff --git a/syncd/scripts/gbsyncd_startup.py b/syncd/scripts/gbsyncd_startup.py deleted file mode 100755 index e1bd25d7c3e7..000000000000 --- a/syncd/scripts/gbsyncd_startup.py +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/env python3 - -''' -NOTE: This script is deprecated in favor of gbsyncdmgrd - Once there are no more references to this file in - sonic-buildimage, it should be removed -''' - -''' -Copyright 2019 Broadcom. The term "Broadcom" refers to Broadcom Inc. -and/or its subsidiaries. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - ''' -import os -import sys -import json -import time -import syslog -import subprocess - - -def physyncd_enable(gearbox_config): - i = 1 - for phy in gearbox_config['phys']: - subprocess.Popen(["/bin/bash", "-c", "/bin/bash -c {}".format('"exec /usr/bin/syncd -p /etc/sai.d/pai.profile -x /usr/share/sonic/hwsku/context_config.json -g {}"'.format(i))], close_fds=True) - i += 1 - -def main(): - - # Only privileged users can execute this command - if os.geteuid() != 0: - sys.exit("Root privileges required for this operation") - - """ Loads json file """ - try: - with open('/usr/share/sonic/hwsku/gearbox_config.json') as file_object: - gearbox_config=json.load(file_object) - except: - syslog.syslog(syslog.LOG_NOTICE, "No external PHY / gearbox supported on this platform, existing gbsyncd application") - time.sleep(2) - sys.exit(0) - - physyncd_enable(gearbox_config) - - -if __name__== "__main__": - main() -