From e76ac94274b3c3e3bb809f9a73718a56e652631b Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Sat, 16 Dec 2000 00:01:01 +0000 Subject: pci_probing now done by libldetect config files moved in package ldetect-lst --- perl-install/Makefile.drakxtools | 2 -- perl-install/Xconfigurator.pm | 2 +- perl-install/c/Makefile.PL | 2 +- perl-install/c/stuff.xs.pm | 18 ++++++++++++++++++ perl-install/detect_devices.pm | 13 ++++++++++++- perl-install/share/list | 5 +++++ 6 files changed, 37 insertions(+), 5 deletions(-) (limited to 'perl-install') diff --git a/perl-install/Makefile.drakxtools b/perl-install/Makefile.drakxtools index dc93aaf29..514840c64 100644 --- a/perl-install/Makefile.drakxtools +++ b/perl-install/Makefile.drakxtools @@ -29,8 +29,6 @@ install: ln -s ../../$(patsubst $(PREFIX)/usr%,%,$(SBINDEST))/XFdrake $(BINX11DEST)/Xdrakres for i in *.pm ; do perl -pe '$$_ = "\n" if /\s*use\s+(diagnostics|vars|strict)/' $$i > $(LIBDEST)/$$i ; done - install -m 644 share/isdndb.net $(DATADIR)/isdn_db.txt - install -m 644 share/{MonitorsDB,CardsNames,Cards+} $(LIBX11DEST) install -m 644 share/diskdrake.rc $(ETCDEST) install -m 644 share/po/*.po $(LIBDEST)/po install -m 644 $(patsubst %,Newt/%.pm,Newt) $(LIBDEST)/Newt diff --git a/perl-install/Xconfigurator.pm b/perl-install/Xconfigurator.pm index 1b911fee1..7ee74a6aa 100644 --- a/perl-install/Xconfigurator.pm +++ b/perl-install/Xconfigurator.pm @@ -358,7 +358,7 @@ sub monitorConfiguration(;$$) { $monitor->{hsyncrange} && $monitor->{vsyncrange} and return $monitor; - readMonitorsDB("/usr/X11R6/lib/X11/MonitorsDB"); + readMonitorsDB("/usr/share/ldetect-lst/MonitorsDB"); add2hash($monitor, { type => $in->ask_from_treelist(_("Monitor"), _("Choose a monitor"), '|', ['Custom', keys %monitors], 'Generic|' . translate($default_monitor)) }) unless $monitor->{type}; if ($monitor->{type} eq 'Custom') { diff --git a/perl-install/c/Makefile.PL b/perl-install/c/Makefile.PL index 47ca17203..6fe8192f7 100644 --- a/perl-install/c/Makefile.PL +++ b/perl-install/c/Makefile.PL @@ -2,7 +2,7 @@ use ExtUtils::MakeMaker; # See lib/ExtUtils/MakeMaker.pm for details of how to influence # the contents of the Makefile that is written. -my $libs = '-L/usr/X11R6/lib -lX11 -lgdk -lXxf86misc'; +my $libs = '-L/usr/X11R6/lib -lX11 -lgdk -lXxf86misc -lldetect'; $libs .= ' -lrpm -lrpmio -lz' if $ENV{C_RPM}; WriteMakefile( diff --git a/perl-install/c/stuff.xs.pm b/perl-install/c/stuff.xs.pm index 63630c89b..37c32296e 100644 --- a/perl-install/c/stuff.xs.pm +++ b/perl-install/c/stuff.xs.pm @@ -28,6 +28,7 @@ print ' #include #include +#include #include #include #include @@ -200,6 +201,23 @@ _exit(status) int detectSMP() +void +pci_probe(probe_type) + int probe_type + PPCODE: + struct pci_entries entries = pci_probe(probe_type); + char buf[2048]; + int i; + + EXTEND(SP, entries.nb); + for (i = 0; i < entries.nb; i++) { + struct pci_entry e = entries.entries[i]; + snprintf(buf, sizeof(buf), "%04x\t%04x\t%04x\t%04x\t%s\t%s\t%s", + e.vendor, e.device, e.subvendor, e.subdevice, pci_class2text(e.class), e.module ? e.module : "unknown", e.text); + PUSHs(sv_2mortal(newSVpv(buf, 0))); + } + pci_free(entries); + char* crypt_md5(pw, salt) char *pw diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm index 79bfedb71..f8cc294fb 100644 --- a/perl-install/detect_devices.pm +++ b/perl-install/detect_devices.pm @@ -173,6 +173,16 @@ sub getNet() { grep { !($::isStandalone && /plip/) && c::hasNetDevice($_) } @netdevices; } +sub pci_probe { + my ($probe_type) = @_; + map { + my %l; + @l{qw(vendor id subvendor subid type driver description)} = split "\t"; + $l{$_} = hex $l{$_} foreach qw(vendor id subvendor subid); + \%l + } c::pci_probe($probe_type); +} + # pci_probing::main::probe with $probe_type is unsafe for pci! (bug in kernel&hardware) # get_pcmcia_devices provides field "device", used in network.pm # => probeall with $probe_type is unsafe @@ -181,7 +191,7 @@ sub probeall { require pci_probing::main; require sbus_probing::main; require modules; - pci_probing::main::probe($probe_type), sbus_probing::main::probe(), modules::get_pcmcia_devices(); + pci_probe($probe_type), sbus_probing::main::probe(), modules::get_pcmcia_devices(); } sub matching_desc { my ($regexp) = @_; @@ -230,6 +240,7 @@ sub hasUsbZip { hasUsb(8, -1) } sub hasSMP { c::detectSMP() } sub hasUltra66 { + die "hasUltra66 deprecated"; #- keep it BUT DO NOT USE IT as now included in kernel. cat_("/proc/cmdline") =~ /(ide2=(\S+)(\s+ide3=(\S+))?)/ and return $1; diff --git a/perl-install/share/list b/perl-install/share/list index 9bc75a86c..3b0904bb7 100644 --- a/perl-install/share/list +++ b/perl-install/share/list @@ -131,3 +131,8 @@ /usr/share/icons/editors_section.xpm /usr/share/icons/terminals_section.xpm /usr/share/icons/configuration_section.xpm +/usr/share/ldetect-lst/Cards+ +/usr/share/ldetect-lst/CardsNames +/usr/share/ldetect-lst/MonitorsDB +/usr/share/ldetect-lst/isdn.db +/usr/share/ldetect-lst/pcitable -- cgit v1.2.1