From 191e90e400674685f50dc4261194d805ae768bf7 Mon Sep 17 00:00:00 2001 From: Roy Lee Date: Sun, 7 Feb 2021 05:56:16 +0800 Subject: [PATCH] [device/accton/as4630-54pe] Fix accton driver not been installed (#6321) Accton util applies lsmod to check if drivers are installed. But lsmod may return error on startup and skip module installation. Signed-off-by: roy_lee --- .../as4630-54pe/utils/accton_as4630_54pe_util.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/utils/accton_as4630_54pe_util.py b/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/utils/accton_as4630_54pe_util.py index ed0df177ee..4039119288 100755 --- a/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/utils/accton_as4630_54pe_util.py +++ b/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/utils/accton_as4630_54pe_util.py @@ -214,10 +214,12 @@ def log_os_system(cmd, show): return status, output def driver_inserted(): - ret, lsmod = log_os_system("lsmod| grep accton", 0) + ret, lsmod = log_os_system("ls /sys/module/*accton*", 0) logging.info('mods:'+lsmod) - if len(lsmod) ==0: + if ret : return False + else : + return True #'modprobe cpr_4011_4mxx',