[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] pygrub: LiloConf.py supports root and read-only



# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Date 1186391614 -3600
# Node ID fd20c1333e3ee8f58e879aed79d74a75bc1969e6
# Parent  f8d5c509f156cbe3a6a1683f21a75e560e7ba369
pygrub: LiloConf.py supports root and read-only

LiloConf.py ignores the following options: root and read-only.
This patch fixes the issue.

Signed-off-by: KUWAMURA Shin'ya <kuwa@xxxxxxxxxxxxxx>
---
 tools/pygrub/src/LiloConf.py |   24 +++++++++++++++++++++---
 1 files changed, 21 insertions(+), 3 deletions(-)

diff -r f8d5c509f156 -r fd20c1333e3e tools/pygrub/src/LiloConf.py
--- a/tools/pygrub/src/LiloConf.py      Mon Aug 06 10:12:34 2007 +0100
+++ b/tools/pygrub/src/LiloConf.py      Mon Aug 06 10:13:34 2007 +0100
@@ -18,12 +18,13 @@ class LiloImage(object):
                 "  initrd: %s\n" %(self.title, self.root, self.kernel,
                                    self.args, self.initrd))
     def reset(self, lines, path):
-        self._root = self._initrd = self._kernel = self._args = None
+        self._initrd = self._kernel = self._readonly = None
+        self._args = ""
         self.title = ""
         self.lines = []
         self.path = path
+        self.root = ""
         map(self.set_from_line, lines)
-        self.root = "" # dummy
 
     def set_from_line(self, line, replace = None):
         (com, arg) = GrubConf.grub_exact_split(line, 2)
@@ -55,6 +56,23 @@ class LiloImage(object):
         return self._initrd
     initrd = property(get_initrd, set_initrd)
 
+    def set_args(self, val):
+        self._args = val
+    def get_args(self):
+        args = self._args
+        if self.root:
+            args += " root=" + self.root
+        if self.readonly:
+            args += " ro"
+        return args
+    args = property(get_args, set_args)
+
+    def set_readonly(self, val):
+        self._readonly = 1
+    def get_readonly(self):
+        return self._readonly
+    readonly = property(get_readonly, set_readonly)
+
     # set up command handlers
     commands = { "label": "self.title",
                  "root": "self.root",
@@ -62,7 +80,7 @@ class LiloImage(object):
                  "image": "self.kernel",
                  "initrd": "self.initrd",
                  "append": "self.args",
-                 "read-only": None,
+                 "read-only": "self.readonly",
                  "chainloader": None,
                  "module": None}
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.