From c7dad17b3fb33460bdf011f7c785a9ebd2da47dc Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Tue, 15 Mar 2005 14:31:14 +0000 Subject: - add dmi_probe() - some special code on dmi is now moved in dmitable with flags Pkg: and Module: --- perl-install/c/stuff.xs.pl | 19 +++++++++++++++++++ perl-install/detect_devices.pm | 10 +++++++++- perl-install/install_any.pm | 11 ++--------- perl-install/modules.pm | 1 + perl-install/share/list | 1 + 5 files changed, 32 insertions(+), 10 deletions(-) (limited to 'perl-install') diff --git a/perl-install/c/stuff.xs.pl b/perl-install/c/stuff.xs.pl index 889b29428..3abcd7690 100644 --- a/perl-install/c/stuff.xs.pl +++ b/perl-install/c/stuff.xs.pl @@ -403,6 +403,25 @@ usb_probe() } pciusb_free(&entries); +void +dmi_probe() + PPCODE: + //dmidecode_file = "/usr/share/ldetect-lst/dmidecode.Laptop.Dell-Latitude-C810"; + //dmidecode_file = "../../soft/ldetect-lst/test/dmidecode.Laptop.Sony-Vaio-GRX316MP"; + + struct dmi_entries entries = dmi_probe(); + char buf[2048]; + int i; + + EXTEND(SP, entries.nb); + for (i = 0; i < entries.nb; i++) { + snprintf(buf, sizeof(buf), "%s\t%s", + entries.entries[i].module, entries.entries[i].constraints); + PUSHs(sv_2mortal(newSVpv(buf, 0))); + } + dmi_entries_free(entries); + + unsigned int getpagesize() diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm index 1f376aeb1..2d8402eeb 100644 --- a/perl-install/detect_devices.pm +++ b/perl-install/detect_devices.pm @@ -729,13 +729,21 @@ sub pcmcia_probe() { @devs; } +my $dmi_probe; +sub dmi_probe() { + $dmi_probe ||= [ map { + /(.*?)\t(.*)/ && { bus => 'DMI', driver => $1, description => $2 }; + } c::dmi_probe() ]; + @$dmi_probe; +} + # pcmcia_probe provides field "device", used in network.pm # => probeall with $probe_type is unsafe sub probeall() { return if $::noauto; require sbus_probing::main; - pci_probe(), usb_probe(), firewire_probe(), pcmcia_probe(), sbus_probing::main::probe(); + pci_probe(), usb_probe(), firewire_probe(), pcmcia_probe(), sbus_probing::main::probe(), dmi_probe(); } sub matching_desc__regexp { my ($regexp) = @_; diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm index 8abd7eba4..6facb451b 100644 --- a/perl-install/install_any.pm +++ b/perl-install/install_any.pm @@ -797,17 +797,10 @@ sub default_packages { push @l, "mdadm" if !is_empty_array_ref($o->{all_hds}{raids}); push @l, "lvm2" if !is_empty_array_ref($o->{all_hds}{lvms}); push @l, "alsa", "alsa-utils" if any { $o->{modules_conf}->get_alias("sound-slot-$_") =~ /^snd-/ } 0 .. 4; - my $dmi_System = detect_devices::dmidecode_category('System'); + push @l, map { if_($_->{driver} =~ /^Pkg:(.*)/, $1) } detect_devices::probeall(); + my $dmi_BIOS = detect_devices::dmidecode_category('BIOS'); my $dmi_Base_Board = detect_devices::dmidecode_category('Base Board'); - if ($dmi_System->{Manufacturer} =~ /Dell Computer/ && $dmi_System->{'Product Name'} =~ /Inspiron|Latitude/) { - modules::append_to_modules_loaded_at_startup_for_all_kernels('i8k'); - push @l, "i8kutils"; - } - if ($dmi_System->{Manufacturer} =~ /TOSHIBA/ && $dmi_BIOS->{Vendor} =~ /TOSHIBA/) { - modules::append_to_modules_loaded_at_startup_for_all_kernels('toshiba'); - push @l, "toshutils"; - } if ($dmi_BIOS->{Vendor} eq 'COMPAL' && $dmi_BIOS->{Characteristics} =~ /Function key-initiated network boot is supported/ || $dmi_Base_Board->{Manufacturer} =~ /^ACER/ && $dmi_Base_Board->{'Product Name'} =~ /TravelMate 610/) { modules::append_to_modules_loaded_at_startup_for_all_kernels('acerhk'); diff --git a/perl-install/modules.pm b/perl-install/modules.pm index 3a16b62e6..4f4d3b3f2 100644 --- a/perl-install/modules.pm +++ b/perl-install/modules.pm @@ -180,6 +180,7 @@ sub write_preload_conf { push @l, 'scsi_hostadapter' if $conf->get_probeall('scsi_hostadapter'); push @l, intersection([ list_modules::category2modules('multimedia/dvb'), list_modules::category2modules('multimedia/tv') ], [ map { $_->{driver} } detect_devices::probeall() ]); + push @l, map { if_($_->{driver} =~ /^Module:(.*)/, $1) } detect_devices::probeall(); push @l, 'nvram' if cat_('/proc/bus/input/devices') =~ m!^N: Name="SynPS/2 Synaptics TouchPad"$!m; push @l, map { $_->{driver} } probe_category('various/laptop'); push @l, map { $_->{driver} } probe_category('multimedia/joystick'); diff --git a/perl-install/share/list b/perl-install/share/list index ea89ac876..ca20294fc 100644 --- a/perl-install/share/list +++ b/perl-install/share/list @@ -180,6 +180,7 @@ /usr/share/ldetect-lst/Cards+ /usr/share/ldetect-lst/MonitorsDB /usr/share/ldetect-lst/isdn.db +/usr/share/ldetect-lst/dmitable /usr/share/ldetect-lst/pcitable /usr/share/ldetect-lst/usbtable /usr/share/locale/UTF-8/LC_ADDRESS -- cgit v1.2.1