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