mirror of
https://github.com/valitydev/salt.git
synced 2024-11-06 16:45:27 +00:00
Merge pull request #43962 from bobrik/kmod-built-in
Report built-in modiles in kmod.available, fixes #43945
This commit is contained in:
commit
fec714b91d
@ -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_:
|
||||
|
Loading…
Reference in New Issue
Block a user