summaryrefslogtreecommitdiff
path: root/sysutils/dmesg2gif
diff options
context:
space:
mode:
authorhubertf <hubertf>2003-10-20 00:31:29 +0000
committerhubertf <hubertf>2003-10-20 00:31:29 +0000
commitac61b935a17408c8c6323fd5001105b06eecbe72 (patch)
tree30705e5312ce97c2abe10fe99529f71c59c46afd /sysutils/dmesg2gif
parent154cd0e842f5ccf233c6be17d2f5390ba94dca5f (diff)
downloadpkgsrc-ac61b935a17408c8c6323fd5001105b06eecbe72.tar.gz
Import dmesg2gif-1.0: Output dmesg(8) device tree as GIF graph
Read dmesg(8) output (e.g. from /var/run/dmesg.boot), and output the device tree as GIF image to stdout. Usage: cat /var/run/dmesg.boot | /usr/pkg/bin/dmesg2gif | xv -
Diffstat (limited to 'sysutils/dmesg2gif')
-rw-r--r--sysutils/dmesg2gif/DESCR4
-rw-r--r--sysutils/dmesg2gif/Makefile25
-rw-r--r--sysutils/dmesg2gif/PLIST2
-rw-r--r--sysutils/dmesg2gif/files/dmesg2gif32
4 files changed, 63 insertions, 0 deletions
diff --git a/sysutils/dmesg2gif/DESCR b/sysutils/dmesg2gif/DESCR
new file mode 100644
index 00000000000..894f0403871
--- /dev/null
+++ b/sysutils/dmesg2gif/DESCR
@@ -0,0 +1,4 @@
+Read dmesg(8) output (e.g. from /var/run/dmesg.boot), and output the
+device tree as GIF image to stdout.
+
+Usage: cat /var/run/dmesg.boot | /usr/pkg/bin/dmesg2gif | xv -
diff --git a/sysutils/dmesg2gif/Makefile b/sysutils/dmesg2gif/Makefile
new file mode 100644
index 00000000000..552e9de2c38
--- /dev/null
+++ b/sysutils/dmesg2gif/Makefile
@@ -0,0 +1,25 @@
+# $NetBSD: Makefile,v 1.1.1.1 2003/10/20 00:31:29 hubertf Exp $
+#
+
+DISTNAME= dmesg2gif-1.0
+WRKSRC= ${WRKDIR}
+CATEGORIES= sysutils
+MASTER_SITES= # empty
+DISTFILES= # empty
+
+MAINTAINER= hubertf@NetBSD.org
+COMMENT= Output dmesg(8) device tree as GIF graph
+
+USE_PKGINSTALL= YES
+
+DEPENDS+= graphviz-[0-9]*:.../../graphics/graphviz
+
+EXTRACT_ONLY= # empty
+NO_CHECKSUM= yes
+NO_CONFIGURE= yes
+NO_BUILD= yes
+
+do-install:
+ ${INSTALL_SCRIPT} ${FILESDIR}/dmesg2gif ${PREFIX}/bin/dmesg2gif
+
+.include "../../mk/bsd.pkg.mk"
diff --git a/sysutils/dmesg2gif/PLIST b/sysutils/dmesg2gif/PLIST
new file mode 100644
index 00000000000..db8c9e80d8e
--- /dev/null
+++ b/sysutils/dmesg2gif/PLIST
@@ -0,0 +1,2 @@
+@comment $NetBSD: PLIST,v 1.1.1.1 2003/10/20 00:31:29 hubertf Exp $
+bin/dmesg2gif
diff --git a/sysutils/dmesg2gif/files/dmesg2gif b/sysutils/dmesg2gif/files/dmesg2gif
new file mode 100644
index 00000000000..db56586c8b4
--- /dev/null
+++ b/sysutils/dmesg2gif/files/dmesg2gif
@@ -0,0 +1,32 @@
+#!/bin/sh
+#
+# Copyright (c) 2003 Hubert Feyrer <hubertf@netbsd.org>
+#
+
+tmp=/tmp/dmesg2gif.$$
+
+if [ -t 0 -o -t 1 ]
+then
+ echo 2>&1 "Usage: cat /var/run/dmesg.boot | $0 | xv -"
+ exit 1
+fi
+
+if ! pkg_info -qe graphviz >/dev/null
+then
+ echo 2>&1 "Please install pkgsrc/graphics/graphviz for dot!"
+ exit 1
+fi
+
+(
+ echo "digraph dmesg { "
+ cat \
+ | grep -v ^# \
+ | perl -ne 'if(/^(\S*) at (\S*) *.*/){
+ $from=$1;
+ $to=$2;
+ $to=~s/://;
+ print "\t$from -> $to\n";
+ }'
+ echo "}"
+) > $tmp.dot
+dot -Tgif $tmp.dot