[PATCHv4 0/3] Rationale for creation of lsi2c, lsspi and similar capabilities

alison at she-devel.com alison at she-devel.com
Wed Jan 15 08:00:41 UTC 2014


From: Alison Chaiken <alison_chaiken at mentor.com>

The x86 environment has a set of tools that provide information about attached
peripherals, for example lshw, inxi and sensors.  Among these tools are lspci
and lsusb that scan the enumerable USB and PCI buses.  These buses are the most
common ones on general-purpose computers.  Souf Oued has previously added lspci
and lsusb to busybox.

Busybox is often installed on embedded devices which may have more primitive
ones like I2C and SPI.  I2C and SPI buses do not have controllers that can be
interrogated, but the kernel after probing them will create nodes for attached
devices in sysfs.  If we want eventually to have a capability like lshw, inxi or
sensors as part of busybox, it makes sense to include a scan of these other
common embedded buses.  The lsi2c and lsspi applets (the latter not finished)
are meant to implement these fake bus scans.

Souf's lspci and lsusb applets read sysfs to determine which devices are
attached to the buses.  lsi2c and lsspi duplicate this approach.

Alison Chaiken (3):
  Add hooks to compile lsi2c and lsspi applets
  add SPI bus fake enumeration stub
  add I2C bus fake enumeration applet lsi2c

 include/applets.src.h |  2 ++
 util-linux/Config.src | 20 +++++++++++++++++++
 util-linux/Kbuild.src |  4 ++++
 util-linux/lsi2c.c    | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++
 util-linux/lsspi.c    | 36 +++++++++++++++++++++++++++++++++
 5 files changed, 117 insertions(+)
 create mode 100644 util-linux/lsi2c.c
 create mode 100644 util-linux/lsspi.c

-- 
1.8.5.2



More information about the busybox mailing list