aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Lutomirski <luto@kernel.org>2019-10-04 11:24:07 -0700
committerAndy Lutomirski <luto@kernel.org>2019-10-04 11:24:07 -0700
commite6a86f7ea54b68a791a81dfc7245127331f1a101 (patch)
treecf7752c9683c92b0304d57743261946d73251da0
parentc36d03107b0fc20d67f823c94f29481ecefcefac (diff)
downloadvirtme-e6a86f7ea54b68a791a81dfc7245127331f1a101.tar.gz
Honor --mods=none with --installed-kernel
It's unlikely that --installed-kernel actually works with --mods=none, but I think that we should try it and possibly fail to boot rather than just ignoring the --mods setting. Signed-off-by: Andy Lutomirski <luto@kernel.org>
-rw-r--r--virtme/commands/run.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/virtme/commands/run.py b/virtme/commands/run.py
index db2ce2e..85708ae 100644
--- a/virtme/commands/run.py
+++ b/virtme/commands/run.py
@@ -159,9 +159,13 @@ def find_kernel_and_mods(arch, args) -> Kernel:
if args.installed_kernel is not None:
kver = args.installed_kernel
- kernel.modfiles = modfinder.find_modules_from_install(
- virtmods.MODALIASES, kver=kver)
- kernel.moddir = os.path.join('/lib/modules', kver)
+ if args.mods != 'none':
+ kernel.modfiles = modfinder.find_modules_from_install(
+ virtmods.MODALIASES, kver=kver)
+ kernel.moddir = os.path.join('/lib/modules', kver)
+ else:
+ kernel.modfiles = None
+ kernel.moddir = None
kernel.kimg = '/usr/lib/modules/%s/vmlinuz' % kver
if not os.path.exists(kernel.kimg):
kernel.kimg = '/boot/vmlinuz-%s' % kver