Commits

Michał Górny committed 564856a

Support more kernel name prefixes (vmlinux-, kernel-, bzImage-).

Comments (0)

Files changed (2)

ecleankernel/kernel.py

 
 	globs = (
 		('vmlinuz', '/boot/vmlinuz-'),
+		('vmlinuz', '/boot/vmlinux-'),
+		('vmlinuz', '/boot/kernel-'),
+		('vmlinuz', '/boot/bzImage-'),
 		('systemmap', '/boot/System.map-'),
 		('config', '/boot/config-'),
 		('modules', '/lib/modules/')

ecleankernel/process.py

 # (c) 2010 Michał Górny <mgorny@gentoo.org>
 # Released under the terms of the 2-clause BSD license.
 
-import os, os.path
+import os, os.path, re
 
 from .grub import get_grub_kernels
 from .lilo import get_lilo_kernels
 				raise SystemError('Unable to get kernels from bootloader config (%s)'
 						% bootloader)
 
-			prefix = '/boot/vmlinuz-'
+			prefix = re.compile(r'^/boot/(vmlinu[xz]|kernel|bzImage)-')
 			def unprefixify(filenames):
 				for fn in filenames:
-					if fn.startswith(prefix):
-						yield fn[len(prefix):]
+					kv, numsubs = prefix.subn('', fn)
+					if numsubs == 1:
+						yield kv
 					else:
 						print('Note: strangely named used kernel (%s)' % fn)