summaryrefslogtreecommitdiffstats
path: root/perl-install/modules
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/modules')
-rw-r--r--perl-install/modules/any_conf.pm9
-rw-r--r--perl-install/modules/interactive.pm17
-rw-r--r--perl-install/modules/parameters.pm41
3 files changed, 15 insertions, 52 deletions
diff --git a/perl-install/modules/any_conf.pm b/perl-install/modules/any_conf.pm
index b6d0cef84..855678dfd 100644
--- a/perl-install/modules/any_conf.pm
+++ b/perl-install/modules/any_conf.pm
@@ -5,13 +5,8 @@ use common;
sub vnew {
- if (c::kernel_version() =~ /^\Q2.6/) {
- require modules::modprobe_conf;
- modules::modprobe_conf->new;
- } else {
- require modules::modules_conf;
- modules::modules_conf->new;
- }
+ require modules::modprobe_conf;
+ modules::modprobe_conf->new;
}
diff --git a/perl-install/modules/interactive.pm b/perl-install/modules/interactive.pm
index de7adc92b..df462e0f9 100644
--- a/perl-install/modules/interactive.pm
+++ b/perl-install/modules/interactive.pm
@@ -11,9 +11,9 @@ sub config_window {
require modules::parameters;
my @l;
foreach (modules::parameters::parameters($data->{driver})) {
- my ($name, $format, $description) = @$_;
- push @l, { label => $name, help => join("\n", $description, if_(c::kernel_version() !~ /^\Q2.6/, "[$format]")),
- val => \$conf{$name}, allow_empty_list => 1 };
+ my ($name, $description) = @$_;
+ push @l, { label => $name, help => $description,
+ val => \$conf{$name}, allow_empty_list => 1 };
}
if (!@l) {
$in->ask_warn(N("Error"), N("This driver has no configuration parameter!"));
@@ -86,7 +86,7 @@ my %category2text = (
);
sub wait_load_module {
- my ($in, $category, $text, $module) = @_;
+ my ($in, $category, $text, $_module) = @_;
my $msg = do {
if (my $t = $category2text{$category}) {
sprintf(translate($t), $text);
@@ -96,20 +96,21 @@ sub wait_load_module {
N("Installing driver for %s card %s", $category, $text);
}
};
- $in->wait_message('', [ $msg, if_($::expert, N("(module %s)", $module)) ]);
+ $in->wait_message('', $msg);
}
sub load_module__ask_options {
my ($in, $module_descr, $parameters) = @_;
- my @parameters = map { [ @$_[0, 1, 2] ] } @$parameters;
+ #- deep copying
+ my @parameters = map { [ @$_[0, 1] ] } @$parameters;
if (@parameters) {
$in->ask_from('',
N("You may now provide options to module %s.\nNote that any address should be entered with the prefix 0x like '0x123'", $module_descr),
- [ map { { label => $_->[0] . ($_->[1] ? " ($_->[1])" : ''), help => $_->[2], val => \$_->[3] } } @parameters ],
+ [ map { { label => $_->[0], help => $_->[1], val => \$_->[2] } } @parameters ],
) or return;
- join(' ', map { if_($_->[3], "$_->[0]=$_->[3]") } @parameters);
+ join(' ', map { if_($_->[2], "$_->[0]=$_->[2]") } @parameters);
} else {
my $s = $in->ask_from_entry('',
N("You may now provide options to module %s.
diff --git a/perl-install/modules/parameters.pm b/perl-install/modules/parameters.pm
index fa8fcfae7..2af5ce951 100644
--- a/perl-install/modules/parameters.pm
+++ b/perl-install/modules/parameters.pm
@@ -17,44 +17,11 @@ sub parameters {
($module) = modules::extract_modules('/tmp', $module);
}
- my @parameters;
- foreach (common::join_lines(run_program::get_stdout('modinfo', '-p', $module))) {
+ map {
chomp;
- next if /^warning:/;
- (my $name, $_) = /(\w+)(?::|\s+)(.*)/s or warn "modules::parameters::get_options_name($module): unknown line\n";
- if (c::kernel_version() =~ /^\Q2.6/) {
- push @parameters, [ $name, '', $_ ];
- next;
- }
-
- my $c_types = 'int|string|short|byte|char|long';
- my ($is_a_number, $description, $min, $max) = (0, '', 1, 1);
- if (/^($c_types) array \(min = (\d+), max = (\d+)\),?\s*(.*)/s) {
- $_ = $4;
- #- seems like "char" are buggy entries
- ($is_a_number, $min, $max) = ($1 ne 'string', $2, $3) if $1 ne 'char';
- } elsif (/^($c_types),?\s*(.*)/s) {
- $_ = $2;
- #- here "char" really are size-limited strings, modinfo does not display the size limit (but since we do not care about it, it does not matter :)
- $is_a_number = $1 ne 'string' if $1 ne 'char';
- } else {
- #- for things like "no format character" or "unknown format character"
- }
- if (/^description "(.*)",?\s*/s) {
- ($description, $_) = ($1, $2);
- }
- #- print "STILL HAVE ($_)\n" if $_;
-
- my $format = $min == 1 && $max == 1 ?
- ($is_a_number ? N("a number") : '') :
- $min == $max ?
- ($is_a_number ? N("%d comma separated numbers", $min) : N("%d comma separated strings", $min)) :
- $min == 1 ?
- ($is_a_number ? N("comma separated numbers") : N("comma separated strings")) :
- ''; #- too weird and buggy, do not display it
- push @parameters, [ $name, $format, $description ];
- }
- @parameters;
+ (my $name, $_) = /(\w+):(.*)/s or warn "modules::parameters::parameters($module): unknown line\n";
+ [ $name, $_ ];
+ } common::join_lines(run_program::get_stdout('modinfo', '-p', $module));
}
1;