diff options
author | FreeArtMan <dos21h@gmail.com> | 2021-05-28 09:23:32 +0100 |
---|---|---|
committer | FreeArtMan <dos21h@gmail.com> | 2021-05-28 09:23:32 +0100 |
commit | 0ab4ab1ef46d6696243ce5a57a4008eebfde1b20 (patch) | |
tree | fc539fcc5061aa682c35a8077f80dbc2168005fa /md/writeup/openwrt_dependency_graph_drawing.md | |
parent | efa24b220d9633d5d7bfef632b33df180dcb0e74 (diff) | |
download | md-content-0ab4ab1ef46d6696243ce5a57a4008eebfde1b20.tar.gz md-content-0ab4ab1ef46d6696243ce5a57a4008eebfde1b20.zip |
Update last articles
Diffstat (limited to 'md/writeup/openwrt_dependency_graph_drawing.md')
-rw-r--r-- | md/writeup/openwrt_dependency_graph_drawing.md | 106 |
1 files changed, 106 insertions, 0 deletions
diff --git a/md/writeup/openwrt_dependency_graph_drawing.md b/md/writeup/openwrt_dependency_graph_drawing.md new file mode 100644 index 0000000..49a5b80 --- /dev/null +++ b/md/writeup/openwrt_dependency_graph_drawing.md @@ -0,0 +1,106 @@ +title:OpenWRT dependency graph drawing +keywords:openwrt + +# OpenWRT dependency graph drawing +Here is script that show package compiled package dependencies of +OpenWrt packages. Script reads compiled packages dependencies and +generates GraphViz files and draws graph of all packaged dependencies. +This graph can be used to see how to remove unesesseray dependencies. +Practicaly this script was used to see how overall all system is +designed and if there is some circular dependencies. After there where +removed unnesesarry dependencies generated graph was used to see overall +system design. + + +*.ipk files are tar.gz archives and can be renamed as *.tar.gz and +opened with GUI or in terminal: + +``` +tar -xvf package.ipg +``` + +Structure of ipkg files is: + + +debian-binary - version +\data.tar.gz - here is all rootfs data files +\control.tar.gz + control - package info here is dependencies and package name. + +Here tree based on OpenWRT git commit of 24 May 2013 + +How to use script, first parametr of script is directory where is all +OpenWrt package files usualy it is under + +``` +openwrt-trunk/ + bin/ + platform-name/ + packages/ +``` + + +To use type + +``` +deptree.py system-path/openwrt-trunk/bin/platform-name/packages +``` + + +Output files comes in same directory where script where lunched +generated file name is: + +``` +deptree.dot +``` + +now convert dot file to pdf, psd, png: + + +``` +dot -Tps $(NAME).dot -o graph1.ps +dot -Tpdf $(NAME).dot -o graph1.pdf +dot -Tpng $(NAME).dot -o graph1.png +``` + + +All OpenWRT was default selected for default platform there is about +~152 of them the generated totaly 325 dependencies image + + +There where removed only one level deep dependencies there was +185 of then after first level deep dependencies where removed generated +image is little bit cleaner + + +Rules with dependecies where removed: + +``` +if (A depends on [B,C] and B depends on [C]) and + there is (edges A->B->C and A->C) then + dependency C can be removed from A +``` + + +## TODO: + +add more sophisticated graph algorith +add to remove more dependencies + + + + +## Links +https://openwrt.org/ +http://www.python.org/ +http://www.graphviz.org/ +http://en.wikipedia.org/wiki/Dependency_graph + +## Downloads +openwrt_dep_tree.tar.gz - +2KiB - http://archive.main.lv/files/writeup/openwrt_dependency_graph_drawing/openwrt_dep_tree.tar.gz + +## Images +<a href=/img/openwrt_dependency_graph_drawing/graph1.png width="250"><img src="/img/openwrt_dependency_graph_drawing/graph1.png" style="width:40%" alt="nprove router"></a> + +<a href=/img/openwrt_dependency_graph_drawing/graph1.png width="250"><img src="/img/openwrt_dependency_graph_drawing/graph1.png" style="width:40%" alt="nprove router"></a> |