Bash-based hardware detection for PCI and USB
If you need fast answers for what's inside, you can use a Bash script to obtain an inventory of hardware on your Linux system.
If you operate outside of the mainstream distributions or compile your own Linux system, whether an em-bedded Linux, a rescue system, or just a do-it-yourself distro, you need to solve the issue of finding the right kernel modules for your collection of hardware. Armed with some background know-ledge, you can use almost any programming language to create a system for PCI or USB hardware detection. In this article, I’ll show you a method for obtaining information about devices on your Linux system with a Bash script. Using sysfs or proc, you can find all the information you need about the manufacturer, device, and device class just by asking the kernel.
Buy this article as PDF