From e9ad4a5a9573f0157c1d0b6e32496fa623aacb81 Mon Sep 17 00:00:00 2001 From: Nicolas Thill Date: Tue, 16 May 2006 23:49:57 +0000 Subject: [PATCH] add pcmcia-utils package (thanks to Markus Wigge, partially closes: #533). SVN-Revision: 3788 --- openwrt/package/Config.in | 1 + openwrt/package/Makefile | 1 + openwrt/package/pcmcia-cs/Config.in | 15 +++++ openwrt/package/pcmcia-cs/Makefile | 58 +++++++++++++++++++ openwrt/package/pcmcia-cs/files/pcmcia.init | 6 ++ .../pcmcia-cs/ipkg/pcmcia-utils.control | 5 ++ .../001-config-novatel_merlin_u630.patch | 14 +++++ .../patches/002-serial-cardctl_path.patch | 12 ++++ .../pcmcia-cs/patches/003-cardmgr_c.patch | 42 ++++++++++++++ 9 files changed, 154 insertions(+) create mode 100644 openwrt/package/pcmcia-cs/Config.in create mode 100644 openwrt/package/pcmcia-cs/Makefile create mode 100644 openwrt/package/pcmcia-cs/files/pcmcia.init create mode 100644 openwrt/package/pcmcia-cs/ipkg/pcmcia-utils.control create mode 100644 openwrt/package/pcmcia-cs/patches/001-config-novatel_merlin_u630.patch create mode 100644 openwrt/package/pcmcia-cs/patches/002-serial-cardctl_path.patch create mode 100644 openwrt/package/pcmcia-cs/patches/003-cardmgr_c.patch diff --git a/openwrt/package/Config.in b/openwrt/package/Config.in index 77fc7b1e71..379062375f 100644 --- a/openwrt/package/Config.in +++ b/openwrt/package/Config.in @@ -132,6 +132,7 @@ source "package/setserial/Config.in" comment "Utilities ---" source "package/madwifi-tools/Config.in" source "package/usbutils/Config.in" # lsusb +source "package/pcmcia-cs/Config.in" # pcmcia-utils source "package/strace/Config.in" # what are we going to do with both of you diff --git a/openwrt/package/Makefile b/openwrt/package/Makefile index f6838794e8..0a87352e11 100644 --- a/openwrt/package/Makefile +++ b/openwrt/package/Makefile @@ -78,6 +78,7 @@ package-$(BR2_PACKAGE_OPENSSL) += openssl package-$(BR2_PACKAGE_OPENSWAN) += openswan package-$(BR2_PACKAGE_OPENVPN) += openvpn package-$(BR2_PACKAGE_OSIRIS) += osiris +package-$(BR2_COMPILE_PCMCIA_CS) += pcmcia-cs package-$(BR2_PACKAGE_PCRE) += pcre package-$(BR2_PACKAGE_PICOCOM) += picocom package-$(BR2_PACKAGE_PMACCT) += pmacct diff --git a/openwrt/package/pcmcia-cs/Config.in b/openwrt/package/pcmcia-cs/Config.in new file mode 100644 index 0000000000..3092a52cc5 --- /dev/null +++ b/openwrt/package/pcmcia-cs/Config.in @@ -0,0 +1,15 @@ +config BR2_COMPILE_PCMCIA_CS + tristate + default n + depends BR2_PACKAGE_PCMCIA_UTILS + +config BR2_PACKAGE_PCMCIA_UTILS + tristate "pcmcia-utils - PCMCIA/Cardbus management utilities" + select BR2_COMPILE_PCMCIA_CS + select BR2_PACKAGE_KMOD_PCMCIA + default m + help + PCMCIA/Cardbus management utilities + + http://pcmcia-cs.sourceforge.net/ + diff --git a/openwrt/package/pcmcia-cs/Makefile b/openwrt/package/pcmcia-cs/Makefile new file mode 100644 index 0000000000..1775ddbb32 --- /dev/null +++ b/openwrt/package/pcmcia-cs/Makefile @@ -0,0 +1,58 @@ +# $Id$ + +include $(TOPDIR)/rules.mk + +PKG_NAME:=pcmcia-cs +PKG_VERSION:=3.2.8 +PKG_RELEASE:=1 +PKG_MD5SUM:=0d6d65be8896eff081aee996049afaa5 + +PKG_SOURCE_URL:=@SF/$(PKG_NAME) +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_CAT:=zcat + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) +PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install + +include $(TOPDIR)/package/rules.mk + +$(eval $(call PKG_template,PCMCIA_UTILS,pcmcia-utils,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH))) + +$(PKG_BUILD_DIR)/.configured: + ( cd $(PKG_BUILD_DIR); \ + ./Configure \ + --noprompt \ + --kernel="$(LINUX_DIR)" \ + --target="$(PKG_INSTALL_DIR)" \ + --arch="$(ARCH)" \ + --ucc="$(TARGET_CC)" \ + --uflags="$(TARGET_CFLAGS)" \ + --srctree \ + --cardbus \ + --noapm \ + --nopnp \ + --notrust \ + --nox11 \ + --sysv --rcdir="/etc" \ + ) + touch $@ + +$(PKG_BUILD_DIR)/.built: + rm -rf $(PKG_INSTALL_DIR) + mkdir -p $(PKG_INSTALL_DIR) + $(MAKE) -C $(PKG_BUILD_DIR) \ + CFLAGS="$(TARGET_CFLAGS)" \ + all install + touch $@ + +$(IPKG_PCMCIA_UTILS): + install -m0755 -d $(IDIR_PCMCIA_UTILS)/etc + $(CP) $(PKG_INSTALL_DIR)/etc/pcmcia $(IDIR_PCMCIA_UTILS)/etc/ + install -m0755 -d $(IDIR_PCMCIA_UTILS)/usr/sbin + $(CP) $(PKG_INSTALL_DIR)/sbin/cardctl $(IDIR_PCMCIA_UTILS)/usr/sbin/ + $(CP) $(PKG_INSTALL_DIR)/sbin/cardmgr $(IDIR_PCMCIA_UTILS)/usr/sbin/ + install -d -m0755 $(IDIR_PCMCIA_UTILS)/etc/init.d/ + install -m0755 ./files/pcmcia.init $(IDIR_PCMCIA_UTILS)/etc/init.d/S20pcmcia + $(RSTRIP) $(IDIR_PCMCIA_UTILS) + $(IPKG_BUILD) $(IDIR_PCMCIA_UTILS) $(PACKAGE_DIR) + diff --git a/openwrt/package/pcmcia-cs/files/pcmcia.init b/openwrt/package/pcmcia-cs/files/pcmcia.init new file mode 100644 index 0000000000..4b17a19e3f --- /dev/null +++ b/openwrt/package/pcmcia-cs/files/pcmcia.init @@ -0,0 +1,6 @@ +#!/bin/sh +case "$1" in + start|restart) + cardmgr + ;; +esac diff --git a/openwrt/package/pcmcia-cs/ipkg/pcmcia-utils.control b/openwrt/package/pcmcia-cs/ipkg/pcmcia-utils.control new file mode 100644 index 0000000000..eab298b121 --- /dev/null +++ b/openwrt/package/pcmcia-cs/ipkg/pcmcia-utils.control @@ -0,0 +1,5 @@ +Package: pcmcia-utils +Priority: optional +Section: sys +Depends: kmod-pcmcia +Description: PCMCIA/Cardbus management utilities diff --git a/openwrt/package/pcmcia-cs/patches/001-config-novatel_merlin_u630.patch b/openwrt/package/pcmcia-cs/patches/001-config-novatel_merlin_u630.patch new file mode 100644 index 0000000000..071a697298 --- /dev/null +++ b/openwrt/package/pcmcia-cs/patches/001-config-novatel_merlin_u630.patch @@ -0,0 +1,14 @@ +diff -ruN pcmcia-cs-3.2.8-old/etc/config pcmcia-cs-3.2.8-new/etc/config +--- pcmcia-cs-3.2.8-old/etc/config 2004-07-16 18:38:25.000000000 +0200 ++++ pcmcia-cs-3.2.8-new/etc/config 2005-11-21 08:52:54.000000000 +0100 +@@ -2413,6 +2413,10 @@ + pci 0x115d, 0x0101 + bind "serial_cb" + ++card "Novatel Wireless - Merlin U630 UMTS Modem" ++ manfid 0x00a4, 0x0276 ++ bind "serial_cs" to 0, "serial_cs" to 1 ++ + # Include configuration files for add-on drivers + + source ./*.conf diff --git a/openwrt/package/pcmcia-cs/patches/002-serial-cardctl_path.patch b/openwrt/package/pcmcia-cs/patches/002-serial-cardctl_path.patch new file mode 100644 index 0000000000..a66069bcd2 --- /dev/null +++ b/openwrt/package/pcmcia-cs/patches/002-serial-cardctl_path.patch @@ -0,0 +1,12 @@ +diff -urN pcmcia-cs-3.2.8-old/etc/shared pcmcia-cs-3.2.8-new/etc/shared +--- pcmcia-cs-3.2.8-old/etc/shared 2004-02-28 17:49:45.000000000 +0100 ++++ pcmcia-cs-3.2.8-new/etc/shared 2006-03-29 18:49:07.000000000 +0200 +@@ -167,7 +167,7 @@ + STAB=/var/run/stab + fi + grep_stab $1 < $STAB || usage +- eval `/sbin/cardctl info $SOCKET` ++ eval `/usr/sbin/cardctl info $SOCKET` + fi + } + diff --git a/openwrt/package/pcmcia-cs/patches/003-cardmgr_c.patch b/openwrt/package/pcmcia-cs/patches/003-cardmgr_c.patch new file mode 100644 index 0000000000..7078db7f78 --- /dev/null +++ b/openwrt/package/pcmcia-cs/patches/003-cardmgr_c.patch @@ -0,0 +1,42 @@ +diff -urN pcmcia-cs-3.2.8-old/cardmgr/cardmgr.c pcmcia-cs-3.2.8-new/cardmgr/cardmgr.c +--- pcmcia-cs-3.2.8-old/cardmgr/cardmgr.c 2004-05-21 08:39:36.000000000 +0200 ++++ pcmcia-cs-3.2.8-new/cardmgr/cardmgr.c 2006-03-29 20:27:03.000000000 +0200 +@@ -739,10 +739,7 @@ + int ret; + + strcpy(cmd, "insmod "); +- if (strchr(mod, '/') != NULL) +- sprintf(cmd+7, "%s/%s.o", modpath, mod); +- else +- sprintf(cmd+7, "%s/pcmcia/%s.o", modpath, mod); ++ sprintf(cmd+7, "%s/%s.o", modpath, mod); + if (access(cmd+7, R_OK) != 0) { + syslog(LOG_NOTICE, "module %s not available", cmd+7); + free(cmd); +@@ -808,11 +805,13 @@ + } + + if (do_modprobe) { +- if (try_modprobe(mod, opts) != 0) ++ if (try_modprobe(mod, opts) != 0) { + try_insmod(mod, opts); ++ } + } else { +- if (try_insmod(mod, opts) != 0) ++ if (try_insmod(mod, opts) != 0) { + try_modprobe(mod, opts); ++ } + } + } + +@@ -1113,8 +1112,9 @@ + + /* remove kernel modules in inverse order */ + for (i = 0; i < card->bindings; i++) { +- for (j = dev[i]->modules-1; j >= 0; j--) ++ for (j = dev[i]->modules-1; j >= 0; j--) { + remove_module(dev[i]->module[j]); ++ } + free_device(dev[i]); + } + /* Remove any MTD's bound to this socket */ -- 2.30.2