summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone/service_harddrake
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/standalone/service_harddrake')
-rwxr-xr-xperl-install/standalone/service_harddrake24
1 files changed, 3 insertions, 21 deletions
diff --git a/perl-install/standalone/service_harddrake b/perl-install/standalone/service_harddrake
index 347c7cd60..b0da37509 100755
--- a/perl-install/standalone/service_harddrake
+++ b/perl-install/standalone/service_harddrake
@@ -12,24 +12,12 @@ use Storable qw(store retrieve);
my $hw_sysconfdir = "/etc/sysconfig/harddrake2";
my $last_boot_config = $hw_sysconfdir."/previous_hw";
-my $str = '#!/usr/bin/perl -w
-#
-# Special file generated by harddrake service (cvs revision $Revision$).
-# Do not alter it; it\'ll be overwritten by harddrake2 service
-#
-# Format is : { Config_class_ID => {
-# Device => {
-# _Fields => values} ...} ...}
-#
-';
-
# first run ? if not read old hw config
my %previous_config = (-f $last_boot_config && -s $last_boot_config) ? retrieve($last_boot_config) : {};
my (%config, $in);
-# For each hw, class, detect device, compare and offer to reconfigure if
-# needed
+# For each hw, class, detect device, compare and offer to reconfigure if needed
foreach (@harddrake::data::tree) {
my ($Ident, $item, undef, $configurator, $detector, $do_it) = @$_;
next unless $do_it;
@@ -38,13 +26,7 @@ foreach (@harddrake::data::tree) {
my %ID = map {
my $i = $_;
- my $name = do {
- if (defined $i->{device}) {
- $i->{device};
- } else {
- join ':', map { $i->{$_} } qw(vendor id subvendor subid);
- }
- };
+ my $name = if_(defined $i->{device}, [$i->{device}, join ':', map { $i->{$_} } qw(vendor id subvendor subid)]);
$name => $i;
} &$detector;
$config{$Ident} = \%ID;
@@ -79,7 +61,7 @@ foreach (@harddrake::data::tree) {
next unless ($@ && $res); # timed out || canceled
if (my $pid = fork) {
require POSIX;
- POSIX::wait();
+ POSIX::wait();
} else {
exec("$configurator 2>/dev/null") or die "$configurator missing\n";
}