diff --git a/pym/cl_utils.py b/pym/cl_utils.py index 5fea955..6da750d 100644 --- a/pym/cl_utils.py +++ b/pym/cl_utils.py @@ -1339,3 +1339,17 @@ def getPasswdUsers(minId=1000,maxId=65000): sortUsers.sort() retList = ["root"] + sortUsers return retList + +def getCmdLineParam(paramName): + """Get value of param /proc/cmdline. If param not found then empty. + """ + cmdLine = '/proc/cmdline' + paramName = "%s="%paramName + params = \ + map(lambda x:x.partition('=')[2], + filter(lambda x:x.startswith(paramName), + readFile(cmdLine).split(' '))) + if params: + return params[-1] + else: + return ""