* [PATCH/RFC] alsa-info: add DMI data to the alsa-info output
@ 2009-05-31 19:36 Ozan Çağlayan
2009-06-01 9:19 ` Takashi Iwai
2009-06-01 12:28 ` Lennart Poettering
0 siblings, 2 replies; 4+ messages in thread
From: Ozan Çağlayan @ 2009-05-31 19:36 UTC (permalink / raw)
To: alsa-devel, Takashi Iwai
This is a working but not a clean/good patch for doing that because I'm
not very good at shell scripting but I'm posting it just to give a
possible idea.
dmidecode should be run as root because it reads /dev/mem. If alsa-info
is run as root, providing at least the system-manufacturer and
system-product-name in the output will be very useful for distro
maintainers.
Thanks,
Ozan Caglayan
Index: alsa-info.sh
===================================================================
--- alsa-info.sh (revision 69253)
+++ alsa-info.sh (working copy)
@@ -361,6 +361,18 @@
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)
+DMI_SYSTEM_MANUFACTURER="Not provided"
+DMI_SYSTEM_PRODUCT_NAME="Not provided"
+
+if [ -f $DMIDECODE ]; then
+ $DMIDECODE -q &> /dev/null
+ if [ x$? != "x1" ]; then
+ DMI_SYSTEM_MANUFACTURER=$($DMIDECODE -s system-manufacturer)
+ DMI_SYSTEM_PRODUCT_NAME=$($DMIDECODE -s system-product-name)
+ fi
+fi
+
cat /proc/asound/modules 2>/dev/null|awk {'print
$2'}>$TEMPDIR/alsamodules.tmp
cat /proc/asound/cards >$TEMPDIR/alsacards.tmp
lspci |grep -i "multi\|audio">$TEMPDIR/lspci.tmp
@@ -391,6 +403,13 @@
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
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH/RFC] alsa-info: add DMI data to the alsa-info output
2009-05-31 19:36 [PATCH/RFC] alsa-info: add DMI data to the alsa-info output Ozan Çağlayan
@ 2009-06-01 9:19 ` Takashi Iwai
2009-06-01 12:28 ` Lennart Poettering
1 sibling, 0 replies; 4+ messages in thread
From: Takashi Iwai @ 2009-06-01 9:19 UTC (permalink / raw)
To: Ozan Çağlayan; +Cc: alsa-devel
At Sun, 31 May 2009 22:36:37 +0300,
Ozan Çağlayan wrote:
>
> This is a working but not a clean/good patch for doing that because I'm
> not very good at shell scripting but I'm posting it just to give a
> possible idea.
>
> dmidecode should be run as root because it reads /dev/mem. If alsa-info
> is run as root, providing at least the system-manufacturer and
> system-product-name in the output will be very useful for distro
> maintainers.
Yes, the idea is very good.
>
> Thanks,
> Ozan Caglayan
>
> Index: alsa-info.sh
> ===================================================================
> --- alsa-info.sh (revision 69253)
> +++ alsa-info.sh (working copy)
> @@ -361,6 +361,18 @@
> 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)
Redirection of stderr would be needed like the above lines, I guess.
> +DMI_SYSTEM_MANUFACTURER="Not provided"
> +DMI_SYSTEM_PRODUCT_NAME="Not provided"
> +
> +if [ -f $DMIDECODE ]; then
It's safer to use -x in such a case.
> + $DMIDECODE -q &> /dev/null
> + if [ x$? != "x1" ]; then
> + DMI_SYSTEM_MANUFACTURER=$($DMIDECODE -s system-manufacturer)
> + DMI_SYSTEM_PRODUCT_NAME=$($DMIDECODE -s system-product-name)
> + fi
It could be just like below?
DMI_SYSTEM_MANUFACTURER=$($DMIDECODE -s system-manufacturer 2>/dev/null)
DMI_SYSTEM_PRODUCT_NAME=$($DMIDECODE -s system-product-name 2>/devnull)
thanks,
Takashi
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH/RFC] alsa-info: add DMI data to the alsa-info output
2009-05-31 19:36 [PATCH/RFC] alsa-info: add DMI data to the alsa-info output Ozan Çağlayan
2009-06-01 9:19 ` Takashi Iwai
@ 2009-06-01 12:28 ` Lennart Poettering
2009-06-01 13:01 ` Ozan Çağlayan
1 sibling, 1 reply; 4+ messages in thread
From: Lennart Poettering @ 2009-06-01 12:28 UTC (permalink / raw)
To: alsa-devel
On Sun, 31.05.09 22:36, Ozan Çağlayan (ozan@pardus.org.tr) wrote:
> This is a working but not a clean/good patch for doing that because I'm
> not very good at shell scripting but I'm posting it just to give a
> possible idea.
>
> dmidecode should be run as root because it reads /dev/mem. If alsa-info
> is run as root, providing at least the system-manufacturer and
> system-product-name in the output will be very useful for distro
> maintainers.
Please note that this information is exported in sysfs anyway, in
/sys/class/dmi/id/*.
It would be much better to read that data from sysfs since it doesn't
need a kernel with /dev/mem, or root root priviliges or any other
software installed.
Lennart
--
Lennart Poettering Red Hat, Inc.
lennart [at] poettering [dot] net
http://0pointer.net/lennart/ GnuPG 0x1A015CC4
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH/RFC] alsa-info: add DMI data to the alsa-info output
2009-06-01 12:28 ` Lennart Poettering
@ 2009-06-01 13:01 ` Ozan Çağlayan
0 siblings, 0 replies; 4+ messages in thread
From: Ozan Çağlayan @ 2009-06-01 13:01 UTC (permalink / raw)
To: alsa-devel
Lennart Poettering wrote On 01-06-2009 15:28:
>
> Please note that this information is exported in sysfs anyway, in
> /sys/class/dmi/id/*.
>
> It would be much better to read that data from sysfs since it doesn't
> need a kernel with /dev/mem, or root root priviliges or any other
> software installed.
>
That's nice, didn't know about that, will resend the patch, thanks!
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-06-01 12:59 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-31 19:36 [PATCH/RFC] alsa-info: add DMI data to the alsa-info output Ozan Çağlayan
2009-06-01 9:19 ` Takashi Iwai
2009-06-01 12:28 ` Lennart Poettering
2009-06-01 13:01 ` Ozan Çağlayan
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.