wok-next annotate ndiswrapper-driver/stuff/gztazmod.sh @ rev 14509

get-src2pkg: fix pkg name
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue May 14 07:41:25 2013 +0200 (2013-05-14)
parents
children
rev   line source
erjo@1851 1 #!/bin/sh
erjo@1851 2 # gztazmod.sh: Compress Linux kernel modules for SliTaz GNU/Linux.
erjo@1851 3 # 2007/10/04 <pankso@slitaz.org> - GNU General Public License.
erjo@1851 4 #
erjo@1851 5
erjo@1851 6 # We do our work in the kernel version modules directory.
erjo@1851 7 if [ -z "$1" ] ; then
erjo@1851 8 echo ""
erjo@1851 9 echo -e "\033[1musage:\033[0m `basename $0` path/to/kernel-version"
erjo@1851 10 echo ""
erjo@1851 11 exit 1
erjo@1851 12 fi
erjo@1851 13
erjo@1851 14 if [ ! -r "$1" ] ; then
erjo@1851 15 echo ""
erjo@1851 16 echo -e "Error : $1 does not exist."
erjo@1851 17 echo ""
erjo@1851 18 exit 1
erjo@1851 19 fi
erjo@1851 20
erjo@1851 21 cd $1
erjo@1851 22
erjo@1851 23 # Status functions.
erjo@1851 24 status()
erjo@1851 25 {
erjo@1851 26 local CHECK=$?
erjo@1851 27 echo -en "\\033[70G[ "
erjo@1851 28 if [ $CHECK = 0 ]; then
erjo@1851 29 echo -en "\\033[1;33mOK"
erjo@1851 30 else
erjo@1851 31 echo -en "\\033[1;31mFailed"
erjo@1851 32 fi
erjo@1851 33 echo -e "\\033[0;39m ]"
erjo@1851 34 }
erjo@1851 35
erjo@1851 36 # Script start.
erjo@1851 37 echo ""
erjo@1851 38 echo "Starting gztazmod.sh to build compressed kernel modules... "
erjo@1851 39 echo ""
erjo@1851 40
erjo@1851 41 # Find all modules.
erjo@1851 42 echo -n "Searching all modules to gzip them... "
erjo@1851 43 find . -name "*.ko" -exec gzip '{}' \;
erjo@1851 44 status
erjo@1851 45
erjo@1851 46 # Build a new temporary modules.dep.
erjo@1851 47 echo -n "Building tmp.dep... "
erjo@1851 48 sed 's/\.ko/.ko.gz/g' modules.dep > tmp.dep
erjo@1851 49 status
erjo@1851 50
erjo@1851 51 # Destroy original modules.dep
erjo@1851 52 echo -n "Destroying modules.dep... "
erjo@1851 53 rm modules.dep
erjo@1851 54 status
erjo@1851 55
erjo@1851 56 # Remove tmp.dep to modules.dep.
erjo@1851 57 echo -n "Removing tmp.dep to modules.dep... "
erjo@1851 58 mv tmp.dep modules.dep
erjo@1851 59 status
erjo@1851 60
erjo@1851 61 # Script end.
erjo@1851 62 echo ""
erjo@1851 63 echo "Kernel modules `basename $1` are ready."
erjo@1851 64 echo ""