1 -- display the kernel module dependencies
3 -- author: John Ellson <ellson@research.att.com>
4 -- modified: Herbert Leuwer <herbert.leuwer@gmx.de>
6 local gr
= require
"graph"
8 local modules
= io
.lines('/proc/modules')
10 local g
= gr
.open("G")
27 fontname
= "helvetica"
35 -- Run through the modules database
36 -- and build nodes and edges
39 for mod, usedbylist
in string.gfind(rec
, "([_%w]+) %w+ %w+ ([-,_%w]+)") do
41 for usedby
in string.gfind(usedbylist
, "([-_%w]+)") do
42 if (usedby
~= '-') and (usedby
~= '') then
43 n
:edge(g
:node(usedby
))
51 g
:render('png', "out.png")