Skip to content

Commit

Permalink
[device/accton] Fix accton driver not been installed (#6327)
Browse files Browse the repository at this point in the history
Accton util applies lsmod to check if drivers are installed.
But lsmod may return error on startup and skip module installation.

Signed-off-by: Brandon Chuang <brandon_chuang@edge-core.com>
  • Loading branch information
brandonchuang authored and lguohan committed Jan 15, 2021
1 parent 29562d0 commit c40e43a
Show file tree
Hide file tree
Showing 17 changed files with 75 additions and 51 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -240,11 +240,12 @@ def log_os_system(cmd, show):
return status, output

def driver_inserted():
ret, lsmod = log_os_system("ls /sys/module/ | grep accton", 0)
ret, lsmod = log_os_system("ls /sys/module/*accton*", 0)
logging.info('mods:'+lsmod)
if not lsmod:
if ret :
return False

else :
return True

kos = [
'depmod -ae',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,12 @@ def log_os_system(cmd, show):
return status, output

def driver_check():
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:
return False
return True
if ret :
return False
else :
return True

kos = [
'modprobe i2c_dev',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,10 +240,12 @@ def log_os_system(cmd, show):
return status, output

def driver_inserted():
ret, lsmod = log_os_system("ls /sys/module | 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



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,12 @@ def log_os_system(cmd, show):
return status, output

def driver_check():
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:
return False
return True
if ret :
return False
else :
return True



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,12 @@ def log_os_system(cmd, show):
return status, output

def driver_check():
ret, lsmod = log_os_system("ls /sys/module/ | 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
return True
else :
return True



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,10 +249,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



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,12 @@ def log_os_system(cmd, show):


def driver_check():
(ret, lsmod) = log_os_system('ls /sys/module/ | grep accton', 0)
logging.info('mods:' + lsmod)
if not lsmod:
ret, lsmod = log_os_system("ls /sys/module/*accton*", 0)
logging.info('mods:'+lsmod)
if ret :
return False
return True
else :
return True


kos = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,12 @@ def log_os_system(cmd, show):
return status, output

def driver_check():
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:
return False
return True
if ret :
return False
else :
return True



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,12 @@ def log_os_system(cmd, show):
return status, output

def driver_check():
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:
return False
return True
if ret :
return False
else :
return True



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,12 @@ def log_os_system(cmd, show):
return status, output

def driver_check():
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
return True
else :
return True



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,12 @@ def log_os_system(cmd, show):
return status, output

def driver_check():
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:
return False
return True
if ret :
return False
else :
return True



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,10 +267,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',

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,10 +240,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


kos = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,10 +248,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

def cpld_reset_mac():
ret, lsmod = log_os_system("i2cset -y 0 0x77 0x1", 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,12 @@ def log_os_system(cmd, show):
return status, output

def driver_check():
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:
return False
return True
if ret :
return False
else :
return True



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,10 +254,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


kos = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,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



Expand Down

0 comments on commit c40e43a

Please sign in to comment.