Package: isenkram
Version: 0.63
Severity: normal
Tags: patch

Dear Petter,

1) Some modalias files lack a trailing newline.  E.g.:
  
/sys/devices/pci0000:00/0000:00:16.0/0000:00:16.0-082ee5a7-7c25-470a-9643-0c06f0466ea1/modalias
  
/sys/devices/pci0000:00/0000:00:16.0/0000:00:16.0-309dcde8-ccb1-4062-8f78-600115a34327/modalias
  
/sys/devices/pci0000:00/0000:00:16.0/0000:00:16.0-3c4852d6-d47b-4f46-b05e-b5edc1aa440e/modalias
  
/sys/devices/pci0000:00/0000:00:16.0/0000:00:16.0-42b3ce2f-bd9f-485a-96ae-26406230b1ff/modalias
  
/sys/devices/pci0000:00/0000:00:16.0/0000:00:16.0-55213584-9a29-4916-badf-0fb7ed682aeb/modalias
  
/sys/devices/pci0000:00/0000:00:16.0/0000:00:16.0-5565a099-7fe2-45c1-a22b-d7e9dfea9a2e/modalias
  
/sys/devices/pci0000:00/0000:00:16.0/0000:00:16.0-6861ec7b-d07a-4673-856c-7f22b4d55769/modalias
  
/sys/devices/pci0000:00/0000:00:16.0/0000:00:16.0-8c2f4425-77d6-4755-aca3-891fdbc66a58/modalias
  
/sys/devices/pci0000:00/0000:00:16.0/0000:00:16.0-8e6a6715-9abc-4043-88ef-9e39c6f63e0f/modalias
  
/sys/devices/pci0000:00/0000:00:16.0/0000:00:16.0-b638ab7e-94e2-4ea2-a552-d1c54b627f04/modalias
  
/sys/devices/pci0000:00/0000:00:16.0/0000:00:16.0-dba4d603-d7ed-4931-8823-17ad585705d5/modalias
  
/sys/devices/pci0000:00/0000:00:16.0/0000:00:16.0-dd17041c-09ea-4b17-a271-5b989867ec65/modalias
  
/sys/devices/pci0000:00/0000:00:16.0/0000:00:16.0-fbf6fcf1-96cf-4e2e-a6a6-1bab8cbe36b1/modalias
These are all related to the Intel Management Engine Interface (mei).
They break how isenkram documents locating all modalias strings.

2) Some /sys/devices directories include spaces in their names.  E.g.:
  /sys/devices/pci0000:00/0000:00:1f.3/skl_hda_dsp_generic/Analog Playback and 
Capture
  /sys/devices/pci0000:00/0000:00:1f.3/skl_hda_dsp_generic/Digital Playback and 
Capture
  /sys/devices/pci0000:00/0000:00:1f.3/skl_hda_dsp_generic/HDA Analog
  /sys/devices/pci0000:00/0000:00:1f.3/skl_hda_dsp_generic/HDA Analog Deep 
Buffer
This could potentially break things in the future.

3) All modalias files appear to be under /sys/devices

Below is a patch which addresses all of these.

Thank you!
Daniel Lewart
Urbana, Illinois
---
diff -ru a/NOTES b/NOTES
--- a/NOTES     2024-04-13 09:28:06.000000000 -0500
+++ b/NOTES     2025-01-03 00:00:00.000000000 -0600
@@ -125,7 +125,7 @@
 identify them.  The complete list if relevant modalias entries for a
 given machine can be found using
 
-  cat $(find /sys -name modalias) | sort -u
+  find /sys/devices -name modalias -print0 | xargs -0 sort -u
 
 Kernel modules include modalias matching rules to report which
 hardware they support, and modprobe can be used to list the relevant
diff -ru a/isenkram-lookup.rst b/isenkram-lookup.rst
--- a/isenkram-lookup.rst       2017-09-01 07:48:45.000000000 -0500
+++ b/isenkram-lookup.rst       2025-01-03 00:00:00.000000000 -0600
@@ -29,7 +29,7 @@
 
 You can run this to locate all modalias strings for your machine:
 
-  cat $(find /sys -name modalias) | sort -u
+  find /sys/devices -name modalias -print0 | xargs -0 sort -u
 
 OPTIONS
 =======
diff -ru a/modalias-format.txt b/modalias-format.txt
--- a/modalias-format.txt       2016-12-17 14:09:11.000000000 -0600
+++ b/modalias-format.txt       2025-01-03 00:00:00.000000000 -0600
@@ -11,7 +11,7 @@
 The modalias entries for a given Linux machine can be found using this
 shell script:
 
-  cat $(find /sys/devices -name modalias) | sort -u
+  find /sys/devices -name modalias -print0 | xargs -0 sort -u
 
 The supported modalias globs for a given kernel module can be found
 using modinfo:
@@ -200,9 +200,9 @@
 To check which kernel modules provide support for a given modalias,
 one can use the following shell script:
 
-  for id in $(cat $(find /sys -name modalias)|sort -u); do \
-    echo "$id" ; \
-    /sbin/modprobe --show-depends "$id"|sed 's/^/  /' ; \
+  find /sys/devices -name modalias -print0 | xargs -0 sort -u | while read -r 
id; do
+    echo "$id"
+    /sbin/modprobe --show-depends "$id" | sed 's/^/  /'
   done
 
 The output can look like this (only the first few entries as the list

Reply via email to