From 8131feaadeb6f05eb6651d254f1a9bcf4820637e Mon Sep 17 00:00:00 2001 From: Matt Jeffery Date: Thu, 20 Feb 2014 16:50:09 +0000 Subject: [PATCH] Normalise the module name when comparing against the module names in /proc/modules. --- library/system/modprobe | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/library/system/modprobe b/library/system/modprobe index 82ca86b9bd5..864952ae5b0 100644 --- a/library/system/modprobe +++ b/library/system/modprobe @@ -60,8 +60,9 @@ def main(): try: modules = open('/proc/modules') present = False + module_name = args['name'].replace('-', '_') + ' ' for line in modules: - if line.startswith(args['name'] + ' '): + if line.startswith(module_name): present = True break modules.close()