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