depmod_process.sh 491 B

1234567891011121314151617181920
  1. #!/bin/sh
  2. # Depmod output may be hard to diff.
  3. # This script sorts dependencies within "xx.ko: yy.ko zz.ko" lines,
  4. # and sorts all lines too.
  5. # Usage:
  6. #
  7. # [./busybox] depmod -n | ./depmod_process.sh | sort >OUTFILE
  8. #
  9. # and then you can diff OUTFILEs. Useful for comparing bbox depmod
  10. # with module-init-tools depmod and such.
  11. while read -r word rest; do
  12. if ! test "${word/*:/}"; then
  13. echo -n "$word "
  14. echo "$rest" | xargs -n1 | sort | xargs
  15. else
  16. echo "$word $rest";
  17. fi
  18. done