git.annexia.org
/
libguestfs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
01c1d82
)
Warn instead of dying if grub refers to non-existent kernel
author
Matthew Booth
<mbooth@redhat.com>
Fri, 7 May 2010 13:58:32 +0000
(14:58 +0100)
committer
Richard Jones
<rjones@redhat.com>
Fri, 7 May 2010 14:23:37 +0000
(15:23 +0100)
perl/lib/Sys/Guestfs/Lib.pm
patch
|
blob
|
history
diff --git
a/perl/lib/Sys/Guestfs/Lib.pm
b/perl/lib/Sys/Guestfs/Lib.pm
index
b6c4a31
..
8ec487d
100644
(file)
--- a/
perl/lib/Sys/Guestfs/Lib.pm
+++ b/
perl/lib/Sys/Guestfs/Lib.pm
@@
-1643,8
+1643,14
@@
sub _check_for_kernels
}
$config{cmdline} = join(' ', @args) if(scalar(@args) > 0);
- my $kernel =
- inspect_linux_kernel($g, $path, $os->{package_format});
+ my $kernel;
+ if ($g->exists($path)) {
+ $kernel =
+ inspect_linux_kernel($g, $path, $os->{package_format});
+ } else {
+ warn __x("grub refers to {path}, which doesn't exist\n",
+ path => $path);
+ }
# Check the kernel was recognised
if(defined($kernel)) {