aboutsummaryrefslogtreecommitdiffstats
path: root/tools/pygrub
diff options
context:
space:
mode:
Diffstat (limited to 'tools/pygrub')
-rw-r--r--tools/pygrub/examples/alpine-linux-2.3.2.extlinux11
-rw-r--r--tools/pygrub/src/ExtLinuxConf.py11
2 files changed, 21 insertions, 1 deletions
diff --git a/tools/pygrub/examples/alpine-linux-2.3.2.extlinux b/tools/pygrub/examples/alpine-linux-2.3.2.extlinux
new file mode 100644
index 0000000000..908b4070f1
--- /dev/null
+++ b/tools/pygrub/examples/alpine-linux-2.3.2.extlinux
@@ -0,0 +1,11 @@
+DEFAULT menu.c32
+PROMPT 0
+MENU TITLE Alpine/Linux Boot Menu
+MENU HIDDEN
+MENU AUTOBOOT Alpine will be booted automatically in # seconds.
+TIMEOUT 30
+LABEL grsec
+ MENU DEFAULT
+ MENU LABEL Linux 3.0.10-grsec
+ KERNEL vmlinuz-3.0.10-grsec
+ APPEND initrd=initramfs-3.0.10-grsec root=UUID=a97ffe64-430f-4fd3-830e-4736d9a27af0 modules=sd-mod,usb-storage,ext4 quiet
diff --git a/tools/pygrub/src/ExtLinuxConf.py b/tools/pygrub/src/ExtLinuxConf.py
index 6be65cef1d..9d77b9f9bb 100644
--- a/tools/pygrub/src/ExtLinuxConf.py
+++ b/tools/pygrub/src/ExtLinuxConf.py
@@ -60,6 +60,13 @@ class ExtLinuxImage(object):
# Bypass regular self.commands handling
com = None
+ elif arg.find("initrd="):
+ # find initrd image in append line
+ args = arg.strip().split(" ")
+ for a in args:
+ if a.lower().startswith("initrd="):
+ setattr(self, "initrd", a.replace("initrd=", ""))
+ arg = arg.replace(a, "")
if com is not None and self.commands.has_key(com):
if self.commands[com] is not None:
@@ -86,10 +93,12 @@ class ExtLinuxImage(object):
self._args = args
def get_kernel(self):
return self._kernel
+ def set_args(self, val):
+ self._args = val
def get_args(self):
return self._args
kernel = property(get_kernel, set_kernel)
- args = property(get_args)
+ args = property(get_args, set_args)
def set_initrd(self, val):
self._initrd = (None,val)