summaryrefslogtreecommitdiff
path: root/modutils/depmod_process.sh
diff options
context:
space:
mode:
authorDenys Vlasenko2009-05-18 13:08:04 +0200
committerDenys Vlasenko2009-05-18 13:08:04 +0200
commit16bda3bd1f8e486ed93f5182fc777be1e813bce7 (patch)
treebf6571888d13007e3e51664b9e9eba9346bb7838 /modutils/depmod_process.sh
parentc396fe6306f9a769d3a91809eb03361640c2f2fc (diff)
downloadbusybox-16bda3bd1f8e486ed93f5182fc777be1e813bce7.zip
busybox-16bda3bd1f8e486ed93f5182fc777be1e813bce7.tar.gz
depmod: fix handling of .gz modules
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'modutils/depmod_process.sh')
-rwxr-xr-xmodutils/depmod_process.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/modutils/depmod_process.sh b/modutils/depmod_process.sh
new file mode 100755
index 0000000..f99b091
--- /dev/null
+++ b/modutils/depmod_process.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+# Depmod output may be hard to diff.
+# This script sorts dependencies within "xx.ko: yy.ko zz.ko" lines,
+# and sorts all lines too.
+# Usage:
+#
+# [./busybox] depmod -n | ./depmod_process.sh | sort >OUTFILE
+#
+# and then you can diff OUTFILEs. Useful for comparing bbox depmod
+# with module-init-tools depmod and such.
+
+while read -r word rest; do
+ if ! test "${word/*:/}"; then
+ echo -n "$word "
+ echo "$rest" | xargs -n1 | sort | xargs
+ else
+ echo "$word $rest";
+ fi
+done