WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] LiloConf.py supports root and read-only

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] LiloConf.py supports root and read-only
From: "KUWAMURA Shin'ya" <kuwa@xxxxxxxxxxxxxx>
Date: Mon, 06 Aug 2007 15:09:15 +0900 (JST)
Delivery-date: Sun, 05 Aug 2007 23:07:56 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Hi,

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

Signed-off-by: KUWAMURA Shin'ya <kuwa@xxxxxxxxxxxxxx>

Best Regards,
-- 
  KUWAMURA Shin'ya
diff -r 88bb0d305308 tools/pygrub/src/LiloConf.py
--- a/tools/pygrub/src/LiloConf.py      Wed Aug 01 15:47:54 2007 +0100
+++ b/tools/pygrub/src/LiloConf.py      Fri Aug 03 15:46:39 2007 +0900
@@ -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-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] LiloConf.py supports root and read-only, KUWAMURA Shin'ya <=