summaryrefslogtreecommitdiffstats
path: root/perl-install/harddrake
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/harddrake')
-rw-r--r--perl-install/harddrake/autoconf.pm21
-rw-r--r--perl-install/harddrake/data.pm114
-rw-r--r--perl-install/harddrake/sound.pm88
-rw-r--r--perl-install/harddrake/v4l.pm18
4 files changed, 162 insertions, 79 deletions
diff --git a/perl-install/harddrake/autoconf.pm b/perl-install/harddrake/autoconf.pm
index 985fecb4e..adf6d9957 100644
--- a/perl-install/harddrake/autoconf.pm
+++ b/perl-install/harddrake/autoconf.pm
@@ -4,24 +4,31 @@ 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(do_pkgs_standalone->new);
require Xconfig::main;
- require class_discard;
- Xconfig::main::configure_everything_auto_install($o->{raw_X}, class_discard->new, {}, { allowFB => 1 });
+ require do_pkgs;
+ Xconfig::main::configure_everything_auto_install($o->{raw_X}, do_pkgs_standalone->new, {}, { allowFB => 1 });
- modules::load_category('various/agpgart');
+ modules::load_category($modules_conf, 'various/agpgart');
}
sub network_conf {
- my ($o) = @_;
+ my ($obj) = @_;
require network::network;
- network::network::easy_dhcp($o->{netc}, $o->{intf}) and $o->{netcnx}{type} = 'lan';
+ network::network::easy_dhcp($obj->{modules_conf}, $obj->{netc}, $obj->{intf}) and $obj->{netcnx}{type} = 'lan';
+}
+
+sub mouse_conf {
+ my ($modules_conf) = @_;
+ require do_pkgs;
+ require mouse;
+ mouse::write_conf(do_pkgs_standalone->new, $modules_conf, mouse::detect($modules_conf), 1);
}
1;
diff --git a/perl-install/harddrake/data.pm b/perl-install/harddrake/data.pm
index ca1b30b40..f183f0d1e 100644
--- a/perl-install/harddrake/data.pm
+++ b/perl-install/harddrake/data.pm
@@ -10,9 +10,12 @@ our ($version, $sbindir, $bindir) = ("10", "/usr/sbin", "/usr/bin");
my @devices = detect_devices::probeall();
+
+# 10.2: REMOVE ALL BLACKLISTING FROM unknown() since f() has already filter out matched devices
+
# Update me each time you handle one more devices class (aka configurator)
sub unknown() {
- grep { $_->{media_type} !~ /BRIDGE|class\|Mouse|DISPLAY|Hub|MEMORY_RAM|MULTIMEDIA_(VIDEO|AUDIO|OTHER)|NETWORK|Printer|SERIAL_(USB|SMBUS)|STORAGE_(IDE|OTHER|SCSI)|tape/
+ grep { $_->{media_type} !~ /BRIDGE|class\|Mouse|DISPLAY|Hub|MEMORY_RAM|MULTIMEDIA_(VIDEO|AUDIO|OTHER)|NETWORK|Printer|SERIAL_(USB|SMBUS)|STORAGE_(IDE|OTHER|SCSI)|SYSTEM_OTHER|tape|UPS/
&& !member($_->{driver}, qw(cpia_usb cyber2000fb forcedeth ibmcam megaraid mod_quickcam nvnet ohci1394 ov511 ov518_decomp scanner ultracam usbvideo usbvision))
&& $_->{driver} !~ /^ISDN|Mouse:USB|Removable:zip|class\|Mouse|sata|www.linmodems.org/
&& $_->{type} ne 'network'
@@ -38,6 +41,11 @@ sub is_removable { $_[0] =~ /FLOPPY|ZIP|DVDROM|CDROM|BURNER/ }
sub set_removable_configurator {
my ($class, $device) = @_;
+ return "/usr/sbin/diskdrake --removable=$device->{device}" if is_removable($class);
+ }
+
+sub set_removable_auto_configurator {
+ my ($class, $device) = @_;
return "/usr/sbin/drakupdate_fstab --no-flag --auto --add $device->{device}" if is_removable($class);
}
@@ -46,6 +54,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 =
@@ -76,7 +85,7 @@ our @tree =
icon => "harddisk.png",
configurator => "$sbindir/diskdrake",
detector => sub { f(detect_devices::hds()) },
- checked_on_boot => 1,
+ checked_on_boot => 0,
},
{
@@ -134,7 +143,7 @@ our @tree =
icon => "tv.png",
configurator => "/usr/bin/XawTV",
detector => sub { f(grep { $_->{media_type} =~ /MULTIMEDIA_VIDEO/ && $_->{bus} eq 'PCI' || $_->{driver} eq 'usbvision' } @devices) },
- checked_on_boot => 0,
+ checked_on_boot => 1,
},
{
@@ -166,6 +175,7 @@ our @tree =
|| member($_->{driver}, qw(cpia_usb cyber2000fb ibmcam mod_quickcam ov511 ov518_decomp pwc ultracam usbvideo))
} @devices)
},
+ # managed by hotplug:
checked_on_boot => 0,
},
@@ -175,6 +185,7 @@ our @tree =
icon => "cpu.png",
configurator => "",
detector => sub { detect_devices::getCPUs() },
+ # maybe should we install schedutils?
checked_on_boot => 0,
},
@@ -183,7 +194,8 @@ 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)) },
+ # we do not check these b/c this need user interaction (auth, ...):
checked_on_boot => 0,
},
@@ -193,12 +205,14 @@ our @tree =
icon => "hw_network.png",
configurator => "$sbindir/drakconnect",
detector => sub {
- #- generic NIC detection for USB seems broken (class, subclass,
- #- protocol reported are not accurate) so we match network adapters against
- #- known drivers :-(
require list_modules;
- my @net_modules = list_modules::category2modules('network/gigabit|main|pcmcia|usb|wireless');
- f(grep { member($_->{driver}, @net_modules) } @devices);
+ require network::ethernet;
+ my @net_modules = list_modules::category2modules(network::ethernet::get_eth_categories());
+ f(grep {
+ $_->{media_type} && $_->{media_type} =~ /^NETWORK/
+ || $_->{type} && $_->{type} eq 'network'
+ || member($_->{driver}, @net_modules);
+ } @devices);
},
checked_on_boot => 1,
},
@@ -208,7 +222,8 @@ our @tree =
string => N("Modem"),
icon => "modem.png",
configurator => "$sbindir/drakconnect",
- detector => sub { detect_devices::getModem() },
+ detector => sub { detect_devices::getModem($modules_conf) },
+ # we do not check these b/c this need user interaction (auth, ...):
checked_on_boot => 0,
},
@@ -222,6 +237,7 @@ our @tree =
my $a = network::adsl::adsl_detect();
$a ? f(grep { $_ } values %$a) : ();
},
+ # we do not check these b/c this need user interaction (auth, ...):
checked_on_boot => 0,
},
@@ -231,7 +247,7 @@ our @tree =
icon => "memory.png",
configurator => "",
detector => sub { f(modules::probe_category('various/agpgart')) },
- checked_on_boot => 0,
+ checked_on_boot => 1,
},
{
@@ -239,7 +255,7 @@ our @tree =
string => N("Bridges and system controllers"),
icon => "memory.png",
configurator => "",
- detector => sub { f(grep { $_->{media_type} =~ /BRIDGE|MEMORY_RAM/ } @devices) },
+ detector => sub { f(grep { $_->{media_type} =~ /BRIDGE|MEMORY_RAM|SYSTEM_OTHER/ } @devices) },
checked_on_boot => 0,
},
@@ -249,24 +265,11 @@ our @tree =
icon => "hw_printer.png",
configurator => "$sbindir/printerdrake",
detector => sub { require printer::detect; printer::detect::local_detect() },
+ # we do not check these b/c this need user interaction (auth, ...):
checked_on_boot => 0,
},
{
- class => "MOUSE",
- string => N("Mouse"),
- icon => "hw_mouse.png",
- configurator => "$sbindir/mousedrake",
- detector => sub {
- require mouse;
- require modules;
- modules::mergein_conf();
- &mouse::detect();
- },
- checked_on_boot => 1,
- },
-
- {
class => "JOYSTICK",
string => N("Joystick"),
icon => "joystick.png",
@@ -282,7 +285,7 @@ our @tree =
icon => "ide_hd.png",
configurator => "",
detector => sub { f(grep { $_->{media_type} =~ /STORAGE_(IDE|OTHER)/ || $_->{driver} eq '3w-xxxx' } @devices) },
- checked_on_boot => 0,
+ checked_on_boot => 1,
},
{
@@ -291,7 +294,7 @@ our @tree =
icon => "ide_hd.png",
configurator => "",
detector => sub { f(grep { $_->{driver} =~ /^sata/ } @devices) },
- checked_on_boot => 0,
+ checked_on_boot => 1,
},
{
@@ -304,12 +307,25 @@ our @tree =
},
{
+ class => "PCMCIA_CONTROLLER",
+ string => N("PCMCIA controllers"),
+ icon => "scsi.png",
+ configurator => "",
+ detector => sub {
+ require list_modules;
+ my @modules = list_modules::category2modules('bus/pcmcia');
+ f(grep { member($_->{driver}, @modules) } @devices);
+ },
+ checked_on_boot => 1,
+ },
+
+ {
class => "SCSI_CONTROLLER",
string => N("SCSI controllers"),
icon => "scsi.png",
configurator => "",
detector => sub { f(grep { $_->{media_type} =~ /STORAGE_SCSI/ || $_->{driver} eq 'megaraid' } @devices) },
- checked_on_boot => 0,
+ checked_on_boot => 1,
},
{
@@ -318,7 +334,7 @@ our @tree =
icon => "usb.png",
configurator => "",
detector => sub { f(grep { $_->{media_type} eq 'SERIAL_USB' } @devices) },
- checked_on_boot => 0,
+ checked_on_boot => 1,
},
{
@@ -340,6 +356,42 @@ our @tree =
},
{
+ class => "UPS",
+ string => N("UPS"),
+ icon => "ups.png",
+ configurator => "$sbindir/drakups",
+ detector => sub { f(detect_devices::getUPS()) },
+ checked_on_boot => 0,
+ },
+
+ {
+ class => "KEYBOARD",
+ string => N("Keyboard"),
+ icon => "usb.png",
+ configurator => "$sbindir/keyboardrake",
+ detector => sub {
+ f(grep { $_->{description} =~ /Keyboard/i } @devices),
+ # USB devices are filtered out since we already catch them through probeall():
+ grep { $_->{bus} ne 'usb' && $_->{driver} eq 'kbd' } detect_devices::getInputDevices();
+ },
+ checked_on_boot => 0,
+ },
+
+ {
+ class => "MOUSE",
+ string => N("Mouse"),
+ icon => "hw_mouse.png",
+ configurator => "$sbindir/mousedrake",
+ detector => sub {
+ f(grep { $_->{driver} =~ /^Mouse:|^Tablet:/ } @devices),
+ # USB devices are filtered out since we already catch them through probeall():
+ grep { $_->{bus} ne 'usb' && $_->{driver} =~ /mouse/ } detect_devices::getInputDevices();
+ },
+ checked_on_boot => 1,
+ automatic => 1,
+ },
+
+ {
class => "SCANNER",
string => N("Scanner"),
icon => "scanner.png",
@@ -348,7 +400,7 @@ our @tree =
require scanner; f(scanner::detect()) },
checked_on_boot => 0,
},
-
+
{
class => "UNKNOWN",
string => N("Unknown/Others"),
diff --git a/perl-install/harddrake/sound.pm b/perl-install/harddrake/sound.pm
index 94f3ac5f9..5cf58593f 100644
--- a/perl-install/harddrake/sound.pm
+++ b/perl-install/harddrake/sound.pm
@@ -8,6 +8,7 @@ package harddrake::sound;
# o pci cards: snd-als4000, snd-es968, snd-hdsp
# o isa cards: snd-azt2320, snd-cs4231, snd-cs4236,
# snd-dt0197h, snd-korg1212, snd-rme32
+# o pcmcia cards: snd-vxp440 snd-vxpocket
# TODO:
# o ensure sound isn't user (either dsp/midi/sequencer/mixer)
@@ -26,14 +27,20 @@ my $has_nvaudio = -x '/lib/modules/' . c::kernel_version() . '/';
our %alsa2oss =
(
+ if_(arch() =~ /ppc/, "snd-powermac" => [ "dmasound_pmac" ]),
+ if_(arch() =~ /sparc/,
+ "snd-sun-amd7930" => [ "unknown" ],
+ "snd-sun-cs4231" => [ "unknown" ],
+ ),
"snd-ad1816a" => [ "ad1816" ], # isa
"snd-ad1848" => [ "ad1848", "pss" ], # isa
"snd-ali5451" => [ "trident" ],
"snd-als100" => [ "sb" ], # isa
"snd-als4000" => [ "unknown" ],
- "snd-au8810" => [ "unknown" ],
- "snd-au8820" => [ "unknown" ],
- "snd-au8830" => [ "unknown" ],
+ "snd-atiixp" => [ "unknown" ],
+ "snd-au8810" => [ "unknown" ],
+ "snd-au8820" => [ "unknown" ],
+ "snd-au8830" => [ "unknown" ],
"snd-azt2320" => [ "unknown" ], # isa
"snd-azt3328" => [ "unknown" ], # isa
"snd-bt87x" => [ "btaudio" ],
@@ -45,6 +52,7 @@ our %alsa2oss =
"snd-cs4281" => [ "cs4281" ],
"snd-cs46xx" => [ "cs46xx" ],
"snd-dt0197h" => [ "unknown" ], # isa
+ "snd-dt019x" => [ "unknown" ], # isa
"snd-emu10k1" => [ "audigy", "emu10k1" ],
"snd-ens1370" => [ "es1370" ],
"snd-ens1371" => [ "es1371" ],
@@ -57,16 +65,20 @@ our %alsa2oss =
"snd-gusclassic" => [ "gus" ], # isa
"snd-gusextreme" => [ "gus" ], # isa
"snd-gusmax" => [ "gus" ], # isa
- "snd-hdsp" => [ "unknown" ],
+ "snd-hdsp" => [ "unknown" ],
"snd-ice1712" => [ "unknown" ], # isa
"snd-ice1724" => [ "unknown" ], # isa
"snd-intel8x0" => [ "ali5455", "i810_audio", "nvaudio" ],
"snd-interwave" => [ "gus" ], # isa
+ "snd-interwave-stb" => [ "unknown" ], # isa
"snd-korg1212" => [ "unknown" ], # isa
"snd-maestro3" => [ "maestro3" ],
+ "snd-mixart" => [ "unknown" ],
"snd-mpu401" => [ "mpu401" ],
"snd-nm256" => [ "nm256_audio" ],
"snd-opl3sa2" => [ "opl3", "opl3sa", "opl3sa2" ], # isa
+ "snd-opti92x-ad1848" => [ "unknown" ], # isa
+ "snd-opti92x-cs4231" => [ "unknown" ], # isa
"snd-opti93x" => [ "mad16" ],
"snd-rme32" => [ "unknown" ], # isa
"snd-rme96" => [ "rme96xx" ], # pci
@@ -76,22 +88,27 @@ our %alsa2oss =
"snd-sbawe" => [ "awe_wave" ],
"snd-sgalaxy" => [ "sgalaxy" ], # isa
"snd-sonicvibes" => [ "sonicvibes" ],
+ "snd-sscape" => [ "sscape" ], # isa
"snd-trident" => [ "trident" ],
"snd-usb-audio" => [ "audio" ], # usb
"snd-via82xx" => [ "via82cxxx_audio" ],
+ "snd-vx222" => [ "unknown" ],
+ "snd-vxp440" => [ "unknown" ], # pcmcia
+ "snd-vxpocket" => [ "unknown" ], # pcmcia
"snd-wavefront" => [ "wavefront" ], # isa
- "snd-ymfpci" => [ "ymfpci" ]
+ "snd-ymfpci" => [ "ymfpci" ],
);
our %oss2alsa =
(
+ if_(arch() =~ /ppc/, "dmasound_pmac" => [ "snd-powermac" ]),
"ad1816" => [ "snd-ad1816a" ],
"ad1848" => [ "snd-ad1848", "snd-cs4236" ],
"ad1889" => [ "unknown" ],
"ali5455" => [ "snd-intel8x0" ],
"audigy" => [ "snd-emu10k1" ],
- "audio" => [ "snd-usb-audio" ], # usb
+ "audio" => [ "snd-usb-audio" ], # usb
"awe_wave" => [ "snd-sbawe" ],
"btaudio" => [ "snd-bt87x" ],
"cmpci" => [ "snd-cmipci" ],
@@ -117,17 +134,17 @@ our %oss2alsa =
"opl3sa" => [ "snd-opl3sa2" ],
"opl3sa2" => [ "snd-opl3sa2" ],
"pas2" => [ "unknown" ],
- "pss" => [ "snd-ad1848" ],
+ "pss" => [ "snd-ad1848" ],
"rme96xx" => [ "snd-rme96", "snd-rme9652" ],
"sam9407" => [ "unknown" ],
"sb" => [ "snd-als100", "snd-cmi8330", "snd-es1688", "snd-es18xx", "snd-es968", "snd-sb8", "snd-sb16" ],
"sgalaxy" => [ "snd-sgalaxy" ],
"sonicvibes" => [ "snd-sonicvibes" ],
- "sscape" => [ "snd-sb16" ],
+ "sscape" => [ "snd-sb16", "snd-sscape" ],
"trident" => [ "snd-ali5451", "snd-trident" ],
"via82cxxx_audio" => [ "snd-via82xx" ],
"wavefront" => [ "snd-wavefront" ],
- "ymfpci" => [ "snd-ymfpci" ]
+ "ymfpci" => [ "snd-ymfpci" ],
);
my @blacklist = qw(cs46xx cs4281);
@@ -137,7 +154,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 +165,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 +174,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');
+ $in->do_pkgs->ensure_binary_is_installed('alsa-utils', '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 +189,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 +207,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,15 +238,15 @@ 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};
log::explanations("switching audio driver from '" . $device->{current_driver} . "' to '$new_driver'\n");
$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});
+The new \"%s\" driver will only be used on next bootstrap.", $device->{current_driver}, $new_driver)) if $blacklisted;
+ do_switch($in, $modules_conf, $device->{current_driver}, $new_driver, $device->{sound_slot_index});
$device->{current_driver} = $new_driver;
}
} elsif ($driver =~ /^Bad:/) {
@@ -238,7 +258,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,14 +268,17 @@ 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);
}
sub trouble {
my ($in) = @_;
$in->ask_warn(N("Sound trouble shooting"),
- formatAlaTeX(N("The classic bug sound tester is to run the following commands:
+ formatAlaTeX(
+ #-PO: keep the double empty lines between sections, this is formatted a la LaTeX
+ N("The classic bug sound tester is to run the following commands:
- \"lspcidrake -v | fgrep AUDIO\" will tell you which driver your card uses
@@ -278,14 +301,16 @@ 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 {},
clicked => sub {
my $old_driver = $driver;
if ($in->ask_from(N("Choosing an arbitrary driver"),
- formatAlaTeX(N("If you really think that you know which driver is the right one for your card
+ formatAlaTeX(
+ #-PO: keep the double empty lines between sections, this is formatted a la LaTeX
+ N("If you really think that you know which driver is the right one for your card
you can pick one in the above list.
The current driver for your \"%s\" sound card is \"%s\" ", $device->{description}, $driver)),
@@ -293,7 +318,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 +326,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..b2f5fe5b9 100644
--- a/perl-install/harddrake/v4l.pm
+++ b/perl-install/harddrake/v4l.pm
@@ -279,7 +279,7 @@ my %pll_lst =
);
sub config {
- my ($in, $driver) = @_;
+ my ($in, $modules_conf, $driver) = @_;
my $min_gbuffers = 2;
my $max_gbuffers = 32;
@@ -290,7 +290,7 @@ sub config {
my %rvs_cards_list = reverse %cards_list;
# get the existing options (if there are any)
- my $current = modules::get_options($driver);
+ my $current = $modules_conf->get_options($driver);
foreach (split(/\s+/,$current)) {
$conf{$1} = $2 if /^(gbuffers|tuner|radio|pll)=(.+)/;
@@ -302,8 +302,10 @@ sub config {
$conf{gbuffers} = min($max_gbuffers, $conf{gbuffers});
$conf{card} = $default if !defined $cards_list{$conf{card}};
$conf{tuner} = -1 if !defined $tuners_lst{$conf{tuner}};
- $conf{pll} = -1 if !defined $pll_lst{$conf{tuner}};
- $conf{radio} = 0 if $conf{radio} !~ /(0|1)/;
+ if ($driver eq 'bttv') {
+ $conf{pll} = -1 if !defined $pll_lst{$conf{tuner}};
+ $conf{radio} = 0 if $conf{radio} !~ /(0|1)/;
+ }
if ($in->ask_from("BTTV configuration", N("For most modern TV cards, the bttv module of the GNU/Linux kernel just auto-detect the rights parameters.
@@ -319,14 +321,10 @@ If your card is misdetected, you can force the right tuner and card types here.
))
{
$conf{card} = $cards_list{$conf{card}};
-
- my $options =
- 'radio=' . ($conf{radio} ? 1 : 0) . ' ' .
- join(' ', map { if_($conf{$_} ne -1, "$_=$conf{$_}") } qw(card pll tuner gbuffers));
- if ($options) {
+ if (my $options = join(' ', if_($driver eq 'bttv', 'radio=' . ($conf{radio} ? 1 : 0)), map { if_($conf{$_} ne -1, "$_=$conf{$_}") } qw(card pll tuner gbuffers))) {
log::l(qq([harddrake::v4l] set "$options" options for $driver));
# log::explanations("modified file /etc/modules.conf ($options)") if $::isStandalone;
- modules::set_options($driver, $options);
+ $modules_conf->set_options($driver, $options);
}
return 1;
}