# HG changeset patch # User Dominique Corbex # Date 1245138401 -7200 # Node ID bc0a71a7371edb695c5da780bd440297e6d97932 # Parent 2b328ebaa02014bf927f4c16a98ee26c3fb3194a get-softmodem-driver: add get-hcfpcimodem-driver diff -r 2b328ebaa020 -r bc0a71a7371e get-softmodem-driver/receipt --- a/get-softmodem-driver/receipt Tue Jun 16 09:22:41 2009 +0200 +++ b/get-softmodem-driver/receipt Tue Jun 16 09:46:41 2009 +0200 @@ -1,7 +1,7 @@ # SliTaz package receipt. PACKAGE="get-softmodem-driver" -VERSION="0.4" +VERSION="0.5" CATEGORY="non-free" SHORT_DESC="Get misc softmodem drivers." MAINTAINER="domcox@slitaz.org" @@ -13,7 +13,7 @@ { mkdir -p $fs/usr/bin cp stuff/$PACKAGE $fs/usr/bin - for i in hsfmodem; do + for i in hsfmodem hcfpcimodem; do ln -s $PACKAGE $fs/usr/bin/get-$i-driver done mkdir -p $fs/usr/share/softmodem diff -r 2b328ebaa020 -r bc0a71a7371e get-softmodem-driver/stuff/get-hcfpcimodem-driver --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/get-softmodem-driver/stuff/get-hcfpcimodem-driver Tue Jun 16 09:46:41 2009 +0200 @@ -0,0 +1,1 @@ +get-softmodem-driver \ No newline at end of file diff -r 2b328ebaa020 -r bc0a71a7371e get-softmodem-driver/stuff/get-softmodem-driver --- a/get-softmodem-driver/stuff/get-softmodem-driver Tue Jun 16 09:22:41 2009 +0200 +++ b/get-softmodem-driver/stuff/get-softmodem-driver Tue Jun 16 09:46:41 2009 +0200 @@ -9,6 +9,9 @@ hsfmodem) . /usr/share/softmodem/hsfmodem.receipt ;; +hcfpcimodem) + . /usr/share/softmodem/hcfpcimodem.receipt + ;; *) echo "Unknown modem driver. Please run one of the following commands:" for i in $(cd $(dirname $0); ls get-*-driver); do [ -L $i ] || continue @@ -58,7 +61,7 @@ *rpm) rpm2cpio < $(basename $WGET_URL) | cpio -id;; *deb) dpkg-deb -x $(basename $WGET_URL) . ;; *bz2) tar xjf $(basename $WGET_URL) ;; -*tar.gz|*tgz) tar xzf $(basename $WGET_URL) ;; +*tar.gz|*tgz) tar xzf $(basename $WGET_URL) || exit 1 ;; *zip) unzip $(basename $WGET_URL);; *o) ;; esac @@ -88,11 +91,28 @@ mkdir -p $fs/usr/src mv $src $fs/usr/src ;; +hcfpcimodem) + # Rules to configure and make the package. + cd $src + echo "Apply $file..." + patch -p1 < /usr/share/softmodem/$PACKAGE-$VERSION.diff || exit 1 + # Build + make all + make ROOT=$fs install + make clean + # Data for automatic region setting + mkdir -p $fs/usr/share/softmodem + cp -a /usr/share/softmodem/zone.tab $fs/usr/share/softmodem/hcfpcizone.tab + # src is needed + cd $taz + mkdir -p $fs/usr/src + mv $src $fs/usr/src + ;; esac # Create receipt cd $taz -cat /usr/share/softmodem/hsfmodem.receipt> $PACKAGE-$VERSION/receipt +cat /usr/share/softmodem/$PACKAGE.receipt> $PACKAGE-$VERSION/receipt # Pack tazpkg pack $PACKAGE-$VERSION diff -r 2b328ebaa020 -r bc0a71a7371e get-softmodem-driver/stuff/hcfpcimodem-1.19full.diff --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/get-softmodem-driver/stuff/hcfpcimodem-1.19full.diff Tue Jun 16 09:46:41 2009 +0200 @@ -0,0 +1,169 @@ +diff -ru hcfpcimodem-1.19full/config.mak hcfpcimodem-1.19full-slitaz/config.mak +--- hcfpcimodem-1.19full/config.mak 2009-04-29 22:04:22.000000000 +0200 ++++ hcfpcimodem-1.19full-slitaz/config.mak 2009-06-15 22:17:05.000000000 +0200 +@@ -131,4 +131,4 @@ + -e "s!@SCR_SUPPORT@!`test ! \"$(IMPORTED_SCR_SUPPORT)\" = yes; echo $$?`!g" \ + -e "s!@DMP_SUPPORT@!`test -z \"$(IMPORTED_DMP_SUPPORT)\"; echo $$?`!g" \ + < $< > $@ +- chmod --reference=$< $@ ++ chmod 755 $@ +diff -ru hcfpcimodem-1.19full/makefile hcfpcimodem-1.19full-slitaz/makefile +--- hcfpcimodem-1.19full/makefile 2009-04-29 22:04:22.000000000 +0200 ++++ hcfpcimodem-1.19full-slitaz/makefile 2009-06-15 22:17:47.000000000 +0200 +@@ -149,7 +149,7 @@ + ifeq ($(RPMOPTEVAL),yes) + RPMTARGETCPU=$(shell rpm --eval '%_target_cpu') + else +-RPMTARGETCPU=$(shell uname -i) ++RPMTARGETCPU=$(shell uname -m) + endif + + ifneq ($(RPMOPTDEFINE),yes) +diff -ru hcfpcimodem-1.19full/modules/Makefile hcfpcimodem-1.19full-slitaz/modules/Makefile +--- hcfpcimodem-1.19full/modules/Makefile 2009-04-29 22:04:22.000000000 +0200 ++++ hcfpcimodem-1.19full-slitaz/modules/Makefile 2009-06-15 22:19:01.000000000 +0200 +@@ -20,7 +20,7 @@ + include $(TOP)/config.mak + + IMPORTED = $(TOP)/modules/imported +-MACHINE_ARCH := $(shell if uname --hardware-platform >/dev/null 2>&1 && ! uname --hardware-platform | grep -q "unknown"; then uname --hardware-platform; else uname --machine | sed 's/^i.86$$/i386/'; fi) ++MACHINE_ARCH := $(shell if uname -p >/dev/null 2>&1 && ! uname -p | grep -q "unknown"; then uname -p; else uname -m | sed 's/^i.86$$/i386/'; fi) + ifneq ($(subst powerpc,ppc,$(IMPORTED_ARCH)),$(MACHINE_ARCH)) + $(warning *** WARNING: Trying to compile kernel modules on a $(MACHINE_ARCH) system while the installed $(CNXTTARGET) driver package is for $(IMPORTED_ARCH), this is likely to fail... ***) + endif +diff -ru hcfpcimodem-1.19full/scripts/cnxtconfig.in hcfpcimodem-1.19full-slitaz/scripts/cnxtconfig.in +--- hcfpcimodem-1.19full/scripts/cnxtconfig.in 2009-04-29 22:04:22.000000000 +0200 ++++ hcfpcimodem-1.19full-slitaz/scripts/cnxtconfig.in 2009-06-16 09:32:18.000000000 +0200 +@@ -74,7 +74,7 @@ + answer="${region}" + ;; + *) +- answer="`echo \"${answer}\" | tr '[a-z ]' '[A-Z_]'`" ++ answer="`echo \"${answer}\" | tr '[a-z]' '[A-Z]' | sed 's/\s/_/g'`" + ;; + esac + fi +@@ -109,15 +109,13 @@ + { + # Try to guess what region we're in, using the timezone settings + +- localtime_size="`/bin/ls -lL /etc/localtime 2>/dev/null | ${AWK} '{print $5}'`" +- +- if ! [ ${localtime_size} -gt 0 ]; then ++ if [ ! -e /etc/TZ ]; then + return 1 + fi + +- zoneinfo_dir=/usr/share/zoneinfo ++ zoneinfo_dir=/usr/share/softmodem + +- if [ ! -d ${zoneinfo_dir} -o ! -f ${zoneinfo_dir}/zone.tab ]; then ++ if [ -f ${zoneinfo_dir}/hcfpcizone.tab ]; then + return 1 + fi + +@@ -206,17 +204,9 @@ + iso_VN=00BC # VIETNAM + + ( +- cd ${zoneinfo_dir} 2>/dev/null || return 1 +- find . -type f -size "${localtime_size}"c -print | sed 's@^\./@@' | \ +- while read file; do +- cmp -s /etc/localtime $file || continue +-# in the egrep and sed regular expressions below, it is very important to +-# have tabs, not spaces +- egrep " $file( .*|\$)" ${zoneinfo_dir}/zone.tab +- done | sed -n '/^[^#]/s/ .*//p' | sort | uniq | \ +- while read code; do +- eval "echo \${iso_${code}}" +- done | sort | uniq ++ zone=`cat /etc/TZ` ++ code=`grep $zone ${zoneinfo_dir}/hcfpcizone.tab | awk '{print $1}' | sort | uniq` ++ eval "echo \${iso_${code}}" + return 0 + ) + } +@@ -271,7 +261,7 @@ + # The md5sum is used for input verification. + disptokey() + { +- k="`echo \"$1\" | tr '[a-z]' '[A-Z]' | sed 's/FREE/00000000/' | tr -d -c '[0-9A-F\012]'`" ++ k="`echo \"$1\" | tr '[a-z]' '[A-Z]' | sed 's/FREE/00000000/' | tr -d -c '[0-9][A-F][\012]'`" + case $k in + 00000000) + echo "$k" +@@ -1655,7 +1645,7 @@ + update-modules + else + if ("$@" "${modulesconf}" | "${filter}"; cat ${f}) > ${modulesconf}.$$; then +- if ! cmp --silent ${modulesconf}.$$ ${modulesconf}; then ++ if ! cmp -s ${modulesconf}.$$ ${modulesconf}; then + if ! cp ${modulesconf}.$$ ${modulesconf}; then + rm -f ${modulesconf}.$$ ${f} + exit 1 +@@ -1681,7 +1671,7 @@ + fi + + if ("$@" "${modprobeconf}" | "${filter}"; cat ${f}) > ${modprobeconf}.$$; then +- if ! cmp --silent ${modprobeconf}.$$ ${modprobeconf}; then ++ if ! cmp -s ${modprobeconf}.$$ ${modprobeconf}; then + if ! cp ${modprobeconf}.$$ ${modprobeconf}; then + rm -f ${modprobeconf}.$$ ${f} + exit 1 +@@ -2214,6 +2204,10 @@ + elif [ -d /var/lib/LST ]; then + OSDISTNAME=Caldera + OSDISTIDNT=caldera ++ elif [ -f /etc/slitaz-release ]; then ++ OSDISTNAME=SliTaz ++ OSDISTIDNT=slitaz ++ OSDISTVERS="`cat /etc/slitaz-release`" + fi + + OSKERNNAME="`uname -s | tr '[A-Z]' '[a-z]'`" +@@ -2268,7 +2262,7 @@ + + dump_file() + { +- dump_cmd cat -v $@ ++ dump_cmd cat $@ + } + + dump_diagnostics() +@@ -2587,7 +2581,7 @@ + fi + units="${specificunit}" + if [ -z "${units}" ]; then +- units=`ls --ignore=flush_nvm ${procdrvdir}` ++ units=`ls ${procdrvdir} | grep -v flush_nvm` + + if [ -z "${units}" ]; then + echo "" +@@ -2884,7 +2878,7 @@ + explicitopt=true + do_cfgregion=true + if [ -n "$2" ]; then +- setregion="`echo \"$2\" | tr '[a-z ]' '[A-Z_]'`" ++ setregion="`echo \"$2\" | tr '[a-z]' '[A-Z]' | sed 's/\s/_/g'`" + fi + shift 2 + ;; +@@ -2954,7 +2948,7 @@ + + # Accept --region as equivalent to --region= + if ${do_cfgregion} && [ $# -ge 1 -a -z "${setregion}" ]; then +- setregion="`echo \"$1\" | tr '[a-z ]' '[A-Z_]'`" ++ setregion="`echo \"$1\" | tr '[a-z]' '[A-Z]' | sed 's/\s/_/s'`" + shift + fi + +@@ -3033,7 +3027,7 @@ + + if ${do_cfgnewinstance}; then + if [ ! -d "${cnxtnvmdir}/dynamic/${newinstance}" ]; then +- mkdir --mode=700 --parents "${cnxtnvmdir}/dynamic/${newinstance}" || exit $? ++ mkdir -m 700 -p "${cnxtnvmdir}/dynamic/${newinstance}" || exit $? + # The purpose of --info here is to ensure module reload: + (sleep 2; exec @CNXTTARGET@config --auto --region=AUTO --info) /dev/null 2>&1 & + fi + diff -r 2b328ebaa020 -r bc0a71a7371e get-softmodem-driver/stuff/hcfpcimodem.receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/get-softmodem-driver/stuff/hcfpcimodem.receipt Tue Jun 16 09:46:41 2009 +0200 @@ -0,0 +1,18 @@ +# SliTaz package receipt. + +PACKAGE="hcfpcimodem" +VERSION="1.19full" +CATEGORY="non-free" +SHORT_DESC="Modem driver for Conexant HCF PCI chipsets." +MAINTAINER="domcox@slitaz.org" +TARBALL="$PACKAGE-$VERSION.tar.gz" +DEPENDS="module-init-tools linux-source" +WEB_SITE="http://www.linuxant.com/drivers" +WGET_URL="http://www.linuxant.com/drivers/hcf/full/archive/$PACKAGE-$VERSION/$TARBALL" + +# Rules to gen a SliTaz package suitable for Tazpkg. + +post_install() +{ + /usr/sbin/hcfpciconfig --auto +}