pcmciautils: import from oldpackages

-import from oldpackages
 -add PKG_LICENSE, PKG_LICENSE_FILES, PKG_MAINTAINER
 -add two build fix patches

Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
This commit is contained in:
Tomasz Maciej Nowak 2017-01-21 16:37:41 +01:00
parent 42d6e40423
commit d901cea1d5
7 changed files with 185 additions and 0 deletions

View File

@ -0,0 +1,57 @@
#
# Copyright (C) 2008-2017 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=pcmciautils
PKG_VERSION:=018
PKG_RELEASE:=3
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=@KERNEL/linux/utils/kernel/pcmcia
PKG_MD5SUM:=5d85669b3440baa4532363da6caaf1b4
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=COPYING
PKG_MAINATINER:=Tomasz Maciej Nowak <tomek_n@o2.pl>
include $(INCLUDE_DIR)/package.mk
define Package/pcmciautils
SECTION:=utils
CATEGORY:=Utilities
DEPENDS:=+libsysfs @PCMCIA_SUPPORT
TITLE:=PCMCIA Utilities
URL:=http://www.kernel.org/pub/linux/utils/kernel/pcmcia/pcmcia.html
endef
define Build/Compile
$(call Build/Compile/Default, \
LD="$(TARGET_CC)" UDEV=false \
CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS) \
-DPCMCIAUTILS_VERSION=\\\"$(PKG_VERSION)\\\"" \
prefix=/usr all \
)
endef
define Package/pcmciautils/install
$(INSTALL_DIR) $(1)/usr/sbin/
$(CP) $(PKG_BUILD_DIR)/pccardctl $(1)/usr/sbin/
$(CP) $(PKG_BUILD_DIR)/pcmcia-check-broken-cis $(1)/usr/sbin/
$(CP) $(PKG_BUILD_DIR)/pcmcia-socket-startup $(1)/usr/sbin/
rm -f $(1)/usr/sbin/lspcmcia
ln -s pccardctl $(1)/usr/sbin/lspcmcia
$(INSTALL_DIR) $(1)/etc/pcmcia/
$(CP) $(PKG_BUILD_DIR)/config/config.opts $(1)/etc/pcmcia/
$(CP) files/* $(1)/
endef
define Package/pcmciautils/conffiles
/etc/pcmcia/config.opts
endef
$(eval $(call BuildPackage,pcmciautils))

View File

@ -0,0 +1,28 @@
#!/bin/sh
# Copyright (C) 2008 OpenWrt.org
case "$ACTION" in
add)
SYSFS=/sys/bus/pcmcia/devices/
DEVPATH=$SOCKET_NO.$((0x$DEVICE_NO))
# check whether the CIS is completely broken
if [ ! -h $SYSFS$DEVPATH/driver ]; then
CISFILE=$(/usr/sbin/pcmcia-check-broken-cis $SOCKET_NO)
echo PCMCIA: $CISFILE;
if [ ! -z $CISFILE ]; then
if [ -f /lib/firmware/$CISFILE ]; then
cat /lib/firmware/$CISFILE > $SYSFS/class/pcmcia_socket/pcmcia_socket$(SOCKET_NO)/cis
fi;
fi;
fi;
# allow a match solely based on the "function ID" field
if [ ! -h $SYSFS$DEVPATH/driver ]; then
if [ -w $SYSFS$DEVPATH/allow_func_id_match ]; then
echo PCMCIA: allowing func_id based match for PCMCIA device $SOCKET_NO.$DEVICE_NO
echo -n "42" > $SYSFS$DEVPATH/allow_func_id_match;
fi;
fi;
;;
esac

View File

@ -0,0 +1,18 @@
#!/bin/sh
# Copyright (C) 2008 OpenWrt.org
case "$ACTION" in
add)
echo PCMCIA: socket number: $SOCKET_NO
sleep 1;
/usr/sbin/pcmcia-socket-startup $SOCKET_NO
DONE_FILE=/sys/class/pcmcia_socket/pcmcia_socket$SOCKET_NO/available_resources_setup_done
if [ -f $DONE_FILE ]; then
if [ -w $DONE_FILE ]; then
echo -n "42" > $DONE_FILE
fi;
fi;
;;
esac

View File

@ -0,0 +1,25 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2008 OpenWrt.org
START=42
start() {
if [ -d /sys/bus/pcmcia/devices/ ]; then
# 2.6 kernels
cd /sys/bus/pcmcia/devices/
for PCMCIA_DEVICE in *; do
if [ $PCMCIA_DEVICE == \* ]; then
continue;
fi;
MODALIAS=$(cat $PCMCIA_DEVICE/modalias)
echo PCMCIA: $MODALIAS $PCMCIA_DEVICE
if [ -z $MODALIAS ]; then
continue;
fi;
ACTION=add
SOCKET_NO=$(echo $PCMCIA_DEVICE | cut -d. -f1)
DEVICE_NO=$(echo $MODALIAS | sed 's/.*pfn\(..\).*/\1/')
export MODALIAS ACTION SOCKET_NO DEVICE_NO
/sbin/hotplug-call pcmcia
done;
fi;
}

View File

@ -0,0 +1,19 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2008 OpenWrt.org
START=41
start() {
if [ -d /sys/class/pcmcia_socket/ ]; then
# 2.6 kernels
cd /sys/class/pcmcia_socket/
for PCMCIA_SOCKET in *; do
if [ $PCMCIA_SOCKET == \* ]; then
continue;
fi;
SOCKET_NO=$(echo $PCMCIA_SOCKET | cut -b14-)
ACTION=add
export SOCKET_NO ACTION
/sbin/hotplug-call pcmcia_socket
done;
fi;
}

View File

@ -0,0 +1,11 @@
--- a/src/yacc_config.y
+++ b/src/yacc_config.y
@@ -40,7 +40,7 @@
%union {
char *str;
- u_long num;
+ unsigned long num;
struct adjust_list_t *adjust;
}

View File

@ -0,0 +1,27 @@
--- pcmciautils-018/src/lex_config.l
+++ pcmciautils-018/src/lex_config.l
@@ -1,8 +1,8 @@
/* Special state for handling include files */
%x src
-%option noinput nounput
+%option noinput nounput noyywrap
%{
/*
* Startup tool for non statically mapped PCMCIA sockets
*
@@ -75,14 +75,10 @@ module /* skip */ ;
. return yytext[0];
%%
-#ifndef yywrap
-int yywrap() { return 1; }
-#endif
-
/*======================================================================
Stuff to parse basic data types
======================================================================*/