aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Lutomirski <luto@kernel.org>2019-08-15 12:29:05 -0700
committerAndy Lutomirski <luto@kernel.org>2019-08-15 12:29:05 -0700
commitf4cd13a9c6328633f8af729d777ad9490e7cf585 (patch)
treefaa2e1f7c7d08c6cb2c312bd55f9816ecdf11f5d
parent4b58c65bdc5a04874f4b4930a0ffdcd405f48a65 (diff)
parent7625c4d8c95f72f2661774b7942369f76736b259 (diff)
downloadvirtme-f4cd13a9c6328633f8af729d777ad9490e7cf585.tar.gz
Merge pull request #32 from marcosps/mpdesouza_modprobe_suse with fixes
-rw-r--r--virtme/modfinder.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/virtme/modfinder.py b/virtme/modfinder.py
index 02f0924..f0a0601 100644
--- a/virtme/modfinder.py
+++ b/virtme/modfinder.py
@@ -12,6 +12,7 @@ everything. The idea is to require very few modules.
"""
import re
+import shutil
import subprocess
import os, os.path
import itertools
@@ -19,7 +20,9 @@ import itertools
_INSMOD_RE = re.compile('insmod (.*[^ ]) *$')
def resolve_dep(modalias, root=None, kver=None, moddir=None):
- args = ['modprobe', '--show-depends']
+ # /usr/sbin might not be in the path, and modprobe is usually in /usr/sbin
+ modprobe = shutil.which('modprobe') or '/usr/sbin/modprobe'
+ args = [modprobe, '--show-depends']
args += ['-C', '/var/empty']
if root is not None:
args += ['-d', root]