summaryrefslogtreecommitdiffstats
path: root/perl-install/commands
Commit message (Expand)AuthorAgeFilesLines
* no_commentPascal Rigaux1999-10-101-1/+1
* *** empty log message ***Pascal Rigaux1999-07-011-1/+1
* "See_The_Changelog"Chmouel Boudjnah1999-07-011-0/+15
=16.100&id=54b71cdf438434e4693aa6064596f4fdb4aac59e'>54b71cdf438434e4693aa6064596f4fdb4aac59e (diff)downloaddrakx-7e8fa9773839843c9d8def81ec2ef1315115825a.tar
drakx-7e8fa9773839843c9d8def81ec2ef1315115825a.tar.gz
drakx-7e8fa9773839843c9d8def81ec2ef1315115825a.tar.bz2
drakx-7e8fa9773839843c9d8def81ec2ef1315115825a.tar.xz
drakx-7e8fa9773839843c9d8def81ec2ef1315115825a.zip
- %modules::conf is no more a global, so many functions need passing $modules_conf
- $modules_conf is a class choosing modules.conf or modprobe.conf (esp. useful after install) (but not working yet!) - modules::load() doesn't use $modules_conf, use modules::load_and_configure() - modules::load() doesn't allow options, use either modules::load_raw() or modules::load_and_configure() - some functions used to want an array ref for modules options and some a string, now every functions use a string - many functions (like modules::get_alias()) are now methods on $modules_conf - some functions in mouse.pm needed a $in where a $do_pkgs is enough - some perl_checker compliance - small fixes
Diffstat
-rw-r--r--perl-install/Xconfig/default.pm9
-rw-r--r--perl-install/commands.pm2
-rw-r--r--perl-install/detect_devices.pm11
-rw-r--r--perl-install/harddrake/autoconf.pm8
-rw-r--r--perl-install/harddrake/data.pm8
-rw-r--r--perl-install/harddrake/sound.pm41
-rw-r--r--perl-install/harddrake/v4l.pm6
-rw-r--r--perl-install/install2.pm21
-rw-r--r--perl-install/install_any.pm8
-rw-r--r--perl-install/install_steps.pm10
-rw-r--r--perl-install/install_steps_auto_install.pm4
-rw-r--r--perl-install/install_steps_interactive.pm22
-rw-r--r--perl-install/modules.pm246
-rw-r--r--perl-install/modules/any_conf.pm117
-rw-r--r--perl-install/modules/interactive.pm32
-rw-r--r--perl-install/modules/modprobe_conf.pm108
-rw-r--r--perl-install/modules/modules_conf.pm40
-rw-r--r--perl-install/mouse.pm33
-rw-r--r--perl-install/network/adsl.pm6
-rw-r--r--perl-install/network/ethernet.pm27
-rw-r--r--perl-install/network/isdn.pm5
-rw-r--r--perl-install/network/netconnect.pm50
-rw-r--r--perl-install/network/network.pm6
-rw-r--r--perl-install/network/shorewall.pm5
-rw-r--r--perl-install/network/tools.pm4
-rw-r--r--perl-install/printer/detect.pm2
-rw-r--r--perl-install/printer/main.pm2
-rw-r--r--perl-install/printer/printerdrake.pm7
-rwxr-xr-xperl-install/standalone/drakconnect18
-rwxr-xr-xperl-install/standalone/drakgw5
-rwxr-xr-xperl-install/standalone/draksound11
-rwxr-xr-xperl-install/standalone/drakxtv10
-rwxr-xr-xperl-install/standalone/mousedrake10
-rwxr-xr-xperl-install/standalone/printerdrake1
-rwxr-xr-xperl-install/standalone/service_harddrake20
35 files changed, 550 insertions, 365 deletions
diff --git a/perl-install/Xconfig/default.pm b/perl-install/Xconfig/default.pm
index 9d317fc3a..75947bf11 100644
--- a/perl-install/Xconfig/default.pm
+++ b/perl-install/Xconfig/default.pm
@@ -10,16 +10,15 @@ use mouse;
sub configure {
- my ($keyboard, $mouse) = @_;
+ my ($o_keyboard, $o_mouse) = @_;
- $keyboard ||= keyboard::read();
- $mouse ||= do {
+ my $keyboard = $o_keyboard || keyboard::read();
+ my $mouse = $o_mouse || do {
my $mouse = mouse::read();
- add2hash($mouse, mouse::detect()) if !$::noauto;
+ add2hash($mouse, mouse::detect(modules::any_conf->read)) if !$::noauto;
$mouse;
};
-
my $raw_X = Xconfig::xfree->empty_config;
$raw_X->add_load_module($_) foreach qw(dbe v4l extmod type1 freetype);
diff --git a/perl-install/commands.pm b/perl-install/commands.pm
index d5d511b8b..76f648a8f 100644
--- a/perl-install/commands.pm
+++ b/perl-install/commands.pm
@@ -358,7 +358,7 @@ sub modprobe {
my $name = shift;
require modules;
modules::load_dependencies("/modules/modules.dep");
- modules::load([ $name, @_ ]);
+ modules::load_raw([ $name ], { $name => join(' ', @_) });
}
sub route {
diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm
index 5e573574d..58731e0a3 100644
--- a/perl-install/detect_devices.pm
+++ b/perl-install/detect_devices.pm
@@ -412,7 +412,7 @@ sub getCPUs() {
}
sub getSoundDevices() {
- (arch() =~ /ppc/ ? \&modules::load_category : \&modules::probe_category)->('multimedia/sound');
+ modules::probe_category('multimedia/sound');
}
sub isTVcard { member($_[0]{driver}, qw(bttv cx8800 saa7134 usbvision)) }
@@ -422,7 +422,7 @@ sub getTVcards() {
}
sub getSerialModem {
- my ($o_mouse) = @_;
+ my ($modules_conf, $o_mouse) = @_;
my $mouse = $o_mouse || {};
$mouse->{device} = readlink "/dev/mouse";
my $serdev = arch() =~ /ppc/ ? "macserial" : "serial";
@@ -441,14 +441,15 @@ sub getSerialModem {
my @devs = pcmcia_probe();
foreach my $modem (@modems) {
#- add an alias for macserial on PPC
- modules::set_alias('serial', $serdev) if arch() =~ /ppc/ && $modem->{device};
+ $modules_conf->set_alias('serial', $serdev) if arch() =~ /ppc/ && $modem->{device};
foreach (@devs) { $_->{type} =~ /serial/ and $modem->{device} = $_->{device} }
}
@modems;
}
-sub getModem() {
- getSerialModem({}), matching_driver('www\.linmodems\.org');
+sub getModem {
+ my ($modules_conf) = @_;
+ getSerialModem($modules_conf, {}), matching_driver('www\.linmodems\.org');
}
sub getSpeedtouch() {
diff --git a/perl-install/harddrake/autoconf.pm b/perl-install/harddrake/autoconf.pm
index 985fecb4e..c347955ba 100644
--- a/perl-install/harddrake/autoconf.pm
+++ b/perl-install/harddrake/autoconf.pm
@@ -4,24 +4,24 @@ use common;
use any;
sub xconf {
- my ($o) = @_;
+ my ($modules_conf, $o) = @_;
log::l('automatic XFree configuration');
require Xconfig::default;
- $o->{raw_X} = Xconfig::default::configure(keyboard::read());
+ $o->{raw_X} = Xconfig::default::configure();
require Xconfig::main;
require class_discard;
Xconfig::main::configure_everything_auto_install($o->{raw_X}, class_discard->new, {}, { allowFB => 1 });
- modules::load_category('various/agpgart');
+ modules::load_category($modules_conf, 'various/agpgart');
}
sub network_conf {
my ($o) = @_;
require network::network;
- network::network::easy_dhcp($o->{netc}, $o->{intf}) and $o->{netcnx}{type} = 'lan';
+ network::network::easy_dhcp($o->{modules_conf}, $o->{netc}, $o->{intf}) and $o->{netcnx}{type} = 'lan';
}
1;
diff --git a/perl-install/harddrake/data.pm b/perl-install/harddrake/data.pm
index ca1b30b40..911db832f 100644
--- a/perl-install/harddrake/data.pm
+++ b/perl-install/harddrake/data.pm
@@ -46,6 +46,7 @@ sub set_removable_remover {
return "/usr/sbin/drakupdate_fstab --no-flag --del $device->{device}" if is_removable($class);
}
+my $modules_conf = modules::any_conf->read;
# Format is (HW class ID, l18n class name, icon, config tool , is_to_be_detected_on_boot)
our @tree =
@@ -183,7 +184,7 @@ our @tree =
string => N("ISDN adapters"),
icon => "modem.png",
configurator => "$sbindir/drakconnect",
- detector => sub { require network::isdn; my $isdn = network::isdn::detect_backend(); if_(@$isdn, f(@$isdn)) },
+ detector => sub { require network::isdn; my $isdn = network::isdn::detect_backend($modules_conf); if_(@$isdn, f(@$isdn)) },
checked_on_boot => 0,
},
@@ -208,7 +209,7 @@ our @tree =
string => N("Modem"),
icon => "modem.png",
configurator => "$sbindir/drakconnect",
- detector => sub { detect_devices::getModem() },
+ detector => sub { detect_devices::getModem($modules_conf) },
checked_on_boot => 0,
},
@@ -260,8 +261,7 @@ our @tree =
detector => sub {
require mouse;
require modules;
- modules::mergein_conf();
- &mouse::detect();
+ mouse::detect($modules_conf);
},
checked_on_boot => 1,
},
diff --git a/perl-install/harddrake/sound.pm b/perl-install/harddrake/sound.pm
index 94f3ac5f9..438d4b8b0 100644
--- a/perl-install/harddrake/sound.pm
+++ b/perl-install/harddrake/sound.pm
@@ -137,7 +137,10 @@ sub rooted { run_program::rooted($::prefix, @_) }
sub unload { modules::unload(@_) if $::isStandalone || $blacklisted }
-sub load { modules::load(@_) if $::isStandalone || $blacklisted }
+sub load {
+ my ($modules_conf, $name) = @_;
+ modules::load_and_configure($modules_conf, $name) if $::isStandalone || $blacklisted;
+}
sub get_alternative {
my ($driver) = @_;
@@ -145,7 +148,7 @@ sub get_alternative {
}
sub do_switch {
- my ($in, $old_driver, $new_driver, $index) = @_;
+ my ($in, $modules_conf, $old_driver, $new_driver, $index) = @_;
return if $old_driver eq $new_driver;
my $_wait = $in->wait_message(N("Please wait"), N("Please Wait... Applying the configuration"));
log::explanations("removing old $old_driver\n");
@@ -154,14 +157,14 @@ sub do_switch {
rooted("service alsa stop") if $old_driver =~ /^snd-/ && !$blacklisted;
unload($old_driver); # run_program("/sbin/modprobe -r $driver"); # just in case ...
}
- modules::remove_module($old_driver);
- modules::set_sound_slot("sound-slot-$index", $new_driver);
- modules::write_conf();
+ $modules_conf->remove_module($old_driver);
+ $modules_conf->set_sound_slot("sound-slot-$index", $new_driver);
+ $modules_conf->write;
if ($new_driver =~ /^snd-/) { # new driver is an alsa one
$in->do_pkgs->ensure_is_installed('alsa-utils', '/usr/sbin/alsactl');
rooted("service alsa start") if $::isStandalone && !$blacklisted;
rooted("/sbin/chkconfig --add alsa") if $::isStandalone;
- load($new_driver) if $::isStandalone; # service alsa is buggy
+ load($modules_conf, $new_driver) if $::isStandalone; # service alsa is buggy
} else { rooted("/sbin/chkconfig --del alsa") }
log::explanations("loading new $new_driver\n");
rooted("/sbin/chkconfig --add sound"); # just in case ...
@@ -169,7 +172,7 @@ sub do_switch {
}
sub switch {
- my ($in, $device) = @_;
+ my ($in, $modules_conf, $device) = @_;
my $driver = $device->{current_driver} || $device->{driver};
foreach (@blacklist) { $blacklisted = 1 if $driver eq $_ }
@@ -187,7 +190,7 @@ sub switch {
N("There's no known OSS/ALSA alternative driver for your sound card (%s) which currently uses \"%s\"",
$device->{description}, $driver),
[
- &get_any_driver_entry($in, $driver, $device),
+ get_any_driver_entry($in, $modules_conf, $driver, $device),
]
);
} elsif ($in->ask_from_({ title => N("Sound configuration"),
@@ -218,7 +221,7 @@ To use alsa, one can either use:
val => N("Trouble shooting"), disabled => sub {},
clicked => sub { &trouble($in) }
},
- &get_any_driver_entry($in, $driver, $device),
+ get_any_driver_entry($in, $modules_conf, $driver, $device),
]))
{
return if $new_driver eq $device->{current_driver};
@@ -226,7 +229,7 @@ To use alsa, one can either use:
$in->ask_warn(N("Warning"), N("The old \"%s\" driver is blacklisted.\n
It has been reported to oops the kernel on unloading.\n
The new \"%s\" driver'll only be used on next bootstrap.", $device->{current_driver}, $new_driver)) if $blacklisted;
- do_switch($in, $device->{current_driver}, $new_driver, $device->{sound_slot_index});
+ do_switch($in, $modules_conf, $device->{current_driver}, $new_driver, $device->{sound_slot_index});
$device->{current_driver} = $new_driver;
}
} elsif ($driver =~ /^Bad:/) {
@@ -238,7 +241,7 @@ The new \"%s\" driver'll only be used on next bootstrap.", $device->{current_dri
$in->ask_from(N("No known driver"),
N("There's no known driver for your sound card (%s)",
$device->{description}),
- [ &get_any_driver_entry($in, $driver, $device) ]);
+ [ get_any_driver_entry($in, $modules_conf, $driver, $device) ]);
} else {
$in->ask_warn(N("Unknown driver"),
N("Error: The \"%s\" driver for your sound card is unlisted",
@@ -248,7 +251,8 @@ The new \"%s\" driver'll only be used on next bootstrap.", $device->{current_dri
}
sub config {
- switch(@_);
+ my ($in, $modules_conf, $device) = @_;
+ switch($in, $modules_conf, $device);
}
@@ -278,7 +282,7 @@ initlevel 3
}
sub get_any_driver_entry {
- my ($in, $driver, $device) = @_;
+ my ($in, $modules_conf, $driver, $device) = @_;
return () if $::isInstall;
+{
val => N("Let me pick any driver"), disabled => sub {},
@@ -293,7 +297,7 @@ The current driver for your \"%s\" sound card is \"%s\" ", $device->{description
{ label => N("Driver:"), val => \$driver, list => [ category2modules("multimedia/sound") ], type => 'combo', default => $driver, sort =>1, separator => '|' },
]
)) {
- do_switch($in, $old_driver, $driver, $device->{sound_slot_index});
+ do_switch($in, $modules_conf, $old_driver, $driver, $device->{sound_slot_index});
goto end;
}
}
@@ -301,16 +305,17 @@ The current driver for your \"%s\" sound card is \"%s\" ", $device->{description
}
-sub configure_sound_slots() {
+sub configure_sound_slots {
+ my ($modules_conf) = @_;
my $altered = 0;
each_index {
- my $default_driver = modules::get_alias("sound-slot-$::i");
+ my $default_driver = $modules_conf->get_alias("sound-slot-$::i");
if (!member($default_driver, @{get_alternative($_->{driver})}, $_->{driver})) {
$altered ||= $default_driver;
- modules::set_sound_slot("sound-slot-$::i", $_->{driver});
+ $modules_conf->set_sound_slot("sound-slot-$::i", $_->{driver});
}
} detect_devices::getSoundDevices();
- modules::write_conf() if $altered && $::isStandalone;
+ $modules_conf->write if $altered && $::isStandalone;
}
diff --git a/perl-install/harddrake/v4l.pm b/perl-install/harddrake/v4l.pm
index 9d4feaa14..9b331d6ee 100644
--- a/perl-install/harddrake/v4l.pm
+++ b/