Merge pull request #43962 from bobrik/kmod-built-in

Report built-in modiles in kmod.available, fixes #43945
This commit is contained in:
Nicole Thomas 2017-10-10 12:31:39 -04:00 committed by GitHub
commit fec714b91d

View File

@ -123,7 +123,16 @@ def available():
salt '*' kmod.available
'''
ret = []
mod_dir = os.path.join('/lib/modules/', os.uname()[2])
built_in_file = os.path.join(mod_dir, 'modules.builtin')
if os.path.exists(built_in_file):
with salt.utils.fopen(built_in_file, 'r') as f:
for line in f:
# Strip .ko from the basename
ret.append(os.path.basename(line)[:-4])
for root, dirs, files in os.walk(mod_dir):
for fn_ in files:
if '.ko' in fn_: