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-changelog

[Xen-changelog] [xen-unstable] xend: Fix appending policy module to end

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] xend: Fix appending policy module to end of grub's config file
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 14 Nov 2007 04:40:07 -0800
Delivery-date: Wed, 14 Nov 2007 04:40:28 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] xend: Fix appending policy module to end of grub's config file, Xen patchbot-unstable <=