Fix for the new 2.8 feature to have modprobe check for builtins.

uname output includes a newline.  strip() the newline so that the
filepath we construct points to the right place.
pull/50613/head
Toshio Kuratomi 6 years ago
parent 2d890105f1
commit eb4249c7da

@ -52,6 +52,7 @@ EXAMPLES = '''
params: 'numdummies=2' params: 'numdummies=2'
''' '''
import os.path
import shlex import shlex
import traceback import traceback
@ -94,7 +95,9 @@ def main():
command = [module.get_bin_path('uname', True), '-r'] command = [module.get_bin_path('uname', True), '-r']
rc, uname_kernel_release, err = module.run_command(command) rc, uname_kernel_release, err = module.run_command(command)
module_file = '/' + name + '.ko' module_file = '/' + name + '.ko'
with open('/lib/modules/' + uname_kernel_release + '/modules.builtin') as builtins: builtin_path = os.path.join('/lib/modules/', uname_kernel_release.strip(),
'modules.builtin')
with open(builtin_path) as builtins:
for line in builtins: for line in builtins:
if line.endswith(module_file): if line.endswith(module_file):
present = True present = True

Loading…
Cancel
Save