Skip to contentSkip to conversation

alsa-info.sh: Provide system manufacturer and product name from DMI

PATCH Applied Ozan Çağlayan 2 participants 4 messages Jun 1, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 alsa-info.sh: Provide system manufacturer and product name from DMI

This commit adds system manufacturer and product name informations acquired using dmidecode to the output of the alsa-info script.

Note that those informations will only be available when dmidecode utility is installed and alsa-info is run with root privileges.

---
 utils/alsa-info.sh |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
utils/alsa-info.sh +13 -0
index f1660f8..4be4e05 100755
@@ -400,6 +400,12 @@ ESDINST=$(which esd 2>/dev/null| sed 's|^[^/]*||' 2>/dev/null)
 PAINST=$(which pulseaudio 2>/dev/null| sed 's|^[^/]*||' 2>/dev/null)
 ARTSINST=$(which artsd 2>/dev/null| sed 's|^[^/]*||' 2>/dev/null)
 JACKINST=$(which jackd 2>/dev/null| sed 's|^[^/]*||' 2>/dev/null)
+DMIDECODE=$(which dmidecode 2>/dev/null| sed 's|^[^/]*||' 2>/dev/null)
+
+if [ -x $DMIDECODE ]; then
+    DMI_SYSTEM_MANUFACTURER=$($DMIDECODE -s system-manufacturer 2>/dev/null)
+    DMI_SYSTEM_PRODUCT_NAME=$($DMIDECODE -s system-product-name 2>/dev/null)
+fi
 
 cat /proc/asound/modules 2>/dev/null|awk {'print $2'}>$TEMPDIR/alsamodules.tmp
 cat /proc/asound/cards >$TEMPDIR/alsacards.tmp
@@ -431,6 +437,13 @@ echo "" >> $FILE
 echo $DISTRO >> $FILE
 echo "" >> $FILE
 echo "" >> $FILE
+echo "!!DMI Information" >> $FILE
+echo "!!---------------" >> $FILE
+echo "" >> $FILE
+echo "Manufacturer:      $DMI_SYSTEM_MANUFACTURER" >> $FILE
+echo "Product Name:      $DMI_SYSTEM_PRODUCT_NAME" >> $FILE
+echo "" >> $FILE
+echo "" >> $FILE
 echo "!!Kernel Information" >> $FILE
 echo "!!------------------" >> $FILE
 echo "" >> $FILE
Signature · 6 lines
1.6.3

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Applied
#1 lore raw

At Mon, 1 Jun 2009 14:25:41 +0300,

Quoted 8 lines · Ozan Çağlayan

This commit adds system manufacturer and product name informations acquired using dmidecode to the output of the alsa-info script.

Note that those informations will only be available when dmidecode utility is installed and alsa-info is run with root privileges.

Thanks, applied now.

Takashi
_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#2 lore raw
Quoted 6 lines · Takashi Iwai

At Mon, 1 Jun 2009 14:25:41 +0300,

Quoted 3 lines · Ozan Çağlayan

This commit adds system manufacturer and product name informations acquired using dmidecode to the output of the alsa-info script.

Quoted 8 lines
Quoted 5 lines

Note that those informations will only be available when dmidecode utility is installed and alsa-info is run with root privileges.

Thanks, applied now.

Lennart proposed to read the DMI data from sysfs which makes much more sense as the patch won't depend on the userspace dmidecode utility and root privileges.

I'll change it and then resend it tomorrow.

Thanks
_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#3 lore raw

At Mon, 01 Jun 2009 23:05:07 +0300,

Quoted 14 lines · Ozan Çağlayan
Quoted 12 lines · Takashi Iwai

At Mon, 1 Jun 2009 14:25:41 +0300,

Quoted 8 lines · Ozan Çağlayan

This commit adds system manufacturer and product name informations acquired using dmidecode to the output of the alsa-info script.

Note that those informations will only be available when dmidecode utility is installed and alsa-info is run with root privileges.

Quoted 6 lines
Quoted 2 lines

Thanks, applied now.

Lennart proposed to read the DMI data from sysfs which makes much more sense as the patch won't depend on the userspace dmidecode utility and root privileges.

Supporting both would be the best, as /sys isn't mandatory.

thanks,

Takashi
_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel