summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2004-07-21 00:16:04 +0000
committerPascal Rigaux <pixel@mandriva.com>2004-07-21 00:16:04 +0000
commit7e8fa9773839843c9d8def81ec2ef1315115825a (patch)
treeb20f63ae9f67b2d9c7e8aa6a2b86d56e0d953743 /perl-install/standalone
parent54b71cdf438434e4693aa6064596f4fdb4aac59e (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 (limited to 'perl-install/standalone')
-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
7 files changed, 39 insertions, 36 deletions
diff --git a/perl-install/standalone/drakconnect b/perl-install/standalone/drakconnect
index 844783d71..01f471326 100755
--- a/perl-install/standalone/drakconnect
+++ b/perl-install/standalone/drakconnect
@@ -51,7 +51,8 @@ if ($in->isa('interactive::gtk')) {
require ugtk2;
ugtk2->import(qw(:create :dialogs :helpers :wrappers));
}
-network::tools::reread_net_conf($netcnx, $netc, $intf);
+my $modules_conf = modules::any_conf->read;
+network::tools::reread_net_conf($modules_conf, $netcnx, $netc, $intf);
$::Wizard_title = N("Network & Internet Configuration");
$::Wizard_pix_up = "drakconnect.png";
@@ -122,7 +123,7 @@ $list->signal_connect(button_press_event => sub {
configure_lan() if $event->type eq '2button-press';
});
-update_list();
+update_list($modules_conf);
my ($label_host, $int_state);
@@ -203,8 +204,8 @@ sub manage {
eval(cat_('/etc/sysconfig/drakconnect'));
- @all_cards = network::ethernet::get_eth_cards();
- my %name = network::ethernet::get_eth_cards_names(@all_cards);
+ @all_cards = network::ethernet::get_eth_cards($modules_conf);
+ my %name = network::ethernet::get_eth_cards_names($modules_conf, @all_cards);
foreach (keys %name) {
$p->{/eth|ath|wlan/ ? $name{$_} : $_} = { kind => $_ };
}
@@ -269,7 +270,7 @@ sub build_tree {
$intf->{save} = sub {
$netc->{internet_cnx_choice} = 'adsl';
$netc->{at_boot} = $intf->{ONBOOT} eq 'yes' ? 1 : 0;
- network::adsl::adsl_conf_backend($in, $intf, $netc, $interface_kind, $protocol)
+ network::adsl::adsl_conf_backend($in, $modules_conf, $intf, $netc, $interface_kind, $protocol)
};
}
elsif ($interface eq 'modem') {
@@ -633,7 +634,7 @@ sub check_field {
sub add_intf() {
$::isWizard = 1;
- network::netconnect::main('', $netcnx, $in, $netc, undef, $intf);
+ network::netconnect::main('', $netcnx, $in, $modules_conf, $netc, undef, $intf);
$in->exit(0);
}
@@ -705,8 +706,9 @@ sub get_intf_ip {
my %intf;
-sub update_list() {
- @all_cards = network::ethernet::get_eth_cards();
+sub update_list {
+ my ($modules_conf) = @_;
+ @all_cards = network::ethernet::get_eth_cards($modules_conf);
my %new_intf = map { @$_ } @all_cards;
my @new_intf = sort keys %new_intf;
foreach my $interface (difference2(\@new_intf, [ keys %intf ])) {
diff --git a/perl-install/standalone/drakgw b/perl-install/standalone/drakgw
index cd0fdc7e3..3e7997208 100755
--- a/perl-install/standalone/drakgw
+++ b/perl-install/standalone/drakgw
@@ -210,8 +210,9 @@ my %aliased_devices;
my $card_netconnect = network::netconnect::get_net_device() || "eth0";
defined $card_netconnect and log::l("[drakgw] Information from netconnect: ignore card $card_netconnect");
-my @all_cards = network::ethernet::get_eth_cards();
-my %net_devices = network::ethernet::get_eth_cards_names(@all_cards);
+my $modules_conf = modules::any_conf->read;
+my @all_cards = network::ethernet::get_eth_cards($modules_conf);
+my %net_devices = network::ethernet::get_eth_cards_names($modules_conf, @all_cards);
put_in_hash(\%net_devices, { 'ppp+' => 'ppp+', 'ippp+' => 'ippp+' });
$in->ask_from('',
diff --git a/perl-install/standalone/draksound b/perl-install/standalone/draksound
index 9737c3d48..4807bf686 100755
--- a/perl-install/standalone/draksound
+++ b/perl-install/standalone/draksound
@@ -29,18 +29,19 @@ use detect_devices;
my $in = 'interactive'->vnew('su');
-modules::mergein_conf();
+
+my $modules_conf = modules::any_conf->read;
if (my @devices = modules::probe_category('multimedia/sound')) {
# TODO: That need some work for multiples sound cards
map_index {
# allocate sound-slot in the same order as install2.pm
# fill $device->{driver} with the right sound-slot-XX or default driver if missing sound-slot [real fix'll be in harddrake service]
- my $driver = modules::get_alias("sound-slot-$::i");
- $driver = modules::get_alias($driver) if $driver =~ /sound-card/; # alsaconf ...
+ my $driver = $modules_conf->get_alias("sound-slot-$::i");
+ $driver = $modules_conf->get_alias($driver) if $driver =~ /sound-card/; # alsaconf ...
$_->{current_driver} = $driver if $driver;
$_->{sound_slot_index} = $::i;
- harddrake::sound::config($in, $_, $::i);
+ harddrake::sound::config($in, $modules_conf, $_, $::i);
} @devices;
} else {
$in->ask_warn(N("No Sound Card detected!"),
@@ -54,5 +55,5 @@ http://www.linux-mandrake.com/en/hardware.php3") .
N("\n\n\nNote: if you've an ISA PnP sound card, you'll have to use the alsaconf or the sndconfig program. Just type \"alsaconf\" or \"sndconfig\" in a console.")));
}
-modules::write_conf();
+$modules_conf->write;
$in->exit(0);
diff --git a/perl-install/standalone/drakxtv b/perl-install/standalone/drakxtv
index 6646a3f37..40e78fb09 100755
--- a/perl-install/standalone/drakxtv
+++ b/perl-install/standalone/drakxtv
@@ -115,16 +115,16 @@ my @devices = detect_devices::getTVcards();
push @devices, { driver => 'bttv', description => 'dummy' } if $::testing && !@devices;
if (@devices) {
my $not_canceled = 1;
- my $configured;
+ my $modules_conf;
# TODO: That need some work for multiples TV cards
each_index {
if (($< == 0 || $::testing) && (grep { detect_devices::isTVcard($_) } @devices)) {
require harddrake::v4l;
require modules;
- modules::mergein_conf() if !$configured;
- $configured++;
- $not_canceled &&= harddrake::v4l::config($in, $_->{driver});
- modules::write_conf();
+
+ $modules_conf ||= modules::any_conf->read;
+ $not_canceled &&= harddrake::v4l::config($in, $modules_conf, $_->{driver});
+ $modules_conf->write;
}
scan4channels() if $not_canceled;
} @devices
diff --git a/perl-install/standalone/mousedrake b/perl-install/standalone/mousedrake
index 19d104f95..e78ecb2e8 100755
--- a/perl-install/standalone/mousedrake
+++ b/perl-install/standalone/mousedrake
@@ -13,14 +13,14 @@ use c;
my $in = 'interactive'->vnew('su');
-modules::mergein_conf();
+my $modules_conf = modules::any_conf->read;
begin:
my $mouse = mouse::read();
my %old = %$mouse;
if (!$::noauto) {
- my $probed_mouse = mouse::detect();
+ my $probed_mouse = mouse::detect($modules_conf);
$mouse = $probed_mouse if !$mouse->{XMOUSETYPE} || !$probed_mouse->{unsafe};
}
@@ -29,14 +29,14 @@ if (!$mouse || !$::auto) {
my $test_hbox;
my $name = $in->ask_from_treelistf('mousedrake', N("Please choose your mouse type."), '|',
sub { join '|', map { translate($_) } split '\|', $_[0] },
- [ mouse::fullnames ],
+ [ mouse::fullnames() ],
$mouse->{type} . '|' . $mouse->{name});
$name or $in->exit(0);
my $mouse_chosen = mouse::fullname2mouse($name);
$mouse = $mouse_chosen if !($mouse->{type} eq $mouse_chosen->{type} && $mouse->{name} eq $mouse_chosen->{name});
if ($mouse->{device} eq "usbmouse") {
- modules::load_category('bus/usb') or die 'no usb bus found\n';
+ modules::load_category($modules_conf, 'bus/usb') or die 'no usb bus found\n';
modules::load(qw(hid mousedev usbmouse));
}
@@ -51,7 +51,7 @@ if (!$mouse || !$::auto) {
$test_hbox and $test_hbox->destroy;
}
-mouse::write_conf($in, $mouse, 1);
+mouse::write_conf($in->do_pkgs, $modules_conf, $mouse, 1);
if ($in->isa('interactive::gtk') && mouse::change_mouse_live($mouse, \%old)) {
diff --git a/perl-install/standalone/printerdrake b/perl-install/standalone/printerdrake
index e9dde3564..f41fcf46f 100755
--- a/perl-install/standalone/printerdrake
+++ b/perl-install/standalone/printerdrake
@@ -103,7 +103,6 @@ $commandline =~ /-lprng/ and
$printer->{SPOOLER} = 'lprng' and printer::main::read_configured_queues($printer);
$commandline =~ /-pdq/ and
$printer->{SPOOLER} = 'pdq' and printer::main::read_configured_queues($printer);
-modules::mergein_conf();
undef $w;
diff --git a/perl-install/standalone/service_harddrake b/perl-install/standalone/service_harddrake
index 1cd03cc43..24c0f47ab 100755
--- a/perl-install/standalone/service_harddrake
+++ b/perl-install/standalone/service_harddrake
@@ -20,7 +20,7 @@ my $last_boot_config = $hw_sysconfdir."/previous_hw";
$last_boot_config .= '_X11' if $invert_do_it;
-modules::mergein_conf();
+my $modules_conf = modules::any_conf->read;
# autoreconfigure the mouse on major kernel change:
my $prev_kernel = { getVarsFromSh("$hw_sysconfdir/kernel") }->{KERNEL};
@@ -31,7 +31,7 @@ if ($curr_kernel ne $prev_kernel) {
log::explanations("Autoconfiguring mouse since we switched between 2.4.x and 2.6.x kernels");
require class_discard;
require mouse;
- mouse::write_conf(class_discard->new, mouse::detect(), 1);
+ mouse::write_conf(class_discard->new, $modules_conf, mouse::detect($modules_conf), 1);
}
if (find { $_->{driver} =~ /Card:NVIDIA/ } detect_devices::probeall()) {
@@ -89,7 +89,7 @@ foreach my $hw_class (@harddrake::data::tree) {
log::explanations("removed $Ident: " . harddrake::data::custom_id($oldconfig->{$_}, $item)) foreach @was_removed;
log::explanations("added $Ident: " . harddrake::data::custom_id($ID{$_}, $item)) foreach @added;
- modules::load('ohci1394') if $Ident eq 'FIREWIRE_CONTROLLER' && any { $_->{driver} eq 'ohci1394' } @added;
+ modules::load_and_configure($modules_conf, 'ohci1394') if $Ident eq 'FIREWIRE_CONTROLLER' && any { $_->{driver} eq 'ohci1394' } @added;
@added || @was_removed or next;
my @configurator_pool;
if (harddrake::data::is_removable($Ident)) {
@@ -105,20 +105,20 @@ foreach my $hw_class (@harddrake::data::tree) {
if ($Ident eq "AUDIO") {
# automatic sound slots configuration
rm_rf("/etc/asound.state");
- harddrake::sound::configure_sound_slots();
+ harddrake::sound::configure_sound_slots($modules_conf);
next;
} elsif ($Ident eq "ETHERNET") {
- modules::remove_alias_regexp('^(wlan|eth)[0-9]*$');
- modules::load_category('network/main|gigabit|usb|wireless');
+ $modules_conf->remove_alias_regexp('^(wlan|eth)[0-9]*$');
+ modules::load_category($modules_conf, 'network/main|gigabit|usb|wireless');
require network::ethernet;
- network::ethernet::configure_eth_aliases();
- modules::write_conf();
+ network::ethernet::configure_eth_aliases($modules_conf);
+ $modules_conf->write;
} elsif ($Ident eq "AGP") {
# add agpgart modules to modprobe.preload if needed:
- modules::write_conf();
+ $modules_conf->write;
} elsif ($Ident eq "VIDEO") {
require harddrake::autoconf;
- harddrake::autoconf::xconf();
+ harddrake::autoconf::xconf($modules_conf, {});
next;
}