$r->{package_management} = "yum";
}
- elsif (/(Red Hat Enterprise Linux|CentOS|Scientific Linux)/) {
+ elsif (/(Red Hat|CentOS|Scientific Linux)/) {
chomp; $r->{product_name} = $_;
my $distro = $1;
- if($distro eq "Red Hat Enterprise Linux") {
+ if($distro eq "Red Hat") {
$r->{osdistro} = "rhel";
}
foreach (@fstab) {
my ($spec, $file) = @$_;
- my ($dev, $fs) = _find_filesystem ($g, $fses, $spec);
+ my ($dev, $fs) = _find_filesystem ($g, $fses, $spec, $file);
if ($dev) {
$r->{mounts}->{$file} = $dev;
$r->{filesystems}->{$dev} = $fs;
my $g = shift;
my $fses = shift;
local $_ = shift;
+ my $file = shift;
if (/^LABEL=(.*)/) {
my $label = $1;
if (m{^/dev/hd(.*)} && exists $fses->{"/dev/sd$1"}) {
return ("/dev/sd$1", $fses->{"/dev/sd$1"});
}
+ if (m{^/dev/vd(.*)} && exists $fses->{"/dev/sd$1"}) {
+ return ("/dev/sd$1", $fses->{"/dev/sd$1"});
+ }
if (m{^/dev/xvd(.*)} && exists $fses->{"/dev/sd$1"}) {
return ("/dev/sd$1", $fses->{"/dev/sd$1"});
}
return ("/dev/$1/$2", $fses->{"/dev/$1/$2"});
}
+ return () if $file =~ (/media\/cdrom/);
return () if m{/dev/cdrom};
return () if m{/dev/fd0};
die(__"Can't find grub on guest") unless($g->exists('/boot/grub/menu.lst'));
# Look for the most specific mount point in mounts
- foreach my $path qw(/boot/grub /boot /) {
+ foreach my $path (qw(/boot/grub /boot /)) {
if(exists($mounts->{$path})) {
return "" if($path eq '/');
return $path;
my %modprobe_aliases;
- for my $pattern qw(/files/etc/conf.modules/alias
- /files/etc/modules.conf/alias
- /files/etc/modprobe.conf/alias
- /files/etc/modprobe.d/*/alias) {
+ for my $pattern (qw(/files/etc/conf.modules/alias
+ /files/etc/modules.conf/alias
+ /files/etc/modprobe.conf/alias
+ /files/etc/modprobe.d/*/alias)) {
for my $path ( $g->aug_match($pattern) ) {
$path =~ m{^/files(.*)/alias(?:\[\d*\])?$}
or die __x("{path} doesn't match augeas pattern",