[alsa-devel] [PATCH] 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.
Signed-off-by: Ozan Çağlayan ozan@pardus.org.tr --- utils/alsa-info.sh | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/utils/alsa-info.sh b/utils/alsa-info.sh index f1660f8..4be4e05 100755 --- a/utils/alsa-info.sh +++ b/utils/alsa-info.sh @@ -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
At Mon, 1 Jun 2009 14:25:41 +0300, Ozan Çağlayan wrote:
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.
Signed-off-by: Ozan Çağlayan ozan@pardus.org.tr
Thanks, applied now.
Takashi
Takashi Iwai wrote:
At Mon, 1 Jun 2009 14:25:41 +0300, Ozan Çağlayan wrote:
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.
Signed-off-by: Ozan Çağlayan ozan@pardus.org.tr
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
At Mon, 01 Jun 2009 23:05:07 +0300, Ozan Çağlayan wrote:
Takashi Iwai wrote:
At Mon, 1 Jun 2009 14:25:41 +0300, Ozan Çağlayan wrote:
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.
Signed-off-by: Ozan Çağlayan ozan@pardus.org.tr
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
participants (2)
-
Ozan Çağlayan
-
Takashi Iwai