wok diff get-ipw2100-firmware/stuff/get-ipw2100-firmware @ rev 1713

get-*: add ROOT support
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon Nov 17 08:50:02 2008 +0000 (2008-11-17)
parents c56a51e96041
children
line diff
     1.1 --- a/get-ipw2100-firmware/stuff/get-ipw2100-firmware	Wed Jul 23 19:14:41 2008 +0200
     1.2 +++ b/get-ipw2100-firmware/stuff/get-ipw2100-firmware	Mon Nov 17 08:50:02 2008 +0000
     1.3 @@ -7,6 +7,7 @@
     1.4  WEB_SITE="http://$MODULE.sourceforge.net/"
     1.5  RPM=$PKG-$VERSION.noarch.rpm
     1.6  WGET_URL="http://dl.atrpms.net/all/$RPM"
     1.7 +ROOT="$1"
     1.8  
     1.9  # Check if user is root to install.
    1.10  if test $(id -u) != 0 ; then
    1.11 @@ -16,19 +17,11 @@
    1.12  fi
    1.13  
    1.14  # Avoid reinstall
    1.15 -if [ -d /var/lib/tazpkg/installed/$PKG ]; then
    1.16 +if [ -d $ROOT/var/lib/tazpkg/installed/$PKG ]; then
    1.17  	echo -e "\n$PKG package is already installed.\n"
    1.18  	exit 0
    1.19  fi
    1.20  
    1.21 -# We need drivers and tools.
    1.22 -for pkg in linux-wireless wireless_tools
    1.23 -do
    1.24 -        if [ ! -d /var/lib/tazpkg/installed/$pkg ]; then
    1.25 -		tazpkg get-install $pkg
    1.26 -	fi
    1.27 -done
    1.28 -
    1.29  # Get files
    1.30  TMP=/tmp/$(basename $0)$$
    1.31  mkdir $TMP
    1.32 @@ -49,24 +42,27 @@
    1.33  CATEGORY="non-free"
    1.34  SHORT_DESC="$SHORT_DESC."
    1.35  WEB_SITE="$WEB_SITE"
    1.36 +DEPENDS="linux-wireless wireless_tools"
    1.37  EOT
    1.38  
    1.39  # Pack
    1.40  tazpkg pack $PKG-$VERSION
    1.41  
    1.42  # Install pseudo package
    1.43 -tazpkg install $PKG-$VERSION.tazpkg
    1.44 +tazpkg install $PKG-$VERSION.tazpkg --root=$ROOT
    1.45  
    1.46  # Clean
    1.47  cd $TOP
    1.48  rm -rf $TMP
    1.49  
    1.50  # Load module
    1.51 -echo "Loading module: $MODULE..."
    1.52 -modprobe $MODULE
    1.53 -sleep 1
    1.54 +if [ -z "$ROOT" ]; then
    1.55 +	echo "Loading module: $MODULE..."
    1.56 +	modprobe $MODULE
    1.57 +	sleep 1
    1.58 +fi
    1.59  
    1.60  # Configure /etc/network.conf and start connexion
    1.61 -sed -i s/'WIFI="no"'/'WIFI="yes"'/ /etc/network.conf
    1.62 -/etc/init.d/network.sh restart
    1.63 +sed -i s/'WIFI="no"'/'WIFI="yes"'/ $ROOT/etc/network.conf
    1.64 +[ -z "$ROOT" ] && /etc/init.d/network.sh restart
    1.65