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