Commit 010dc9a8 authored by Kirk Webb's avatar Kirk Webb
Browse files

Compensate for Linux environments that use wacky paths for the boot device.

parent 9a6d3969
......@@ -38,6 +38,7 @@ sub VERSION() { return 1.0; }
# Must come after package declaration!
use English;
use Cwd 'abs_path';
# Load up the paths. Its conditionalized to be compatabile with older images.
# Note this file has probably already been loaded by the caller.
......@@ -222,9 +223,13 @@ sub get_bootdisk()
my $disk = undef;
my $line = `$MOUNT | grep ' on / '`;
if ($line && $line =~ /^\/dev\/(\S+)\d+ on \//) {
$disk = $1;
if ($line && $line =~ qr{^(/dev/\S+) on /}) {
my $device = abs_path($1);
if ($device && $device =~ qr{^/dev/(\S+)\d+}) {
$disk = $1;
}
}
return $disk;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment