72 |
append_to_file($known_kernels, "$curr_kernel\n"); |
append_to_file($known_kernels, "$curr_kernel\n"); |
73 |
} |
} |
74 |
|
|
75 |
|
sub ask_with_timeout { |
76 |
|
my ($title, $msg, $timeout, $plymouth) = @_; |
77 |
|
my ($pid, $res, $timed_out); |
78 |
|
|
79 |
|
$SIG{ALRM} = sub { $timed_out = 1; kill 15, $pid }; |
80 |
|
unless ($pid = fork()) { |
81 |
|
$plymouth and system('plymouth', 'hide-splash'); |
82 |
|
exec("/usr/share/harddrake/confirm", $title, $msg); |
83 |
|
} |
84 |
|
alarm($timeout); |
85 |
|
wait(); |
86 |
|
$res = $?; |
87 |
|
alarm(0); |
88 |
|
return $res, $timed_out; |
89 |
|
} |
90 |
|
|
91 |
sub get_xorg_driver() { |
sub get_xorg_driver() { |
92 |
my $x = Xconfig::xfree->read; |
my $x = Xconfig::xfree->read; |
93 |
if ($x) { |
if ($x) { |
348 |
log::explanations(qw(skip $Ident configuration since "$configurator" is not executable)); |
log::explanations(qw(skip $Ident configuration since "$configurator" is not executable)); |
349 |
next; |
next; |
350 |
} |
} |
351 |
my ($pid, $no, $res); |
my ($no, $res); |
352 |
$hw_class->{automatic} ||= ref($configurator) eq 'CODE'; |
$hw_class->{automatic} ||= ref($configurator) eq 'CODE'; |
353 |
|
|
354 |
if (!$hw_class->{automatic}) { |
if (!$hw_class->{automatic}) { |
355 |
$SIG{ALRM} = sub { $no = 1; kill 15, $pid }; |
($res, $no) = ask_with_timeout(N("Hardware changes in \"%s\" class (%s seconds to answer)", $Ident, $timeout), |
356 |
unless ($pid = fork()) { |
$msg . N("Do you want to run the appropriate config tool?"), $timeout, $plymouth); |
|
$plymouth and system('plymouth', 'hide-splash'); |
|
|
exec("/usr/share/harddrake/confirm", $Ident, $timeout, $msg); |
|
|
} |
|
|
alarm($timeout); |
|
|
wait(); |
|
|
$res = $?; |
|
|
alarm(0); |
|
357 |
} else { |
} else { |
358 |
$res = 1; |
$res = 1; |
359 |
} |
} |