Commits

Michał Górny committed 05eef3e

Handle modules for removed kernels as well.

Comments (0)

Files changed (1)

ecleankernel/kernel.py

 		('vmlinuz', '/boot/kernel-'),
 		('vmlinuz', '/boot/bzImage-'),
 		('systemmap', '/boot/System.map-'),
-		('config', '/boot/config-')
+		('config', '/boot/config-'),
+		('modules', '/lib/modules/')
 	)
 
 	# paths can repeat, so keep them sorted
 	for cat, g in globs:
 		for m in glob('%s*' % g):
 			kv = m[len(g):]
+			if cat == 'modules' and m in paths:
+				continue
 			path = paths[m]
 			newk = kernels[kv]
 			setattr(newk, cat, path)
+			if cat == 'modules' and '%s.old' % kv in kernels:
+				kernels['%s.old' % kv].modules = path
 			if cat == 'vmlinuz':
 				realkv = get_real_kv(path)
 				moduledir = os.path.join('/lib/modules', realkv)