aboutsummaryrefslogtreecommitdiffstats
path: root/tools/pygrub
diff options
context:
space:
mode:
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>2007-08-06 10:13:34 +0100
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>2007-08-06 10:13:34 +0100
commitf26a3dbc3640aeb728cff637f486927d5bf13777 (patch)
treefbb6f1d34c026cfe34f21ca9766704a42856f744 /tools/pygrub
parente080ffba8d9368b57e4b9a882f7c9729efe9f9db (diff)
downloadxen-f26a3dbc3640aeb728cff637f486927d5bf13777.tar.gz
xen-f26a3dbc3640aeb728cff637f486927d5bf13777.tar.bz2
xen-f26a3dbc3640aeb728cff637f486927d5bf13777.zip
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@jp.fujitsu.com>
Diffstat (limited to 'tools/pygrub')
-rw-r--r--tools/pygrub/src/LiloConf.py24
1 files changed, 21 insertions, 3 deletions
diff --git a/tools/pygrub/src/LiloConf.py b/tools/pygrub/src/LiloConf.py
index 3a2172f92a..2dde05825a 100644
--- a/tools/pygrub/src/LiloConf.py
+++ b/tools/pygrub/src/LiloConf.py
@@ -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}