for module in /usr/src/modules/pcmcia-cs ; do                        \
          if test -d  $module; then                                \
    (cd $module;                                           \
              if ./debian/rules KVERS="2.4.20" KSRC="/usr/src/kernel-source-2.4.20" \
                             KMAINT="Unknown Kernel Package Maintainer" KEMAIL="unknown@unconfigured.in.etc.kernel-pkg.conf"      \
                             MODDIR="/usr/src/kernel-source-2.4.20/.."                     \
                             KDREV="i1124.2" kdist_image; then    \
                  echo "Module $module processed fine";            \
              else                                                  \
                   echo "Module $module failed.";                  \
                   echo "Hit return to Continue";                   \
	   read ans;                                        \
              fi;                                                   \
     );                                                     \
  fi;                                                       \
        done
make[1]: Entering directory `/usr/src/modules/pcmcia-cs'
test -f man/pcmcia.5 -a -f debian/rules
rm -f debian/files
for CONFLOC in ~/.kernel-pkg.conf /etc/kernel-pkg.conf; \
do test -f $CONFLOC && break; done; \
 /usr/bin/make -f debian/rules \
  MOD_DIR=/usr/src/kernel-source-2.4.20 CONFLOC=$CONFLOC \
  clean-modules build-modules
make[2]: Entering directory `/usr/src/modules/pcmcia-cs'
test -f man/pcmcia.5 -a -f debian/rules
umask 022; /usr/bin/make DEB_MOD=yes clean
make[3]: Entering directory `/usr/src/modules/pcmcia-cs'
make[4]: Entering directory `/usr/src/modules/pcmcia-cs/modules'
rm -f core core.* *.o .*.o *.s *.a *~ .depend .depfiles/*.d
make[4]: Leaving directory `/usr/src/modules/pcmcia-cs/modules'
make[4]: Entering directory `/usr/src/modules/pcmcia-cs/clients'
rm -f core core.* *.o .*.o *.s *.a *~ .depend .depfiles/*.d
make[4]: Leaving directory `/usr/src/modules/pcmcia-cs/clients'
make[4]: Entering directory `/usr/src/modules/pcmcia-cs/wireless'
rm -f core core.* *.o .*.o *.s *.a *~ .depend .depfiles/*.d
make[4]: Leaving directory `/usr/src/modules/pcmcia-cs/wireless'
rm -f .prereq.ok config.mk include/pcmcia/config.h
rm -f include/linux/modversions.h
make[3]: Leaving directory `/usr/src/modules/pcmcia-cs'
rm -f build-modules
test ! -x Buildlinks || ./Buildlinks pcmcia-cs
KVERS="2.4.20" ./Configure -n --kernel="/usr/src/kernel-source-2.4.20" --srctree \
  --cardbus --sysv --rcdir=/etc --ucc=cc

    -------- Linux PCMCIA Configuration Script --------

The default responses for each question are correct for most users.
Consult the PCMCIA-HOWTO for additional info about each option.

Linux kernel source directory [/usr/src/kernel-source-2.4.20]

The kernel source tree is version 2.4.20.
The current kernel build date is 2003年 3月 15日 土曜日 12:40:57 JST.

Build 'trusting' versions of card utilities (y/n) [n]
Include 32-bit (CardBus) card support (y/n) [y]
Include PnP BIOS resource checking (y/n) [n]
Module install directory [/lib/modules/2.4.20]

Kernel configuration options:
    Kernel-tree PCMCIA support is disabled.
    Symmetric multiprocessing support is disabled.
    Preemptive kernel support is disabled.
    PCI BIOS support is enabled.
    Power management (APM) support is enabled.
    SCSI support is disabled.
    IEEE 1394 (FireWire) support is disabled.
    Networking support is enabled.
     Radio network interface support is enabled.
     Token Ring device support is disabled.
     Fast switching is disabled.
     Frame Diverter is disabled.
    Module version checking is disabled.
    Kernel debugging support is disabled.
    Preemptive kernel patch is disabled.
    /proc filesystem support is enabled.

The standalone IEEE 1394 CardBus drivers are not supported with this
    kernel.  If you need them, use the kernel PCMCIA subsystem.

It looks like you have a System V init file setup.
X Windows include files found.
/usr/X11R6/lib/libXpm.so and /usr/include/X11/xpm.h found.

Configuration successful.

rm -f build build-modules
test -f man/pcmcia.5 -a -f debian/rules
umask 022; /usr/bin/make  DEB_MOD=yes all
make[3]: Entering directory `/usr/src/modules/pcmcia-cs'
make[4]: Entering directory `/usr/src/modules/pcmcia-cs/modules'
cc   -MD -O2 -Wall -Wstrict-prototypes -pipe -Wa,--no-warn -I../include -I/usr/src/kernel-source-2.4.20/include  -D__KERNEL__ -DMODULE -c cs.c
cc   -MD -O2 -Wall -Wstrict-prototypes -pipe -Wa,--no-warn -I../include -I/usr/src/kernel-source-2.4.20/include  -D__KERNEL__ -DMODULE -c cistpl.c
cc   -MD -O2 -Wall -Wstrict-prototypes -pipe -Wa,--no-warn -I../include -I/usr/src/kernel-source-2.4.20/include  -D__KERNEL__ -DMODULE -c rsrc_mgr.c
cc   -MD -O2 -Wall -Wstrict-prototypes -pipe -Wa,--no-warn -I../include -I/usr/src/kernel-source-2.4.20/include  -D__KERNEL__ -DMODULE -c bulkmem.c
cc   -MD -O2 -Wall -Wstrict-prototypes -pipe -Wa,--no-warn -I../include -I/usr/src/kernel-source-2.4.20/include  -D__KERNEL__ -DMODULE -c cardbus.c
cc   -MD -O2 -Wall -Wstrict-prototypes -pipe -Wa,--no-warn -I../include -I/usr/src/kernel-source-2.4.20/include  -D__KERNEL__ -DMODULE -c pci_fixup.c
ld -r -o pcmcia_core.o cs.o cistpl.o rsrc_mgr.o bulkmem.o cardbus.o pci_fixup.o
chmod -x pcmcia_core.o
cc   -MD -O2 -Wall -Wstrict-prototypes -pipe -Wa,--no-warn -I../include -I/usr/src/kernel-source-2.4.20/include  -D__KERNEL__ -DMODULE -c ds.c
cc   -MD -O2 -Wall -Wstrict-prototypes -pipe -Wa,--no-warn -I../include -I/usr/src/kernel-source-2.4.20/include  -D__KERNEL__ -DMODULE -c cb_enabler.c
cc   -MD -O2 -Wall -Wstrict-prototypes -pipe -Wa,--no-warn -I../include -I/usr/src/kernel-source-2.4.20/include  -D__KERNEL__ -DMODULE -c i82365.c
cc   -MD -O2 -Wall -Wstrict-prototypes -pipe -Wa,--no-warn -I../include -I/usr/src/kernel-source-2.4.20/include  -D__KERNEL__ -DMODULE -c tcic.c
make[4]: Leaving directory `/usr/src/modules/pcmcia-cs/modules'
make[4]: Entering directory `/usr/src/modules/pcmcia-cs/clients'
cc   -MD -O3 -Wall -Wstrict-prototypes -Wa,--no-warn -pipe -I../include -I/usr/src/kernel-source-2.4.20/include  -D__KERNEL__ -DMODULE -c serial_cs.c
cc   -MD -O3 -Wall -Wstrict-prototypes -Wa,--no-warn -pipe -I../include -I/usr/src/kernel-source-2.4.20/include  -D__KERNEL__ -DMODULE -c memory_cs.c
cc   -MD -O3 -Wall -Wstrict-prototypes -Wa,--no-warn -pipe -I../include -I/usr/src/kernel-source-2.4.20/include  -D__KERNEL__ -DMODULE -c ftl_cs.c
cc   -MD -O3 -Wall -Wstrict-prototypes -Wa,--no-warn -pipe -I../include -I/usr/src/kernel-source-2.4.20/include  -D__KERNEL__ -DMODULE -c dummy_cs.c
cc   -MD -O3 -Wall -Wstrict-prototypes -Wa,--no-warn -pipe -I../include -I/usr/src/kernel-source-2.4.20/include  -D__KERNEL__ -DMODULE -c sram_mtd.c
cc   -MD -O3 -Wall -Wstrict-prototypes -Wa,--no-warn -pipe -I../include -I/usr/src/kernel-source-2.4.20/include  -D__KERNEL__ -DMODULE -c iflash2_mtd.c
cc   -MD -O3 -Wall -Wstrict-prototypes -Wa,--no-warn -pipe -I../include -I/usr/src/kernel-source-2.4.20/include  -D__KERNEL__ -DMODULE -c iflash2+_mtd.c
cc   -MD -O3 -Wall -Wstrict-prototypes -Wa,--no-warn -pipe -I../include -I/usr/src/kernel-source-2.4.20/include  -D__KERNEL__ -DMODULE -c memory_cb.c
cc   -MD -O3 -Wall -Wstrict-prototypes -Wa,--no-warn -pipe -I../include -I/usr/src/kernel-source-2.4.20/include  -D__KERNEL__ -DMODULE -c serial_cb.c
cc   -MD -c -O2 -I../include -I/usr/src/kernel-source-2.4.20/include -D__KERNEL__ -Wa,--no-warn -pipe -DMODULE -DCARDBUS 3c575_cb.c
cc   -MD -c -O2 -I../include -I/usr/src/kernel-source-2.4.20/include -D__KERNEL__ -Wa,--no-warn -pipe -DMODULE -DCARDBUS tulip_cb.c
cc   -MD -c -O2 -I../include -I/usr/src/kernel-source-2.4.20/include -D__KERNEL__ -Wa,--no-warn -pipe -DMODULE -DCARDBUS epic_cb.c
cc   -MD -c -O2 -I../include -I/usr/src/kernel-source-2.4.20/include -D__KERNEL__ -Wa,--no-warn -pipe -DMODULE -DCARDBUS eepro100_cb.c
cc   -MD -O3 -Wall -Wstrict-prototypes -Wa,--no-warn -pipe -I../include -I/usr/src/kernel-source-2.4.20/include  -D__KERNEL__ -DMODULE -c pcnet_cs.c
cc   -MD -O3 -Wall -Wstrict-prototypes -Wa,--no-warn -pipe -I../include -I/usr/src/kernel-source-2.4.20/include  -D__KERNEL__ -DMODULE -c 3c589_cs.c
cc   -MD -O3 -Wall -Wstrict-prototypes -Wa,--no-warn -pipe -I../include -I/usr/src/kernel-source-2.4.20/include  -D__KERNEL__ -DMODULE -c nmclan_cs.c
cc   -MD -O3 -Wall -Wstrict-prototypes -Wa,--no-warn -pipe -I../include -I/usr/src/kernel-source-2.4.20/include  -D__KERNEL__ -DMODULE -c fmvj18x_cs.c
fmvj18x_cs.c:608:32: 警告: 複数行文字列リテラルは推奨されません
cc   -MD -O3 -Wall -Wstrict-prototypes -Wa,--no-warn -pipe -I../include -I/usr/src/kernel-source-2.4.20/include  -D__KERNEL__ -DMODULE -c smc91c92_cs.c
cc   -MD -O3 -Wall -Wstrict-prototypes -Wa,--no-warn -pipe -I../include -I/usr/src/kernel-source-2.4.20/include  -D__KERNEL__ -DMODULE -c xirc2ps_cs.c
cc   -MD -O3 -Wall -Wstrict-prototypes -Wa,--no-warn -pipe -I../include -I/usr/src/kernel-source-2.4.20/include  -D__KERNEL__ -DMODULE -c 3c574_cs.c
cc   -MD -O3 -Wall -Wstrict-prototypes -Wa,--no-warn -pipe -I../include -I/usr/src/kernel-source-2.4.20/include  -D__KERNEL__ -DMODULE -c axnet_cs.c
cc   -MD -O3 -Wall -Wstrict-prototypes -Wa,--no-warn -pipe -I../include -I/usr/src/kernel-source-2.4.20/include  -D__KERNEL__ -DMODULE -c ide-cs.c
cc   -MD -c -O2 -I../include -I/usr/src/kernel-source-2.4.20/include -D__KERNEL__ -Wa,--no-warn -pipe -DMODULE /usr/src/kernel-source-2.4.20/drivers/net/8390.c
make[4]: Leaving directory `/usr/src/modules/pcmcia-cs/clients'
make[4]: Entering directory `/usr/src/modules/pcmcia-cs/wireless'
cc   -MD -O3 -Wall -Wstrict-prototypes -pipe -Wa,--no-warn -I../include -I/usr/src/kernel-source-2.4.20/include  -D__KERNEL__ -DMODULE -c netwave_cs.c
cc   -MD -O3 -Wall -Wstrict-prototypes -pipe -Wa,--no-warn -I../include -I/usr/src/kernel-source-2.4.20/include  -D__KERNEL__ -DMODULE -c wavelan_cs.c
cc   -MD -O3 -Wall -Wstrict-prototypes -pipe -Wa,--no-warn -I../include -I/usr/src/kernel-source-2.4.20/include  -D__KERNEL__ -DMODULE -c ray_cs.c
ray_cs.c:149: 警告: `ray_cs_proc_read' が `static' と宣言されましたが未定義です
cc   -MD -O3 -Wall -Wstrict-prototypes -pipe -Wa,--no-warn -I../include -I/usr/src/kernel-source-2.4.20/include  -D__KERNEL__ -DMODULE -c wvlan_base.c
cc   -MD -O3 -Wall -Wstrict-prototypes -pipe -Wa,--no-warn -I../include -I/usr/src/kernel-source-2.4.20/include  -D__KERNEL__ -DMODULE -c wvlan_hcf.c
cc   -MD -O3 -Wall -Wstrict-prototypes -pipe -Wa,--no-warn -I../include -I/usr/src/kernel-source-2.4.20/include  -D__KERNEL__ -DMODULE -c wvlan_hcfio.c
ld -r -o wvlan_cs.o wvlan_base.o wvlan_hcf.o wvlan_hcfio.o ; chmod -x wvlan_cs.o
cc   -MD -O3 -Wall -Wstrict-prototypes -pipe -Wa,--no-warn -I../include -I/usr/src/kernel-source-2.4.20/include  -D__KERNEL__ -DMODULE -c airo_cs.c
cc   -MD -O3 -Wall -Wstrict-prototypes -pipe -Wa,--no-warn -I../include -I/usr/src/kernel-source-2.4.20/include  -D__KERNEL__ -DMODULE -c airo.c
cc   -MD -O3 -Wall -Wstrict-prototypes -pipe -Wa,--no-warn -I../include -I/usr/src/kernel-source-2.4.20/include  -D__KERNEL__ -DMODULE -c hermes.c
cc   -MD -O3 -Wall -Wstrict-prototypes -pipe -Wa,--no-warn -I../include -I/usr/src/kernel-source-2.4.20/include  -D__KERNEL__ -DMODULE -c orinoco.c
cc   -MD -O3 -Wall -Wstrict-prototypes -pipe -Wa,--no-warn -I../include -I/usr/src/kernel-source-2.4.20/include  -D__KERNEL__ -DMODULE -c orinoco_cs.c
make[4]: Leaving directory `/usr/src/modules/pcmcia-cs/wireless'
make[3]: Leaving directory `/usr/src/modules/pcmcia-cs'
touch build-modules
make[2]: Leaving directory `/usr/src/modules/pcmcia-cs'
/usr/bin/make -f debian/rules \
  MOD_DIR=/usr/src/kernel-source-2.4.20 binary-modules
make[2]: Entering directory `/usr/src/modules/pcmcia-cs'
test -f man/pcmcia.5 -a -f debian/rules
test root = "`whoami`" || (echo need root privileges; exit 1)
test -f man/pcmcia.5 -a -f debian/rules
rm -f -r debian/tmp-modules
install -d debian/tmp-modules debian/tmp-modules/DEBIAN
KSRC="/usr/src/kernel-source-2.4.20" KVERS="2.4.20" KDREV="i1124.2" \
  sh -v debian/setvers.sh
#!/bin/sh

# setvers.sh - extract version numbers from the changelog and kernel
#	source and build the control file and prerm script for the
#	pcmcia-modules package

# KSRC is expected to be passed through the environment

set -e
umask 022

# define some sed scripts for extracting the upstream version number
# and Debian revision number from a Debian changelog
pc_vers_sed='
	/#define CS_PKG_RELEASE[ 	]\{1,\}"\(.*\)"/{
	  s//\1/p
	  q
	}'
up_vers_sed='
	1{
	  s/^[^(]*(//
	  s/)[^)]*$//
	  /-[A-Za-z0-9.+]*$/{
	    s///
	    b enddeb
	  }
	  /-/q
	  :enddeb
	  /^[A-Za-z0-9.+:-]\{1,\}$/p
	  q
	}'
deb_rev_sed='
	1{
	  s/^[^(]*(//
	  s/)[^)]*$//
	  s/^.*-\([A-Za-z0-9.+]*\)$/\1/p
	  q
	}'
test "$KVERS" || \
	KVERS=`sed -ne '/UTS_RELEASE=/{
			 s///
			 p
			 q
			}' config.mk`

# extract the upstream version number and debian revision number
UPVERS=`sed -ne "$pc_vers_sed" include/pcmcia/version.h`
sed -ne "$pc_vers_sed" include/pcmcia/version.h
DEBREV=`sed -ne "$deb_rev_sed" debian/changelog`
sed -ne "$deb_rev_sed" debian/changelog
NEXTVERS=${UPVERS%.*}.`expr ${UPVERS##*.} + 1`
expr ${UPVERS##*.} + 1

# determine the version numbers for the kernel source
# use a Debian changelog if it exists, otherwise use the kernel version
# number determined by the PCMCIA configure script
if [ "$KDREV" ]; then
	case "$KDREV" in
	*-*)	KDEBREV=${KDREV##*-} ;;
	*)	KDEBREV="" ;;
	esac
	KVERSDEB=${KDREV%-*}
elif test -r "$KSRC/debian/changelog"; then
	KDEBREV=`sed -ne "$deb_rev_sed" "$KSRC/debian/changelog"`
	KVERSDEB=`sed -ne "$up_vers_sed" "$KSRC/debian/changelog"`
else
	KDEBREV=""
	KVERSDEB="$KVERS"
fi

# remove the epoch number (if any)
KVERSDEBNE="${KVERSDEB##*:}"

# test whether we have successfully determined the version numbers
test "$KVERS" -a "$UPVERS" -a "$DEBREV" || exit 1

echo "$KVERS" > debian/KVERS
if [ "${KVERS%%-*}" = "$KVERSDEBNE" ]; then
	MODVERS="$UPVERS-${DEBREV}${KDEBREV:+k$KDEBREV}"
else
	MODVERS="$UPVERS-${DEBREV}+"`echo "$KVERSDEBNE" | tr - +`${KDEBREV:+"+$KDEBREV"}
fi
echo "$KVERSDEBNE" | tr - +
echo "$MODVERS" > debian/MODVERS

# Generate a correct control file and prerm script for the modules package
for script in preinst postinst prerm config templates; do
    sed -e 's/\${kvers}/'"$KVERS"'/g
	 s/\${kversdeb}/'"$KVERSDEB"'/g' \
    	debian/pcmcia-modules.$script.in > debian/tmp-modules/DEBIAN/$script
    chmod +x debian/tmp-modules/DEBIAN/$script
done
chmod -x debian/tmp-modules/DEBIAN/templates

cat debian/source.control > debian/control.tmp
filter='s/\${kvers}/'"$KVERS"'/g
	s/\${kversdeb}/'"$KVERSDEB${KDEBREV:+-$KDEBREV}"'/g'
if ! [ "${KVERS%%-*}" = "$KVERSDEBNE" -a "$KDEBREV" ]; then
    filter="$filter"'
	s/Depends: kernel-image[^)]*),/Depends:/'
fi
###  BEGIN - REMOVE THIS AFTER 2.4.18  ###
if ! [ "${KVERS%%-*}" = "2.4.17" ]; then
    filter="$filter"'
	/^Replaces: kernel-image/d'
fi
###  END - REMOVE THIS AFTER 2.4.18  ###
sed -e "$filter" debian/pcmcia-modules.control | \
    tee -a debian/control >> debian/control.tmp

dpkg-gencontrol	-isp -v"$MODVERS" \
	-Vcurvers="$UPVERS" -Vnextvers="$NEXTVERS" \
	-p"pcmcia-modules-$KVERS" -Pdebian/tmp-modules	\
	-cdebian/control.tmp
exit 0
cat debian/pcmcia-cs.templates >>debian/tmp-modules/DEBIAN/templates
install -d "debian/tmp-modules/usr/share/doc/pcmcia-modules-`cat debian/KVERS`"
install debian/pcmcia-modules.postrm debian/tmp-modules/DEBIAN/postrm
umask 022; /usr/bin/make \
  DEB_MOD=yes PREFIX=`pwd`/debian/tmp-modules install
make[3]: Entering directory `/usr/src/modules/pcmcia-cs'
make[4]: Entering directory `/usr/src/modules/pcmcia-cs/modules'
cp pcmcia_core.o ds.o cb_enabler.o i82365.o tcic.o /usr/src/modules/pcmcia-cs/debian/tmp-modules/usr/src/kernel-source-2.4.20/../pcmcia
make[4]: Leaving directory `/usr/src/modules/pcmcia-cs/modules'
make[4]: Entering directory `/usr/src/modules/pcmcia-cs/clients'
cp serial_cs.o memory_cs.o ftl_cs.o dummy_cs.o sram_mtd.o iflash2_mtd.o iflash2+_mtd.o memory_cb.o serial_cb.o 3c575_cb.o tulip_cb.o epic_cb.o eepro100_cb.o pcnet_cs.o 3c589_cs.o nmclan_cs.o fmvj18x_cs.o smc91c92_cs.o xirc2ps_cs.o 3c574_cs.o axnet_cs.o ide-cs.o /usr/src/modules/pcmcia-cs/debian/tmp-modules/usr/src/kernel-source-2.4.20/../pcmcia
cp 8390.o /usr/src/modules/pcmcia-cs/debian/tmp-modules/usr/src/kernel-source-2.4.20/../pcmcia
make[4]: Leaving directory `/usr/src/modules/pcmcia-cs/clients'
make[4]: Entering directory `/usr/src/modules/pcmcia-cs/wireless'
cp netwave_cs.o wavelan_cs.o ray_cs.o wvlan_cs.o airo_cs.o airo.o hermes.o orinoco.o orinoco_cs.o /usr/src/modules/pcmcia-cs/debian/tmp-modules/usr/src/kernel-source-2.4.20/../pcmcia
make[4]: Leaving directory `/usr/src/modules/pcmcia-cs/wireless'
make[3]: Leaving directory `/usr/src/modules/pcmcia-cs'
install -m644 debian/changelog \
  debian/tmp-modules/usr/share/doc/pcmcia-modules-`cat debian/KVERS`/changelog.Debian
gzip -9v debian/tmp-modules/usr/share/doc/pcmcia-modules-*/*
debian/tmp-modules/usr/share/doc/pcmcia-modules-2.4.20/changelog.Debian:	 74.3% -- replaced with debian/tmp-modules/usr/share/doc/pcmcia-modules-2.4.20/changelog.Debian.gz
install -m644 debian/copyright \
  debian/tmp-modules/usr/share/doc/pcmcia-modules-`cat debian/KVERS`/copyright
cat COPYING \
  >> debian/tmp-modules/usr/share/doc/pcmcia-modules-`cat debian/KVERS`/copyright
chown -R root.root debian/tmp-modules
chmod -R g-ws debian/tmp-modules
if test -d debian/tmp-modules/lib/modules; then \
  dpkg-deb --build debian/tmp-modules /usr/src/kernel-source-2.4.20/..; fi
make[2]: Leaving directory `/usr/src/modules/pcmcia-cs'
make[1]: Leaving directory `/usr/src/modules/pcmcia-cs'
Module /usr/src/modules/pcmcia-cs processed fine
