summaryrefslogtreecommitdiffstats
path: root/kernel
Commit message (Expand)AuthorAgeFilesLines
* i82092 is also a controller driverGuillaume Cottenceau2003-07-091-1/+1
* allow hd.img to build again..Guillaume Cottenceau2003-07-031-0/+1
* fix #2291Thierry Vignaud2003-05-221-1/+1
* fix #3959 : add aic79xx scsi host controller driverThierry Vignaud2003-05-201-1/+1
* mptscsih doesn't fit on hd.imgPascal Rigaux2003-03-061-1/+1
* added usbvnet_rfmd to network/usbFrederic Lepied2003-03-041-1/+1
* added 3c90xFrederic Lepied2003-03-041-1/+1
* hd_usb.img -> hdcdrom_usb.imgGuillaume Cottenceau2003-02-282-2/+3
* add 3c990 and bcm4400 (bug #2316)Pascal Rigaux2003-02-252-2/+2
* don't have hptraid silraid pdcraid on stage1 (/dev/ataraid unsupported anyway...Pascal Rigaux2003-02-201-1/+1
* add silraid and pdcraidPascal Rigaux2003-02-191-2/+2
* Probe airport on PPC, don't skip gmac. Fix sound driver name.Stew Benedict2003-02-181-3/+3
* add aic7xxx_old (needed when the network card firmware hasn't been updated)Pascal Rigaux2003-02-161-1/+1
* add 8139cp (cf Frederik Himpe post on cooker)Pascal Rigaux2003-02-131-1/+1
* - better error message for bad modules in modules.plPascal Rigaux2003-02-112-3/+4
* fixed sanity check on presence of marfile.Francois Pons2003-02-111-1/+1
* ck hptraid, but discard the insmod error for itPascal Rigaux2003-02-101-1/+1
* don't list hptraid since it's too buggy (eg: bug 1085)Pascal Rigaux2003-02-101-1/+1
* - have 3w-xxxx back in network.imgPascal Rigaux2003-02-041-8/+5
* - add some more modules (from pcitable, thanks chmouel)Pascal Rigaux2003-01-301-13/+18
* - remove other & usb, add hd_usb & network_gigabit_usbPascal Rigaux2003-01-301-6/+19
* - separate "bad/old pcitable modules" (ie pcitable modules not available inPascal Rigaux2003-01-301-67/+93
* nothing should be quoted here. if one wants to remove modulesGuillaume Cottenceau2003-01-231-6/+0
* ataraid is ad-hoc raid, unsupported in stage1 anywayGuillaume Cottenceau2003-01-231-0/+1
* include FS modules (fixes #975)Guillaume Cottenceau2003-01-221-1/+1
* snd-sscape does not existThierry Vignaud2003-01-151-1/+1
* remove dobleThierry Vignaud2003-01-141-2/+2
* add missing sound modules (found by check_snd in comparing draksoundThierry Vignaud2003-01-141-5/+5
* using pixel though for perl (-lne instead of -ln).Francois Pons2003-01-081-1/+1
* definitively fixed bad version and release retrieved from BOOT kernel.Francois Pons2003-01-081-2/+2
* remove some more scsi driversPascal Rigaux2003-01-021-0/+1
* add floppy.o for all boot disks, don't have some 3c isa cards to fit network.imgPascal Rigaux2002-12-051-1/+4
* fixed too many modules removed (but untested if still buildable, pixel can doFrancois Pons2002-11-251-6/+6
* revert.Francois Pons2002-11-251-1/+1
* added adiusbadsl (for supporting Sagem USB ADSL modem).Francois Pons2002-11-251-7/+13
* add new drivers that appears in alsa cvsThierry Vignaud2002-10-281-3/+3
* add nvaudio driver for lord fredlThierry Vignaud2002-10-211-1/+1
* fealnxGuillaume Cottenceau2002-09-252-0/+2
* - added orinoco_cs in pcmciaDamien Chaumette2002-09-131-1/+1
* fake support the firewire in stage1 (as if it were usb ;p)Guillaume Cottenceau2002-09-052-3/+4
* add r8169Pascal Rigaux2002-08-292-2/+2
* add new sound driverThierry Vignaud2002-08-291-1/+1
* add nvnet module in listDamien Chaumette2002-08-221-1/+1
* leave btaudio in other, not in soundThierry Vignaud2002-08-211-1/+1
* add firewire controller configurationPascal Rigaux2002-08-201-0/+1
* skip tg3 on stage1 (no room for it)Pascal Rigaux2002-08-201-0/+1
* - add missing oss modulesThierry Vignaud2002-08-191-3/+4
* add btaudioThierry Vignaud2002-08-191-3/+3
* add isa alsa driversThierry Vignaud2002-08-191-0/+2
* s/nd-sgalaxy/snd-sgalaxy/Thierry Vignaud2002-08-191-1/+1
span class="hl kwb">$l, $h_options) = @_; if ($::testing || $::local_install) { log::l("i would load module $_ ($h_options->{$_})") foreach @$l; } elsif ($::isInstall) { load_raw_install($l, $h_options); } else { run_program::run('/sbin/modprobe', $_, split(' ', $h_options->{$_})) or !run_program::run('/sbin/modprobe', '-n', $_) #- ignore missing modules or die "insmod'ing module $_ failed" foreach @$l; } if (any { /^(mousedev|printer)$/ } @$l) { sleep 2; } elsif (member('usb_storage', @$l)) { #- usb_storage is only modprobed when we know there is some scsi devices #- so trying hard to wait for devices to be detected #- first sleep the minimum time usb-stor-scan takes sleep 5; #- 5 == /sys/module/usb_storage/parameters/delay_use # then wait for usb-stor-scan to complete my $retry = 0; while ($retry++ < 10) { fuzzy_pidofs('usb-stor-scan') or last; sleep 1; log::l("waiting for usb_storage devices to appear (retry = $retry)"); } } } sub load_with_options { my ($l, $h_options) = @_; my @l = map { if_(member($_, 'plip', @parallel_zip_modules), 'parport_pc'), if_($_ eq 'vfat', 'nls_cp437', 'nls_iso8859_1'), dependencies_closure(cond_mapping_24_26($_)); } @$l; @l = remove_loaded_modules(@l) or return; my %options = map { cond_mapping_24_26($_) => $h_options->{$_} } keys %$h_options; load_raw(\@l, \%options); } sub load { my (@l) = @_; load_with_options(\@l, {}); } # eg: load_and_configure($modules_conf, 'bt878', [ bttv => 'no_overlay=1' ]) sub load_and_configure { my ($conf, $module, $o_options) = @_; my @l = remove_loaded_modules(dependencies_closure(cond_mapping_24_26($module))); load_raw(\@l, { cond_mapping_24_26($module) => $o_options }); if (member($module, @parallel_zip_modules) && ! -d "/proc/sys/dev/parport/parport0/devices/$module") { log::l("$module loaded but is not useful, removing"); unload($module); return; } $conf->set_options($module, $o_options) if $o_options; when_load($conf, $module); } sub unload { if ($::testing) { log::l("rmmod $_") foreach @_; } else { run_program::run("rmmod", $_) foreach @_; } } sub load_category { my ($conf, $category, $o_wait_message) = @_; my @try_modules = ( if_($category =~ /scsi/, if_(detect_devices::usbStorage(), 'usb_storage'), ), arch() =~ /ppc/ ? ( if_($category =~ /scsi/, if_(detect_devices::has_mesh(), 'mesh'), if_(detect_devices::has_53c94(), 'mac53c94'), ), if_($category =~ /net/, 'bmac', 'gmac', 'mace', 'airport'), ) : (), ); my @l = ( (map { my $other = { ahci => 'ata_piix', ata_piix => 'ahci' }->{$_->{driver}}; $_->{try} = 1 if $other; ($_, if_($other, { %$_, driver => $other })); } detect_devices::probe_category($category)), (map { { driver => $_, description => $_, try => 1 } } @try_modules), ); foreach (@l) { $o_wait_message->($_->{description}, $_->{driver}) if $o_wait_message; eval { load_and_configure($conf, $_->{driver}, $_->{options}) }; $_->{error} = $@; $_->{try} = 1 if member($_->{driver}, 'hptraid', 'ohci1394'); #- do not warn when this fails } eval { load_and_configure($conf, 'ide_generic') } if $category eq 'disk/ide'; grep { !($_->{error} && $_->{try}) } @l; } sub load_parallel_zip { my ($conf) = @_; arch() !~ /ppc/ or return; grep { eval { load_and_configure($conf, $_); 1 }; } @parallel_zip_modules; } #-############################################################################### #- modules.conf functions #-############################################################################### sub write_preload_conf { my ($conf) = @_; my @l; my $is_laptop = detect_devices::isLaptop(); my $manufacturer = detect_devices::dmidecode_category('System')->{Manufacturer}; push @l, 'scsi_hostadapter' if $conf->get_probeall('scsi_hostadapter'); push @l, detect_devices::probe_name('Module'); push @l, 'nvram' if $is_laptop; push @l, map { $_->{driver} } detect_devices::probe_category($_) foreach qw(multimedia/dvb multimedia/tv various/agpgart various/laptop input/joystick various/crypto disk/card_reader); push @l, 'padlock' if cat_("/proc/cpuinfo") =~ /rng_en/; push @l, 'evdev' if any { $_->{Synaptics} || $_->{ALPS} || $_->{HWHEEL} } detect_devices::getInputDevices(); push @l, 'asus_acpi' if $is_laptop && $manufacturer =~ m/^ASUS/; push @l, 'thinkpad_acpi' if $is_laptop && member($manufacturer, qw(IBM LENOVO)); push @l, 'hdaps' if $is_laptop && $manufacturer eq 'LENOVO'; append_to_modules_loaded_at_startup("$::prefix/etc/modprobe.preload", @l); } sub append_to_modules_loaded_at_startup_for_all_kernels { append_to_modules_loaded_at_startup($_, @_) foreach "$::prefix/etc/modprobe.preload"; } sub append_to_modules_loaded_at_startup { my ($file, @l) = @_; my $l = join '|', map { '^\s*' . $_ . '\s*$' } @l; log::l("to put in $file ", join(", ", @l)); substInFile { $_ = '' if $l && /$l/; $_ .= join '', map { "$_\n" } @l if eof; } $file; } sub set_preload_modules { my ($service, @modules) = @_; my $preload_file = "$::prefix/etc/modprobe.preload.d/$service"; if (@modules) { output_p($preload_file, join("\n", @modules, '')); } else { unlink($preload_file); } eval { load(@modules) } if @modules && !$::isInstall; } #-############################################################################### #- internal functions #-############################################################################### sub loaded_modules() { map { /(\S+)/ } cat_("/proc/modules"); } sub remove_loaded_modules { my (@l) = @_; difference2([ uniq(@l) ], [ map { my $s = $_; $s =~ s/_/-/g; $s, $_ } loaded_modules() ]); } sub read_already_loaded { my ($conf) = @_; when_load($conf, $_) foreach reverse loaded_modules(); } sub when_load { my ($conf, $name) = @_; if (my $category = module2category($name)) { when_load_category($conf, $name, $category); } if (my @above = $conf->get_above($name)) { load(@above); #- eg: for snd-pcm-oss set by set_sound_slot() } } sub when_load_category { my ($conf, $name, $category) = @_; if ($category =~ m,disk/ide,) { $conf->add_probeall('ide-controller', $name); eval { load('ide_disk') }; } elsif ($category =~ m,disk/(scsi|hardware_raid|sata|usb|firewire),) { $conf->add_probeall('scsi_hostadapter', $name); eval { load('sd_mod') }; } elsif ($category eq 'bus/usb') { $conf->add_probeall('usb-interface', $name); -f '/proc/bus/usb/devices' or eval { require fs::mount; fs::mount::usbfs(''); #- ensure keyboard is working, the kernel must do the job the BIOS was doing sleep 4; load("usbkbd", "keybdev") if detect_devices::usbKeyboards(); }; } elsif ($category eq 'bus/firewire') { $conf->set_alias('ieee1394-controller', $name); } elsif ($category =~ /sound/) { my $sound_alias = find { /^sound-slot-[0-9]+$/ && $conf->get_alias($_) eq $name } $conf->modules; $sound_alias ||= 'sound-slot-0'; $conf->set_sound_slot($sound_alias, $name); } elsif ($category =~ m!disk/card_reader!) { my @modules = ('mmc_block', if_($name =~ /tifm_7xx1/, 'tifm_sd')); $conf->set_above($name, join(' ', @modules)); } } #-############################################################################### #- isInstall functions #-############################################################################### sub module_extension() { ".ko" } sub extract_modules { my ($dir, @modules) = @_; map { my $modname = $_; my $path = list_modules::modname2path($modname); my $f = $modname . module_extension(); if (-e $path) { system("gzip -dc $path > $dir/$f") == 0 or unlink "$dir/$f"; } else { log::l("warning: unable to get module filename for $modname (path: $path)"); } "$dir/$f"; } @modules; } sub load_raw_install { my ($l, $options) = @_; extract_modules('/tmp', @$l); my @failed = grep { my $m = '/tmp/' . $_ . module_extension(); if (-e $m) { my $stdout; my $rc = run_program::run('/sbin/insmod', '2>', \$stdout, $m, split(' ', $options->{$_})); log::l(chomp_($stdout)) if $stdout; if ($rc) { unlink $m; ''; } } else { log::l("missing module $_"); 'error'; } } @$l; die "insmod'ing module " . join(", ", @failed) . " failed" if @failed; } 1;