]> git.alsa-project.org Git - alsa-utils.git/commitdiff
alsa-info: Don't access non-existing module parameters
authorTakashi Iwai <tiwai@suse.de>
Wed, 16 Sep 2026 12:59:32 +0000 (14:59 +0200)
committerTakashi Iwai <tiwai@suse.de>
Wed, 16 Sep 2026 13:19:58 +0000 (15:19 +0200)
Some modules are without any parameters, and there are no "parameters"
subdirectories for such modules.  Since alsa-info.sh tries to access
modules/* files, this results in (non-fatal) errors.

Add the check of the parameters subdirectory before accessing the
actual parameter files for avoiding such errors.

Link: https://bugzilla.suse.com/show_bug.cgi?id=1279431
Signed-off-by: Takashi Iwai <tiwai@suse.de>
alsa-info/alsa-info.sh

index 1628e603fb00269f4c10034128c5ee6f2e0a0153..eac3694dc32b2e9cac82a266f4bee6d2125d593b 100755 (executable)
@@ -664,11 +664,13 @@ if [ -d "$SYSFS" ]; then
        echo "" >> $FILE
        for mod in $(cat /proc/asound/modules | awk '{ print $2 }'); do
                echo "!!Module: $mod" >> $FILE
-               for params in $(echo $SYSFS/module/$mod/parameters/*); do
-                       echo -ne "\t"
-                       value=$(cat $params)
-                       echo "$params : $value" | sed 's:.*/::'
-               done >> $FILE
+               if [ -d "$SYSFS/module/$mod/parameters" ]; then
+                       for params in $(echo $SYSFS/module/$mod/parameters/*); do
+                               echo -ne "\t"
+                               value=$(cat $params)
+                               echo "$params : $value" | sed 's:.*/::'
+                       done >> $FILE
+               fi
                echo "" >> $FILE
        done
        echo "" >> $FILE