wok diff ndiswrapper-driver/stuff/gztazmod.sh @ rev 8178

imported patch toolchain/elfutils.patch
author Antoine Bodin <gokhlayeh@slitaz.org>
date Thu Jan 27 00:20:49 2011 +0100 (2011-01-27)
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/ndiswrapper-driver/stuff/gztazmod.sh	Thu Jan 27 00:20:49 2011 +0100
     1.3 @@ -0,0 +1,64 @@
     1.4 +#!/bin/sh
     1.5 +# gztazmod.sh: Compress Linux kernel modules for SliTaz GNU/Linux.
     1.6 +# 2007/10/04 <pankso@slitaz.org> - GNU General Public License.
     1.7 +#
     1.8 +
     1.9 +# We do our work in the kernel version modules directory.
    1.10 +if [ -z "$1" ] ; then
    1.11 +  echo ""
    1.12 +  echo -e "\033[1musage:\033[0m `basename $0` path/to/kernel-version"
    1.13 +  echo ""
    1.14 +  exit 1
    1.15 +fi
    1.16 +
    1.17 +if [ ! -r "$1" ] ; then
    1.18 +  echo ""
    1.19 +  echo -e "Error : $1 does not exist."
    1.20 +  echo ""
    1.21 +  exit 1
    1.22 +fi
    1.23 +
    1.24 +cd $1
    1.25 +
    1.26 +# Status functions.
    1.27 +status()
    1.28 +{
    1.29 +	local CHECK=$?
    1.30 +	echo -en "\\033[70G[ "
    1.31 +	if [ $CHECK = 0 ]; then
    1.32 +		echo -en "\\033[1;33mOK"
    1.33 +	else
    1.34 +		echo -en "\\033[1;31mFailed"
    1.35 +	fi
    1.36 +	echo -e "\\033[0;39m ]"
    1.37 +}
    1.38 +
    1.39 +# Script start.
    1.40 +echo ""
    1.41 +echo "Starting gztazmod.sh to build compressed kernel modules... "
    1.42 +echo ""
    1.43 +
    1.44 +# Find all modules.
    1.45 +echo -n "Searching all modules to gzip them... "
    1.46 +find . -name "*.ko" -exec gzip '{}' \;
    1.47 +status
    1.48 +
    1.49 +# Build a new temporary modules.dep.
    1.50 +echo -n "Building tmp.dep... "
    1.51 +sed 's/\.ko/.ko.gz/g' modules.dep > tmp.dep
    1.52 +status
    1.53 +
    1.54 +# Destroy original modules.dep
    1.55 +echo -n "Destroying modules.dep... "
    1.56 +rm modules.dep
    1.57 +status
    1.58 +
    1.59 +# Remove tmp.dep to modules.dep.
    1.60 +echo -n "Removing tmp.dep to modules.dep... "
    1.61 +mv tmp.dep modules.dep
    1.62 +status
    1.63 +
    1.64 +# Script end.
    1.65 +echo ""
    1.66 +echo "Kernel modules `basename $1` are ready."
    1.67 +echo ""