aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Lutomirski <luto@kernel.org>2019-09-27 13:52:14 -0700
committerAndy Lutomirski <luto@kernel.org>2019-09-27 13:52:14 -0700
commitcb44dbf0df720095e588f6f583f57d8311a9184b (patch)
treefd1b366a4f14e73b1d3a8d01f55ddf4d5c31f1ac
parent8008a850db92304954660187a6dab3f4c6de1dbb (diff)
downloadvirtme-cb44dbf0df720095e588f6f583f57d8311a9184b.tar.gz
Fix --mods=auto with --kdir != .
Signed-off-by: Andy Lutomirski <luto@kernel.org>
-rwxr-xr-xbin/virtme-prep-kdir-mods2
-rw-r--r--virtme/commands/run.py7
-rw-r--r--virtme/resources.py (renamed from virtme/guest_tools.py)4
3 files changed, 7 insertions, 6 deletions
diff --git a/bin/virtme-prep-kdir-mods b/bin/virtme-prep-kdir-mods
index be28fb6..089bce6 100755
--- a/bin/virtme-prep-kdir-mods
+++ b/bin/virtme-prep-kdir-mods
@@ -2,7 +2,7 @@
# This is still a bit of an experiment.
-if ! [ -d .tmp_versions ]; then
+if ! [ -f modules.order ]; then
echo 'virtme-prep-kdir-mods must be run from a kernel build directory' >&2
exit 1
fi
diff --git a/virtme/commands/run.py b/virtme/commands/run.py
index 263bdd2..1274fa3 100644
--- a/virtme/commands/run.py
+++ b/virtme/commands/run.py
@@ -24,7 +24,7 @@ from .. import modfinder
from .. import mkinitramfs
from .. import qemu_helpers
from .. import architectures
-from .. import guest_tools
+from .. import resources
uname = os.uname()
@@ -185,7 +185,8 @@ def find_kernel_and_mods(arch, args):
else:
# Auto-refresh virtme's kernel modules directory
try:
- guest_tools.run_script('virtme-prep-kdir-mods')
+ resources.run_script('virtme-prep-kdir-mods',
+ cwd=args.kdir)
except subprocess.CalledProcessError:
raise SilentError()
kernel.moddir = os.path.join(virtme_mods, 'lib/modules', '0.0.0')
@@ -263,7 +264,7 @@ def do_it():
# Set up virtfs
export_virtfs(qemu, arch, qemuargs, args.root, '/dev/root', readonly=(not args.rw))
- guest_tools_path = guest_tools.find_guest_tools()
+ guest_tools_path = resources.find_guest_tools()
if guest_tools_path is None:
raise ValueError("couldn't find guest tools -- virtme is installed incorrectly")
diff --git a/virtme/guest_tools.py b/virtme/resources.py
index 2505b49..d07e981 100644
--- a/virtme/guest_tools.py
+++ b/virtme/resources.py
@@ -37,6 +37,6 @@ def find_script(name) -> str:
# No luck. This is somewhat surprising.
raise Exception('could not find script %s' % name)
-def run_script(name) -> None:
+def run_script(name, **kwargs) -> None:
fn = find_script(name)
- subprocess.check_call(executable=fn, args=[fn])
+ subprocess.check_call(executable=fn, args=[fn], **kwargs)