git.annexia.org
/
libguestfs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
check for grub/menu.lst too
[libguestfs.git]
/
perl
/
lib
/
Sys
/
Guestfs
/
Lib.pm
diff --git
a/perl/lib/Sys/Guestfs/Lib.pm
b/perl/lib/Sys/Guestfs/Lib.pm
index
e17728d
..
2864bfa
100644
(file)
--- 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);
# 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;
my @boot_configs;
@@
-1544,7
+1550,7
@@
sub _check_for_kernels
my @configs = ();
# Get all configurations from grub
foreach my $bootable
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);
{
my %config = ();
$config{title} = $g->aug_get($bootable);
@@
-1617,7
+1623,7
@@
sub _check_for_kernels
# Add the default configuration
eval {
# 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";
};
if($@) {
warn __"No grub default specified";