Download Latest Version pci_ids_info-1.0.2.tar.gz (543.7 kB)
Email in envelope

Get an email when there's a new version of pci_ids_info

Home
Name Modified Size InfoDownloads / Week
pci_ids_info-1.0.2.tar.gz 2020-10-02 543.7 kB
README.TXT 2020-10-02 10.4 kB
pci_ids_info-1.0.1.tar.gz 2020-09-16 543.6 kB
pci_ids_info-1.0.0.tar.gz 2020-09-15 542.8 kB
Totals: 4 Items   1.6 MB 0
--------------------
Description

This package contains scripts for describing the PCI IDs and associated 
drivers on a running system.  Optionally, it may also determine if
support for these devices is provided in some other kernel.  If not and that
other kernel is from a RedHat derived distribution, it can also determine if
ElRepo has a driver for the missing device.  The examples all use CentOS 8,
which is one such RedHat derived distribution.

Because RedHat aggresively removes older drivers it is common for
an install on older hardware to fail because a critical driver is absent.
The scripts and files here may be used while an older system is running
some other Linux distribution so that this problem may be detected
prior to the upgrade, and so that if a problem is found, the materials 
needed to work around it are at hand.  In other words, the goal is to avoid 
unpleasant surprises during the install of a newer RedHat derived linux
distribution.

The map_hardware_to_drivers.pl script will work with any modern linux
distribution.  However, the elrepo*pl scripts are only needed prior to
installing a RedHat derived distribution.  

--------------------
Release information

version: 1.0.2
date: 2020/10/02

--------------------
License information

GPL V3.0

--------------------
Determine if CentOS 8 is missing drivers for the current system.

#optional, update the PciIDsFile
wget -O PciIDsFile https://pci-ids.ucw.cz/v2.2/pci.ids

#devices/drivers for current system, an installer, and the final kernel
./map_hardware_to_drivers.pl PciIDsFile ""            >/tmp/mhtd_default.txt
./map_hardware_to_drivers.pl PciIDsFile CO8_installer >/tmp/mhtd_co8i.txt
./map_hardware_to_drivers.pl PciIDsFile CO8_kernel    >/tmp/mhtd_co8k.txt

diff /tmp/mhtd_default.txt /tmp/mhtd_co8k.txt
# Reading the diff:
# "<"        ">"         
# (modules)  <none>       Most likely device driver is not in CentOS 8 kernel
#                         There is no module.  It might be built in,
#                         but probably it is not.
# (builtin)  <none>       Most likely device driver is builtin to CentOS 8 kernel.
#                         There is no way to know since the needed 
#                         information is not in the modules.alias file.  
#                         These tend to be 8086:* devices like
#                         bridges and such.

diff /tmp/mhtd_default.txt /tmp/mhtd_co8i.txt
# As above, but some of the (modules)/<none> pairs might be
# supported if that driver is built into the installer's kernel.
# There is no way to determine if that is the case from
# the modules.alias file.

Example diff output indicating a missing driver in the 
CentOS 8 installer:

< 03:00.0 1000:0060 megaraid_sas(module) "MegaRAID SAS 1078"
---
> 03:00.0 1000:0060 <none> "MegaRAID SAS 1078"

--------------------
Generate a PCI Device ID summary for all available ElRepo RPMs

##############
# Note 1:
# This script uses the ElRepo download mirror:
#
#   http://ftp.osuosl.org/pub/elrepo/
#
# If a different one should be used consult
#
#   https://elrepo.org/tiki/Download
#
# and modify the "TOP=" line in the following script before running it.
#
##############
# Note 2:
# This script requires the program "extract" from drm_tools 
# on sourceforge be installed on the PATH.  To install it:
# Download the latest .tar.gz from
#    https://sourceforge.net/projects/drmtools/files/
# Unpack it.
# cd into that directory.
# Inspect the CMakeLists.txt and verify that it will install
#   to the directory you want.  Or skip the install and move
#   the binary manually later.
# mkdir build
# cd build
# cmake ..
# make         # or: make extract
# make install # or: mv extract WHERE_YOU_WANT_IT

./process_elrepo.sh

# Creates two files:
#   elrepo_module_list_summary.txt
#   elrepo_module_pci_info.txt.
# The second one is used by elrepo_driver_for_missing_centos8.pl.
# These files are in /tmp/wd and should be moved to the directory
# where the perl script is located after it is verified that the
# process_elrepo.sh run was successful.

mv /tmp/wd/elr* .
rmdir /tmp/wd

--------------------
Determine if ElRepo drivers exist when there are missing CentOS 8 drivers.

./elrepo_driver_for_missing_centos8.pl elrepo_module_pci_info.txt CO8_kernel

This will be blank if there are no missing drivers, or if there are no
ElRepo drivers that work with that device.  If an ElRepo driver is found
which will work with the PCI ID, and no such driver exists in the specified
target kernel, then an output line similar to the following one will be emitted:

03:00.0 1095:3132 sata_sil24 kmod-sata_sil24-1.1-1.el8_2.elrepo.x86_64.rpm Mass storage controller: Silicon Image, Inc. SiI 3132 Serial ATA Raid II Controller (rev 01)

--------------------
Determine if ElRepo drivers exist for devices whether or not a device 
driver also exists in CentOS 8.

# This is an older method which lists all ElRepo drivers which will work with
# detected devices, but does not determine if there are also CentOS 8 drivers 
# for these devices.  This depends on a summary file on the ElRepo site which 
# may not contain current information.  For that reason, the preceding method
# should normally be used instead.

# The result will show drivers which support the devices in this machine
# whether or not CentOS 8 drivers also exist.

