From 1ef3da82c93c5032ee628b3a85c31ea6db0c25e1 Mon Sep 17 00:00:00 2001 From: Petter Reinholdtsen Date: Tue, 15 Jan 2013 13:38:47 +0000 Subject: [PATCH] Update. --- blog/data/2013-01-14-hw-autoinstall-modalias.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/blog/data/2013-01-14-hw-autoinstall-modalias.txt b/blog/data/2013-01-14-hw-autoinstall-modalias.txt index 986eafec5b..1478c83d89 100644 --- a/blog/data/2013-01-14-hw-autoinstall-modalias.txt +++ b/blog/data/2013-01-14-hw-autoinstall-modalias.txt @@ -23,7 +23,7 @@ values stands for. It is in part based on information from this shell script:

-cat $(find /sys -name modalias) | sort -u
+find /sys -name modalias -print0 | xargs -0 cat | sort -u
 

The supported modalias globs for a given kernel module can be found @@ -215,7 +215,7 @@ hardware to packages when new stuff is inserted during run time.

one can use the following shell script:

-  for id in $(cat $(find /sys -name modalias)|sort -u); do \
+  for id in $(find /sys -name modalias -print0 | xargs -0 cat | sort -u); do \
     echo "$id" ; \
     /sbin/modprobe --show-depends "$id"|sed 's/^/  /' ; \
   done
@@ -245,3 +245,7 @@ list is very long on my test machine):

packages to install when new hardware is plugged into a Debian machine, please send me an email or talk to me on #debian-devel.

+ +

Update 2013-01-15: Rewrite "cat $(find ...)" to +"find ... -print0 | xargs -0 cat" to make sure it handle directories +in /sys/ with space in them.

-- 2.47.2