summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2008-02-28 12:09:43 -0800
committerStephen Hemminger <stephen.hemminger@vyatta.com>2008-02-28 12:09:43 -0800
commitfb828c7cf89d964482f1812eec0acd33708b8e0c (patch)
tree6e305d38851c21f2faebc2f57e7bbda3ba2a003a
parentc9d801042d0749c921c7c0f3232df796034889e3 (diff)
downloadvyatta-op-fb828c7cf89d964482f1812eec0acd33708b8e0c.tar.gz
vyatta-op-fb828c7cf89d964482f1812eec0acd33708b8e0c.zip
use sysfs rather dmidecode to look at hardware information
Bugfix: 2896 dmidecode requires sudo access, but using /sys/class/dmi/id/* does not.
-rw-r--r--Makefile.am1
-rw-r--r--debian/vyatta-op.postinst.in1
-rw-r--r--debian/vyatta-op.postrm.in1
-rwxr-xr-xscripts/vyatta-show-dmi15
-rw-r--r--templates/show/hardware/dmi/node.def2
5 files changed, 17 insertions, 3 deletions
diff --git a/Makefile.am b/Makefile.am
index 78096a6..2333bb9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -20,6 +20,7 @@ bin_SCRIPTS += scripts/vyatta-show-log-all
bin_SCRIPTS += scripts/vyatta-show-log-file
bin_SCRIPTS += scripts/vyatta-show-dmesg
bin_SCRIPTS += scripts/vyatta-show-dmesg-all
+bin_SCRIPTS += scripts/vyatta-show-dmi
bin_sudo_users_SCRIPTS = scripts/vyatta-identify-interface.pl
diff --git a/debian/vyatta-op.postinst.in b/debian/vyatta-op.postinst.in
index ac650fc..5b47eaa 100644
--- a/debian/vyatta-op.postinst.in
+++ b/debian/vyatta-op.postinst.in
@@ -6,7 +6,6 @@ bindir=@bindir@
# add symlinks for sudo
ln -sf /usr/sbin/ethtool ${bindir}/sudo-users/ethtool
-ln -sf /usr/sbin/dmidecode ${bindir}/sudo-users/dmidecode
ln -sf /sbin/iptables ${bindir}/sudo-users/iptables
ln -sf /bin/ip ${bindir}/sudo-users/ip
ln -sf /opt/vyatta/bin/vyatta-show-interfaces.pl ${bindir}/sudo-users/vyatta-show-interfaces.pl
diff --git a/debian/vyatta-op.postrm.in b/debian/vyatta-op.postrm.in
index f86a7ba..8d34999 100644
--- a/debian/vyatta-op.postrm.in
+++ b/debian/vyatta-op.postrm.in
@@ -7,7 +7,6 @@ bindir=@bindir@
if [ "$1" = "purge" ]; then
# remove added symlinks
rm -f ${bindir}/sudo-users/ethtool
- rm -f ${bindir}/sudo-users/dmidecode
rm -f ${bindir}/sudo-users/iptables
fi
diff --git a/scripts/vyatta-show-dmi b/scripts/vyatta-show-dmi
new file mode 100755
index 0000000..38233e7
--- /dev/null
+++ b/scripts/vyatta-show-dmi
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+if [ ! -d /sys/class/dmi ]; then
+ echo "DMI information not available"
+ exit 1
+fi
+
+for var in /sys/class/dmi/id/*
+do
+ tag=$(basename $var)
+ if [ -f $var -a -r $var -a $tag != uevent -a $tag != modalias ]; then
+ echo -n "$tag: "
+ cat $var
+ fi
+done
diff --git a/templates/show/hardware/dmi/node.def b/templates/show/hardware/dmi/node.def
index 48db2cb..897c9ec 100644
--- a/templates/show/hardware/dmi/node.def
+++ b/templates/show/hardware/dmi/node.def
@@ -1,2 +1,2 @@
help: Show system DMI details
-run: sudo dmidecode
+run: ${vyatta_bindir}/vyatta-show-dmi