# optional, update the DeviceIDsFile
wget -O DeviceIDsFile http://elrepo.org/tiki/DeviceIDs

./elrepo_driver_for_centos8.pl DeviceIDsFile
# outputs
03:00.0 1000:0060 kmod-megaraid_sas pci RAID bus controller: Broadcom / LSI MegaRAID SAS 1078 (rev 04)
06:08.0 1000:0030 kmod-mptspi pci SCSI storage controller: Broadcom / LSI 53c1030 PCI-X Fusion-MPT Dual Ultra320 SCSI (rev c1)

--------------------
Installing an ElRepo driver while installing CentOS 8.

If a missing driver is not critical then the ElRepo repository may 
be installed after CentOS 8 and the driver installed using dnf
in the normally running system.  However, if the system will not be
able to see its disks or network then the ElRepo driver must be installed 
during the CentOS 8 install.  Instructions for doing so are here:

  http://elrepoproject.blogspot.com/2019/08/rhel-80-and-support-for-removed-adapters.html

In brief:

If CentOS 8 has drivers for a network card but is missing a storage driver then 
add to the kernel boot parameters:

  inst.dd=https://elrepo.org/linux/dud/el8/x86_64/dd-megaraid_sas-07.710.50.00-1.el8_2.elrepo.iso

If CentOS 8 does not have network drivers then place the needed drivers on a USB stick, CD, or DVD,
add just 
 
   inst.dd

to the boot line.  It _might_ find the driver device without the inst.dd, but
if it does not the "inst.dd" will be required to tell it to scan for storage devices.
This will bring up a menu of dd (device driver) drives, select the device.  It will
then show all the drivers which are on that drive.  Select them by entering the number
of the line you want and it will become "checked".  Then press the "c" key to continue.

To add another kernel boot parameter:

Run the installer.
At the screen which has "Install CentOS 8", highlight that entry 
   and press the "Tab" key.  
At the resulting kernel boot line enter
   inst.dd    
      or
   inst.dd=URL_TO_DUD_ISO_AS_ABOVE
Press the "enter" key.

--------------------
Files provided:

CO6_pci_ids_by_name
   List of CentOS 6 supported PCI IDs, sorted by name

CO6_pci_ids_by_number
   List of CentOS 6 supported PCI IDs, sorted by number

CO6_pci_ids_kernel
   Kernel from which CO6_pci_ids* files were derived.

CO7_pci_ids_by_name
   List of CentOS 7 supported PCI IDs, sorted by name

CO7_pci_ids_by_number
   List of CentOS 7 supported PCI IDs, sorted by number

CO7_pci_ids_kernel
   Kernel from which CO7_pci_ids* files were derived.

CO8_installer.modules.alias
   Modules.alias file from a CentOS 8 installer.

CO8_kernel_4.18.0-193.14.2.el8_2.modules.alias
   Modules.alias file from the current CentOS 8 kernel.

CO8_pci_ids_by_name
   List of CentOS 8 supported PCI IDs, sorted by name

CO8_pci_ids_by_number
   List of CentOS 8 supported PCI IDs, sorted by number

CO8_pci_ids_kernel
   Kernel from which CO8_pci_ids* files were derived.

DeviceIDsFile
   PCI IDs (and other information) from El Repo, describes
   devices their drivers support.  Data may be out of date
   or incorrect.

elrepo_driver_for_centos8.pl
   List El Repo drivers which support devices on this system.
   These may support devices the OS does not, or they might
   both support the same device.

elrepo_driver_for_missing_centos8.pl
   List ElRepo drivers which support devices NOT supported by
   the specified kernel.

elrepo_module_list_summary.txt
   Summary of ElRepo module names.

elrepo_module_pci_info.txt
   ElRepo module names, PCI Device Ids, RPM file names and other
   information. 

license.txt
   GPL 3 license.
   
map_hardware_to_drivers.pl
   Determine all PCI devices on the current system and show
   drivers available in the current kernel or one specified by
   name.

PciIDsFile
   All known PCI IDs, from 
   https://pci-ids.ucw.cz/v2.2/pci.ids

process_elrepo.sh
   Map all ElRepo drivers by their supported PCI IDs.
   Makes files: 
     elrepo_module_list_summary.txt
     elrepo_module_pci_info.txt

README.TXT
   This file.

--------------------
Revision information:

1.0.2 2020/10/02 Eliminate use of File::Which for `which`, because
                 some OS's will not have the former in their Perl.

1.0.1 2020/09/16 check for lspci, modinfo.
                 Put "#" before comment lines in output.
1.0.0 2020/09/15 initial release

--------------------
Method for producing the CO*_pci_ids* files.

These files contain information derived from modules.alias in an
abbreviated form.  They are provided as a convenience and are
not used by the scripts.  This method requires "extract" from drm_tools

  https://sourceforge.net/projects/drmtools/

(or rewrite to use perl, awk, or whatever to replace it).
 
grep 'alias pci:'  /lib/modules/`uname -r`/modules.alias \
  | grep 'pci:v0' \
  | extract -mt -dl ' \t' -fmt '0x[mc:16,19] 0x[mc:25,28] [-1]' \
  | sort -k3,3 -k1,1n -k2,2n \
  >CO8_pci_ids_by_name

grep 'alias pci:'  /lib/modules/`uname -r`/modules.alias \
  | grep 'pci:v0' \
  | extract -mt -dl ' \t' -fmt '0x[mc:16,19] 0x[mc:25,28] [-1]' \
  | sort -k 1,1n -k 2,2n \
  >CO8_pci_ids_by_number
  
uname -r >CO8_pci_ids_kernel


Source: README.TXT, updated 2020-10-02