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

[Xen-changelog] [xen-unstable] xend: Fix appending policy module to end of grub's config file



# HG changeset patch
# User Keir Fraser <keir@xxxxxxxxxxxxx>
# Date 1194692072 0
# Node ID afd7d5c96e093b60b90cd0f601cf608eeb64a0f3
# Parent  8d8d179b9b05d46c0b0f7b745306269800b1e83a
xend: Fix appending policy module to end of grub's config file

This patch fixes the case where a module line is supposed to be added
to the very end of the file but the file does not end in with a new
line. Also fixes a problem that in some cases the module line would
not be properly be removed.

Signed-off-by: Stefan Berger <stefanb@xxxxxxxxxx>
---
 tools/python/xen/util/bootloader.py |    4 ++++
 1 files changed, 4 insertions(+)

diff -r 8d8d179b9b05 -r afd7d5c96e09 tools/python/xen/util/bootloader.py
--- a/tools/python/xen/util/bootloader.py       Fri Nov 09 12:59:58 2007 +0000
+++ b/tools/python/xen/util/bootloader.py       Sat Nov 10 10:54:32 2007 +0000
@@ -65,6 +65,8 @@ def get_kernel_val(index, att):
 
 def set_boot_policy(title_idx, filename):
     boottitles = get_boot_policies()
+    for key in boottitles.iterkeys():
+        boottitles[key] += ".bin"
     if boottitles.has_key(title_idx):
         rm_policy_from_boottitle(title_idx, [ boottitles[title_idx] ])
     rc = add_boot_policy(title_idx, filename)
@@ -336,6 +338,8 @@ class Grub(Bootloader):
                 os.write(tmp_fd, line)
 
             if module_line != "" and not found:
+                if ord(line[-1]) not in [ 10 ]:
+                    os.write(tmp_fd, '\n')
                 os.write(tmp_fd, module_line)
                 found = True
 

_______________________________________________
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®.