Commits

Michał Górny committed 6e61c60

Support GRUB bootloader.

  • Participants
  • Parent commits b73fc9e

Comments (0)

Files changed (2)

File ecleankernel/grub.py

+#	vim:fileencoding=utf-8
+# (c) 2010 Michał Górny <mgorny@gentoo.org>
+# Released under the terms of the 2-clause BSD license.
+
+import re
+
+def get_grub_kernels():
+	kernel_re = re.compile(r'^\s*kernel\s*(\S+)',
+			re.MULTILINE | re.IGNORECASE)
+
+	f = open('/boot/grub/grub.conf')
+	for m in kernel_re.finditer(f.read()):
+		yield m.group(1)
+	f.close()

File ecleankernel/process.py

 
 import os, os.path
 
+from .grub import get_grub_kernels
 from .lilo import get_lilo_kernels
 from .symlinks import get_vmlinuz_symlinks
 
 bootloaders = (
 	('lilo', get_lilo_kernels),
+	('grub', get_grub_kernels),
 	('symlinks', get_vmlinuz_symlinks),
 )