[Pkg-libvirt-commits] [SCM] Libguestfs Debian packaging branch, master, updated. debian/1.0.84-3-8-g3b14f9c

Guido Günther agx at sigxcpu.org
Wed Feb 24 12:56:34 UTC 2010


The following commit has been merged in the master branch:
commit 40dc6b0fc9a59dfcee5b35df57f7e682e9e9a31b
Author: Guido Günther <agx at sigxcpu.org>
Date:   Wed Feb 24 09:10:33 2010 +0100

    New patch 0006-Check-for-grub-menu.lst-if-etc-grub.conf-can-t-be-fo.patch
    
    Check for grub/menu.lst if /etc/grub.conf can't be found

diff --git a/debian/patches/0006-Check-for-grub-menu.lst-if-etc-grub.conf-can-t-be-fo.patch b/debian/patches/0006-Check-for-grub-menu.lst-if-etc-grub.conf-can-t-be-fo.patch
new file mode 100644
index 0000000..7cde055
--- /dev/null
+++ b/debian/patches/0006-Check-for-grub-menu.lst-if-etc-grub.conf-can-t-be-fo.patch
@@ -0,0 +1,44 @@
+From: =?UTF-8?q?Guido=20G=C3=BCnther?= <agx at sigxcpu.org>
+Date: Tue, 23 Feb 2010 19:50:40 +0100
+Subject: [PATCH] Check for grub/menu.lst if /etc/grub.conf can't be found
+
+---
+ perl/lib/Sys/Guestfs/Lib.pm |   10 ++++++++--
+ 1 files changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/perl/lib/Sys/Guestfs/Lib.pm b/perl/lib/Sys/Guestfs/Lib.pm
+index e17728d..2864bfa 100644
+--- a/perl/lib/Sys/Guestfs/Lib.pm
++++ b/perl/lib/Sys/Guestfs/Lib.pm
+@@ -1525,6 +1525,12 @@ sub _check_for_kernels
+         # For every kernel we find, inspect it and add to $os->{kernels}
+ 
+         my $grub = _find_grub_prefix($g, $os);
++        my $grub_conf = "/etc/grub.conf";
++
++        # Debian and other's have no /etc/grub.conf:
++        if ( ! -f "$grub_conf" ) {
++            $grub_conf = "$grub/grub/menu.lst";
++        }
+ 
+         my @boot_configs;
+ 
+@@ -1544,7 +1550,7 @@ sub _check_for_kernels
+         my @configs = ();
+         # Get all configurations from grub
+         foreach my $bootable
+-            ($g->aug_match("/files/etc/grub.conf/title"))
++            ($g->aug_match("/files/$grub_conf/title"))
+         {
+             my %config = ();
+             $config{title} = $g->aug_get($bootable);
+@@ -1617,7 +1623,7 @@ sub _check_for_kernels
+ 
+         # Add the default configuration
+         eval {
+-            $boot{default} = $g->aug_get("/files/etc/grub.conf/default");
++            $boot{default} = $g->aug_get("/files/$grub_conf/default");
+         };
+         if($@) {
+             warn __"No grub default specified";
+-- 

-- 
Libguestfs Debian packaging



More information about the Pkg-libvirt-commits mailing list