From bbe35d48172c059e0cc4040bb3e1bbec5192abe2 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Sat, 15 Feb 2003 12:36:32 +0000 Subject: Fix pcmcia startup. Add grep --- Makefile | 2 +- make/grep.mk | 57 +++++++++ make/pcmcia.mk | 2 +- sources/pcmcia.patch | 32 ----- sources/target_skeleton/etc/init.d/S30pcmcia | 180 +++++++++++++++++++++++++++ 5 files changed, 239 insertions(+), 34 deletions(-) create mode 100644 make/grep.mk create mode 100755 sources/target_skeleton/etc/init.d/S30pcmcia diff --git a/Makefile b/Makefile index 3e06dc4f5..1e40cb6ba 100644 --- a/Makefile +++ b/Makefile @@ -94,7 +94,7 @@ TARGETS+=busybox tinylogin # Everything needed to build a full uClibc development system! #TARGETS+=coreutils findutils bash make diffutils patch sed -#TARGETS+=ed flex bison file gawk tar gcc_target +#TARGETS+=ed flex bison file gawk tar grep gcc_target # Of course, if you are installing a development system, you # may want some header files so you can compile stuff.... diff --git a/make/grep.mk b/make/grep.mk new file mode 100644 index 000000000..967bcf363 --- /dev/null +++ b/make/grep.mk @@ -0,0 +1,57 @@ +############################################################# +# +# grep +# +############################################################# +GNUGREP_SOURCE:=grep-2.5.1.tar.bz2 +GNUGREP_SITE:=ftp://ftp.gnu.org/gnu/grep +GNUGREP_DIR:=$(BUILD_DIR)/grep-2.5.1 +GNUGREP_CAT:=bzcat +GNUGREP_BINARY:=src/grep +GNUGREP_TARGET_BINARY:=bin/grep + +$(DL_DIR)/$(GNUGREP_SOURCE): + $(WGET) -P $(DL_DIR) $(GNUGREP_SITE)/$(GNUGREP_SOURCE) + +grep-source: $(DL_DIR)/$(GNUGREP_SOURCE) + +$(GNUGREP_DIR)/.unpacked: $(DL_DIR)/$(GNUGREP_SOURCE) + $(GNUGREP_CAT) $(DL_DIR)/$(GNUGREP_SOURCE) | tar -C $(BUILD_DIR) -xvf - + touch $(GNUGREP_DIR)/.unpacked + +$(GNUGREP_DIR)/.configured: $(GNUGREP_DIR)/.unpacked + (cd $(GNUGREP_DIR); rm -rf config.cache; \ + PATH=$(TARGET_PATH) CC=$(TARGET_CC) \ + ./configure \ + --target=$(GNU_TARGET_NAME) \ + --prefix=/usr \ + --exec-prefix=/usr \ + --bindir=/usr/bin \ + --sbindir=/usr/sbin \ + --libexecdir=/usr/lib \ + --sysconfdir=/etc \ + --datadir=/usr/share \ + --localstatedir=/var \ + --mandir=/usr/man \ + --infodir=/usr/info \ + --disable-nls \ + ); + touch $(GNUGREP_DIR)/.configured + +$(GNUGREP_DIR)/$(GNUGREP_BINARY): $(GNUGREP_DIR)/.configured + $(MAKE) -C $(GNUGREP_DIR) + +$(TARGET_DIR)/$(GNUGREP_TARGET_BINARY): $(GNUGREP_DIR)/$(GNUGREP_BINARY) + rm -f $(TARGET_DIR)/bin/grep $(TARGET_DIR)/bin/egrep $(TARGET_DIR)/bin/fgrep + cp -a $(GNUGREP_DIR)/src/grep $(GNUGREP_DIR)/src/egrep $(GNUGREP_DIR)/src/fgrep $(TARGET_DIR)/bin/ + + +grep: uclibc $(TARGET_DIR)/$(GNUGREP_TARGET_BINARY) + +grep-clean: + $(MAKE) DESTDIR=$(TARGET_DIR) -C $(GNUGREP_DIR) uninstall + -$(MAKE) -C $(GNUGREP_DIR) clean + +grep-dirclean: + rm -rf $(GNUGREP_DIR) + diff --git a/make/pcmcia.mk b/make/pcmcia.mk index 164284281..7dcc6f897 100644 --- a/make/pcmcia.mk +++ b/make/pcmcia.mk @@ -74,7 +74,7 @@ $(TARGET_DIR)/sbin/cardmgr: $(PCMCIA_DIR)/cardmgr/cardmgr rm -f $(TARGET_DIR)/usr/share/pnp.ids $(TARGET_DIR)/sbin/lspnp $(TARGET_DIR)/sbin/setpnp; rm -f $(TARGET_DIR)/sbin/pcinitrd rm -f $(TARGET_DIR)/sbin/probe - cp $(PCMCIA_DIR)/etc/rc.pcmcia $(TARGET_DIR)/etc/init.d/S30pcmcia + cp $(SOURCE_DIR)/target_skeleton/etc/init.d/S30pcmcia $(TARGET_DIR)/etc/init.d/S30pcmcia chmod a+x $(TARGET_DIR)/etc/init.d/S30pcmcia chmod -R u+w $(TARGET_DIR)/etc/pcmcia/* diff --git a/sources/pcmcia.patch b/sources/pcmcia.patch index 03527f8d6..23a4120ab 100644 --- a/sources/pcmcia.patch +++ b/sources/pcmcia.patch @@ -9,38 +9,6 @@ include memory 0xc0000-0xfffff include memory 0xa0000000-0xa0ffffff, memory 0x60000000-0x60ffffff -diff -urN pcmcia-cs-3.2.3.orig/etc/pcmcia.conf pcmcia-cs-3.2.3/etc/pcmcia.conf ---- pcmcia-cs-3.2.3.orig/etc/pcmcia.conf 1969-12-31 17:00:00.000000000 -0700 -+++ pcmcia-cs-3.2.3/etc/pcmcia.conf 2003-02-14 05:05:07.000000000 -0700 -@@ -0,0 +1,13 @@ -+# Defaults for pcmcia -+PCMCIA=yes -+# Should be either yenta_socket, i82365, i82092, or tcic -+PCIC=yenta_socket -+# Put socket driver timing parameters here -+PCIC_OPTS= -+# Put pcmcia_core options here -+CORE_OPTS= -+# Put cardmgr options here -+CARDMGR_OPTS= -+# To set the PCMCIA scheme at startup... -+SCHEME= -+ -diff -urN pcmcia-cs-3.2.3.orig/etc/rc.pcmcia pcmcia-cs-3.2.3/etc/rc.pcmcia ---- pcmcia-cs-3.2.3.orig/etc/rc.pcmcia 2002-08-08 00:43:43.000000000 -0600 -+++ pcmcia-cs-3.2.3/etc/rc.pcmcia 2003-02-14 05:05:13.000000000 -0700 -@@ -26,9 +26,9 @@ - done - - # Source PCMCIA configuration, if available --if [ -f /etc/pcmcia.conf ] ; then -+if [ -f /etc/pcmcia/pcmcia.conf ] ; then - # Debian startup option file -- . /etc/pcmcia.conf -+ . /etc/pcmcia/pcmcia.conf - elif [ -f /etc/sysconfig/pcmcia ] ; then - # Red Hat startup option file - . /etc/sysconfig/pcmcia diff -urN pcmcia-cs-3.2.3.orig/etc/shared pcmcia-cs-3.2.3/etc/shared --- pcmcia-cs-3.2.3.orig/etc/shared 2002-08-18 21:21:11.000000000 -0600 +++ pcmcia-cs-3.2.3/etc/shared 2003-02-14 05:05:07.000000000 -0700 diff --git a/sources/target_skeleton/etc/init.d/S30pcmcia b/sources/target_skeleton/etc/init.d/S30pcmcia new file mode 100755 index 000000000..0b14338f3 --- /dev/null +++ b/sources/target_skeleton/etc/init.d/S30pcmcia @@ -0,0 +1,180 @@ +#!/bin/sh + +# rc.pcmcia 1.39 2001/10/04 12:30:05 (David Hinds) +# +# This is designed to work in BSD as well as SysV init setups. See +# the HOWTO for customization instructions. +# Modified to comply with Debian's standards by Brian Mays +# . + +# Tags for Red Hat init configuration tools +# +# chkconfig: 2345 45 96 +# processname: cardmgr +# pidfile: /var/run/cardmgr.pid +# config: /etc/pcmcia/config +# config: /etc/pcmcia/config.opts +# description: PCMCIA support is usually to support things like ethernet \ +# and modems in laptops. It won't get started unless \ +# configured so it is safe to have it installed on machines \ +# that don't need it. + +# Save option values passed in through the environment +for N in PCMCIA PCIC PCIC_OPTS CORE_OPTS CARDMGR_OPTS SCHEME ; do + V=`eval echo '$'$N` ; if [ "$V" ] ; then eval ENV_$N=\"$V\" ; fi +done + +# PCMCIA configuration... This may be wrong for many systems. + +# Should be either yenta_socket, i82365 or tcic +PCIC=yenta_socket +#PCIC=i82365 +#PCIC=tcic + +# Put socket driver timing parameters here +PCIC_OPTS= +# Put pcmcia_core options here +CORE_OPTS= +# Put cardmgr options here +CARDMGR_OPTS= +# To set the PCMCIA scheme at startup... +SCHEME= +PCMCIA=yes + + +for N in PCMCIA PCIC PCIC_OPTS CORE_OPTS CARDMGR_OPTS SCHEME ; do + V=`eval echo '$'ENV_$N` ; if [ "$V" ] ; then eval $N=\"$V\" ; fi +done +if [ "$PCMCIA" -a "$PCMCIA" != "yes" ] ; then exit 0 ; fi + +# Debian modification: Fix PCIC for stand-alone modules. +# yenta_socket -> i82365 on these systems. +# Existence of a standalone module implies that it is preferred. +PC=/lib/modules/`uname -r`/pcmcia +if [ "$PCIC" = yenta_socket -a -e $PC/i82365.o \ + -a ! -L $PC/i82365.o ]; then + PCIC=i82365 +fi + +usage() +{ + echo "Usage: $0 {start|stop|status|restart|reload|force-reload}" +} + +cleanup() +{ + while read SN CLASS MOD INST DEV EXTRA ; do + if [ "$SN" != "Socket" ] ; then + /etc/pcmcia/$CLASS stop $DEV 2> /dev/null + fi + done +} + +EXITCODE=1 +for x in "1" ; do + + if [ "$PCIC" = "" ] ; then + echo "PCIC module not defined in startup options!" + break + fi + + if [ $# -lt 1 ] ; then usage ; break ; fi + action=$1 + + case "$action" in + + start) + echo -n "Starting PCMCIA services:" + SC=/var/lib/pcmcia/scheme + RUN=/var/lib/pcmcia + if [ -L $SC -o ! -O $SC ] ; then rm -f $SC ; fi + if [ ! -f $SC ] ; then umask 022 ; touch $SC ; fi + if [ "$SCHEME" ] ; then umask 022 ; echo $SCHEME > $SC ; fi + grep -q pcmcia /proc/devices + if [ $? -ne 0 ] ; then + PC=/lib/modules/`uname -r`/pcmcia + KD=/lib/modules/`uname -r`/kernel/drivers/pcmcia + if [ -d $KD ] ; then + /sbin/modprobe pcmcia_core + /sbin/modprobe $PCIC + /sbin/modprobe ds + elif [ -d $PC ] ; then + echo -n " modules" + /sbin/insmod $PC/pcmcia_core.o $CORE_OPTS + /sbin/insmod $PC/$PCIC.o $PCIC_OPTS + /sbin/insmod $PC/ds.o + else + echo " module directory $PC not found." + break + fi + fi + if [ -s /var/run/cardmgr.pid ] && \ + kill -0 `cat /var/run/cardmgr.pid` 2>/dev/null ; then + echo " cardmgr is already running." + else + if [ -r $RUN/stab ] ; then + cat $RUN/stab | cleanup + fi + echo " cardmgr." + /sbin/cardmgr $CARDMGR_OPTS + fi + touch /var/lock/pcmcia.lock 2>/dev/null + EXITCODE=0 + ;; + + stop) + echo -n "Shutting down PCMCIA services:" + if [ -s /var/run/cardmgr.pid ] ; then + PID=`cat /var/run/cardmgr.pid` + kill $PID + echo -n " cardmgr" + # Give cardmgr a few seconds to handle the signal + kill -0 $PID 2>/dev/null && sleep 2 && \ + kill -0 $PID 2>/dev/null && sleep 2 && \ + kill -0 $PID 2>/dev/null && sleep 2 && \ + kill -0 $PID 2>/dev/null + fi + if grep -q "ds " /proc/modules ; then + echo -n " modules" + /sbin/rmmod ds + /sbin/rmmod $PCIC + /sbin/rmmod pcmcia_core + fi + echo "." + rm -f /var/lock/pcmcia.lock + EXITCODE=0 + ;; + + status) + pid=`/bin/pidof cardmgr` + if [ "$pid" != "" ] ; then + echo "cardmgr (pid $pid) is running..." + EXITCODE=0 + else + echo "cardmgr is stopped" + EXITCODE=3 + fi + ;; + + restart) + $0 stop + $0 start + EXITCODE=$? + ;; + + reload|force-reload) + echo "Reloading $DESC configuration files." + kill -1 `cat /var/run/cardmgr.pid` 2>/dev/null + EXITCODE=0 + ;; + + *) + usage + ;; + + esac + +done + +# Only exit if we're in our own subshell +case $0 in *pcmcia) exit $EXITCODE ;; esac -- cgit v1.2.3