diff options
author | root <root@artemis.panaceas.org> | 2015-12-25 15:00:15 +0000 |
---|---|---|
committer | root <root@artemis.panaceas.org> | 2015-12-25 15:00:15 +0000 |
commit | ddd86436f4e3643c04b797f858dab95d5f2e4de9 (patch) | |
tree | bfe7a780cf9a2f4fc33aec32c82e625e79dece1f /scripts/compress_modules.sh | |
download | backports-3.10.19-1-master.tar.gz backports-3.10.19-1-master.tar.bz2 backports-3.10.19-1-master.zip |
Diffstat (limited to 'scripts/compress_modules.sh')
-rwxr-xr-x | scripts/compress_modules.sh | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/scripts/compress_modules.sh b/scripts/compress_modules.sh new file mode 100755 index 0000000..bbf264f --- /dev/null +++ b/scripts/compress_modules.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +set -e + +function mod_filename() +{ + which modinfo > /dev/null 2>&1 + if [[ $? -eq 0 ]]; then + MOD_QUERY="modinfo -F filename" + else + MOD_QUERY="modprobe -l" + fi + mod_path="$($MOD_QUERY $1 | tail -1)" + echo $(basename "$mod_path") +} + +if test "$(mod_filename mac80211)" = "mac80211.ko.gz" ; then + for driver in $(find "$1" -type f -name *.ko); do + gzip -9 $driver + done +fi |