summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Gavin <pete@gentoo.org>2001-06-06 14:40:05 +0000
committerPeter Gavin <pete@gentoo.org>2001-06-06 14:40:05 +0000
commit258070eb5afc7917417e241799838a9c778212a1 (patch)
tree2c82ae5b23125b347229b174e4e1be5c1f4cfc9c /sys-kernel
parentAdded tuxracer, yes you MUST have tcl-tk-8.05-r2 it won't compile without it, (diff)
downloadgentoo-2-258070eb5afc7917417e241799838a9c778212a1.tar.gz
gentoo-2-258070eb5afc7917417e241799838a9c778212a1.tar.bz2
gentoo-2-258070eb5afc7917417e241799838a9c778212a1.zip
*** empty log message ***
Diffstat (limited to 'sys-kernel')
-rw-r--r--sys-kernel/linux-extras/files/2.4.5.5/linux-2.4.5-ac5-gentoo-pre-lvm.diff11
-rw-r--r--sys-kernel/linux-extras/files/2.4.5.5/lvm.c.diff20
-rwxr-xr-xsys-kernel/linux-extras/files/2.4.5.5/pcmcia97
-rw-r--r--sys-kernel/linux-extras/files/2.4.5.5/pcmcia-cs-3.1.25-gentoo.diff11
-rw-r--r--sys-kernel/linux-extras/linux-extras-2.4.5.5.ebuild688
-rw-r--r--sys-kernel/linux-sources/files/2.4.5.5/linux-2.4.5-ac5-gentoo-pre-lvm.diff11
-rw-r--r--sys-kernel/linux-sources/files/2.4.5.5/lvm.c.diff20
-rwxr-xr-xsys-kernel/linux-sources/files/2.4.5.5/pcmcia97
-rw-r--r--sys-kernel/linux-sources/files/2.4.5.5/pcmcia-cs-3.1.25-gentoo.diff11
-rw-r--r--sys-kernel/linux-sources/files/digest-linux-sources-2.4.5.59
-rw-r--r--sys-kernel/linux-sources/linux-sources-2.4.5.5.ebuild688
-rw-r--r--sys-kernel/linux/files/2.4.5.5/linux-2.4.5-ac5-gentoo-pre-lvm.diff11
-rw-r--r--sys-kernel/linux/files/2.4.5.5/lvm.c.diff20
-rwxr-xr-xsys-kernel/linux/files/2.4.5.5/pcmcia97
-rw-r--r--sys-kernel/linux/files/2.4.5.5/pcmcia-cs-3.1.25-gentoo.diff11
15 files changed, 1802 insertions, 0 deletions
diff --git a/sys-kernel/linux-extras/files/2.4.5.5/linux-2.4.5-ac5-gentoo-pre-lvm.diff b/sys-kernel/linux-extras/files/2.4.5.5/linux-2.4.5-ac5-gentoo-pre-lvm.diff
new file mode 100644
index 000000000000..7322f1852a6c
--- /dev/null
+++ b/sys-kernel/linux-extras/files/2.4.5.5/linux-2.4.5-ac5-gentoo-pre-lvm.diff
@@ -0,0 +1,11 @@
+--- linux-2.4.5-ac5/drivers/md/Makefile.orig Sat Jun 2 00:49:51 2001
++++ linux-2.4.5-ac5/drivers/md/Makefile Sat Jun 2 00:50:01 2001
+@@ -6,7 +6,7 @@
+
+ export-objs := md.o xor.o
+ list-multi := lvm-mod.o
+-lvm-mod-objs := lvm.o lvm-snap.o lvm-fs.o
++lvm-mod-objs := lvm.o lvm-snap.o
+
+ # Note: link order is important. All raid personalities
+ # and xor.o must come before md.o, as they each initialise
diff --git a/sys-kernel/linux-extras/files/2.4.5.5/lvm.c.diff b/sys-kernel/linux-extras/files/2.4.5.5/lvm.c.diff
new file mode 100644
index 000000000000..6392671b8f7e
--- /dev/null
+++ b/sys-kernel/linux-extras/files/2.4.5.5/lvm.c.diff
@@ -0,0 +1,20 @@
+--- lvm.c.orig Sat Apr 28 10:48:37 2001
++++ lvm.c Sat Apr 28 11:07:07 2001
+@@ -1791,7 +1791,7 @@
+ int max_hardblocksize = 0, hardblocksize;
+
+ for (le = 0; le < lv->lv_allocated_le; le++) {
+- hardblocksize = get_hardblocksize(lv->lv_current_pe[le].dev);
++ hardblocksize = get_hardsect_size(lv->lv_current_pe[le].dev);
+ if (hardblocksize == 0)
+ hardblocksize = 512;
+ if (hardblocksize > max_hardblocksize)
+@@ -1801,7 +1801,7 @@
+ if (lv->lv_access & LV_SNAPSHOT) {
+ for (e = 0; e < lv->lv_remap_end; e++) {
+ hardblocksize =
+- get_hardblocksize(
++ get_hardsect_size(
+ lv->lv_block_exception[e].rdev_new);
+ if (hardblocksize == 0)
+ hardblocksize = 512;
diff --git a/sys-kernel/linux-extras/files/2.4.5.5/pcmcia b/sys-kernel/linux-extras/files/2.4.5.5/pcmcia
new file mode 100755
index 000000000000..4cfb368ff68a
--- /dev/null
+++ b/sys-kernel/linux-extras/files/2.4.5.5/pcmcia
@@ -0,0 +1,97 @@
+#!/bin/sh
+#RCUPDATE:3 4:69:This line is required for script management
+
+. /etc/rc.d/config/functions
+
+SERVICE=pcmcia
+opts="start stop restart"
+
+ # Slackware startup options go right here:
+ # Should be either i82365 or tcic
+ PCIC=i82365
+ # 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=
+
+cleanup()
+{
+ while read SN CLASS MOD INST DEV EXTRA ; do
+ if [ "$SN" != "Socket" ] ; then
+ /etc/pcmcia/$CLASS stop $DEV 2> /dev/null
+ fi
+ done
+}
+
+start() {
+ if [ -d /var/lib/pcmcia ] ; then
+ SC=/var/lib/pcmcia/scheme
+ RUN=/var/lib/pcmcia
+ else
+ SC=/var/run/pcmcia-scheme
+ RUN=/var/run
+ fi
+ 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
+ fgrep -q pcmcia /proc/devices
+ if [ $? -ne 0 ] ; then
+ if [ -d /lib/modules/preferred ] ; then
+ PC=/lib/modules/preferred/pcmcia
+ else
+ PC=/lib/modules/`uname -r`/pcmcia
+ fi
+ if [ -d $PC ] ; then
+ echo -n " modules"
+ /sbin/insmod $PC/pcmcia_core.o $CORE_OPTS 2>&1 > /dev/null
+ /sbin/insmod $PC/$PCIC.o $PCIC_OPTS 2>&1 > /dev/null
+ /sbin/insmod $PC/ds.o 2>&1 > /dev/null
+ 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
+ /sbin/cardmgr $CARDMGR_OPTS 2>&1 > /dev/null
+ fi
+ touch /var/lock/subsys/pcmcia 2>&1 > /dev/null
+}
+
+stop() {
+ 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
+ killall -q "CardBus Watcher"
+ if fgrep -q "ds " /proc/modules ; then
+ echo -n " modules"
+ /sbin/rmmod ds
+ /sbin/rmmod $PCIC
+ /sbin/rmmod pcmcia_core
+ fi
+ rm -f /var/lock/subsys/pcmcia
+}
+
+restart() {
+ stop
+ start
+}
+
+doservice ${@}
+
diff --git a/sys-kernel/linux-extras/files/2.4.5.5/pcmcia-cs-3.1.25-gentoo.diff b/sys-kernel/linux-extras/files/2.4.5.5/pcmcia-cs-3.1.25-gentoo.diff
new file mode 100644
index 000000000000..db555693924c
--- /dev/null
+++ b/sys-kernel/linux-extras/files/2.4.5.5/pcmcia-cs-3.1.25-gentoo.diff
@@ -0,0 +1,11 @@
+--- pcmcia-cs-3.1.25/cardmgr/cardinfo.c~ Wed Feb 14 04:25:48 2001
++++ pcmcia-cs-3.1.25/cardmgr/cardinfo.c Fri May 4 11:43:32 2001
+@@ -40,7 +40,7 @@
+ #include <fcntl.h>
+ #include <errno.h>
+ #include <signal.h>
+-#include <sys/time.h>
++#include <time.h>
+ #include <sys/ioctl.h>
+ #include <sys/stat.h>
+ #include <sys/file.h>
diff --git a/sys-kernel/linux-extras/linux-extras-2.4.5.5.ebuild b/sys-kernel/linux-extras/linux-extras-2.4.5.5.ebuild
new file mode 100644
index 000000000000..31f64083c4ca
--- /dev/null
+++ b/sys-kernel/linux-extras/linux-extras-2.4.5.5.ebuild
@@ -0,0 +1,688 @@
+# Copyright 1999-2000 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License, v2 or later
+# Author Daniel Robbins <drobbins@gentoo.org>
+# /home/cvsroot/gentoo-x86/sys-kernel/linux/linux-2.4.4.3.ebuild,v 1.1 2001/05/02 14:31:06 achim Exp
+
+# *** WARNING: This kernel package does not have XFS support! ***
+
+#OKV=original kernel version, KV=patched kernel version
+OKV=2.4.5
+KV=2.4.5-ac5
+
+if [ "${PN}" = "linux-extras" ]
+then
+ S=/usr/src/linux-${KV}
+else
+ S=${WORKDIR}/linux-${KV}
+fi
+
+# Versions of LVM
+LVMV=0.9.1_beta7
+
+LVMVARC=0.9.1_beta7
+# Versions of alsa
+AV=0.5.11
+
+# Versionos of jfs
+JFSV=0.2.1
+
+# Versions of lm_sensors and i2c
+SENV=20010530-gentoo
+I2CV=20010530-gentoo
+
+# Versions of reiserfs
+RV=20010327
+KNV="6.g"
+PIV="1.d"
+
+# Versions of xmlprocfs
+XMLV=0.3
+
+# Versions of pcmcia-cs
+PCV="3.1.25"
+
+# Version of XFS
+XFSV=20010530-gentoo
+
+[ "${PN}" = "linux" ] && DESCRIPTION="Linux kernel version ${KV}, including modules, binary tools, libraries and includes"
+[ "${PN}" = "linux-sources" ] && DESCRIPTION="Linux kernel version ${KV} - full sources"
+[ "${PN}" = "linux-extras" ] && DESCRIPTION="Linux kernel support tools and libraries"
+
+# We use build in /usr/src/linux in case of linux-extras
+# so we need no sources
+if [ "${PN}" != "linux-extras" ]
+then
+ SRC_URI="http://www.kernel.org/pub/linux/kernel/v2.4/linux-${OKV}.tar.bz2
+ http://www.kernel.org/pub/linux/kernel/people/alan/2.4/patch-${KV}.bz2
+ http://dice.mfa.kfki.hu/download/reiserfs-3.6.25-${OKV}/linux-2.4.5-pre6-knfsd.patch.bz2
+ http://dice.mfa.kfki.hu/download/reiserfs-3.6.25-${OKV}/reiserfs-quota-2.4.4.dif.bz2"
+
+# http://dice.mfa.kfki.hu/download/reiserfs-3.6.25-${OKV}/bigpatch-${OKV}.diff.bz2
+# http://oss.software.ibm.com/developerworks/opensource/jfs/project/pub/jfs-${JFSV}-patch.tar.gz
+# http://download.sourceforge.net/xmlprocfs/linux-2.4-xmlprocfs-${XMLV}.patch.gz
+# ftp://ftp.reiserfs.com/pub/reiserfs-for-2.4/linux-${OKV}-reiserfs-${RV}.patch.gz
+
+ if [ "`use i2c`" ] || [ "`use lm_sensors`" ]
+ then
+# SRC_URI="${SRC_URI} http://www.netroedge.com/~lm78/archive/i2c-${I2CV}.tar.gz"
+ SRC_URI="${SRC_URI} ftp://ftp.ibiblio.org/pub/Linux/distributions/gentoo/gentoo-sources/i2c-${I2CV}.tar.gz"
+ fi
+ if [ "`use lm_sensors`" ]
+ then
+# SRC_URI="${SRC_URI} http://www.netroedge.com/~lm78/archive/lm_sensors-${SENV}.tar.gz"
+ SRC_URI="${SRC_URI} ftp://ftp.ibiblio.org/pub/Linux/distributions/gentoo/gentoo-sources/lm_sensors-${SENV}.tar.gz"
+ fi
+ if [ "`use lvm`" ]
+ then
+ SRC_URI="${SRC_URI} ftp://ftp.sistina.com/pub/LVM/0.9.1_beta/lvm_${LVMVARC}.tar.gz"
+ fi
+ if [ "`use alsa`" ]
+ then
+ SRC_URI="${SRC_URI} ftp://ftp.alsa-project.org/pub/driver/alsa-driver-${AV}.tar.bz2"
+ fi
+ if [ "`use pcmcia-cs`" ]
+ then
+ SRC_URI="${SRC_URI} http://prdownloads.sourceforge.net/pcmcia-cs/pcmcia-cs-${PCV}.tar.gz"
+ fi
+#### XFS
+# if [ "`use xfs`" ]
+# then
+# SRC_URI="${SRC_URI} ftp://ftp.ibiblio.org/pub/Linux/distributions/gentoo/gentoo-sources/linux-${KV}-xfs-${XFSV}.diff.gz"
+# fi
+#### XFS
+fi
+
+if [ "${PN}" = "linux-extras" ]
+then
+ DEPEND=">=sys-kernel/linux-sources-${PVR}"
+ RDEPEND=" "
+#### XFS
+# if [ "`use xfs`" ]
+# then
+# DEPEND="${DEPEND} >=sys-devel/autoconf-2.13"
+# fi
+#### XFS
+ if [ "`use alsa`" ]
+ then
+ PROVIDE="virtual/alsa"
+ fi
+elif [ "${PN}" = "linux" ]
+then
+ PROVIDE="virtual/kernel"
+ RDEPEND=">=sys-apps/reiserfs-utils-3.6.25-r1"
+ DEPEND=">=sys-apps/modutils-2.4.2
+ >=sys-devel/flex-2.5.4a-r3
+ >=dev-util/yacc-1.9.1-r1"
+#### XFS
+# if [ "`use xfs`" ]
+# then
+# DEPEND="${DEPEND} >=sys-devel/autoconf-2.13"
+# fi
+#### XFS
+ if [ "`use alsa`" ]
+ then
+ PROVIDE="${PROVIDE} virtual/alsa"
+ fi
+fi
+
+HOMEPAGE="http://www.kernel.org/
+ http://www.netroedge.com/~lm78/
+ http://www.namesys.com
+ http://www.sistina.com/lvm/
+ http://www.alsa-project.org
+ http://pcmcia-cs.sourceforge.net
+ http://linux-xfs.sgi.com/projects/xfs/"
+
+# this is not pretty...
+LINUX_HOSTCFLAGS="-Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -I${S}/include"
+
+src_unpack() {
+
+ # We only need to unpack for linux and linux-sources
+
+ if [ "${PN}" != "linux-extras" ]
+ then
+
+ #unpack kernel and apply reiserfs-related patches
+ cd ${WORKDIR}
+ unpack linux-${OKV}.tar.bz2
+ try mv linux linux-${KV}
+ cd ${S}
+
+ # save this for later...
+ cp -a drivers/md/lvm-snap.h ${T}
+
+ echo "Applying ${KV} patch..."
+ try bzip2 -dc ${DISTDIR}/patch-2.4.5-ac5.bz2 | patch -p1
+
+ echo "Applying reiserfs-knfsd patch..."
+# try gzip -dc ${DISTDIR}/linux-${OKV}-knfsd-${KNV}.patch.gz | patch -p1
+ try bzip2 -dc ${DISTDIR}/linux-2.4.5-pre6-knfsd.patch.bz2 | patch -p1
+
+# echo "Applying reiserfs-procinfo patch..."
+# try gzip -dc ${DISTDIR}/linux-${OKV}-procinfo-${PIV}.patch.gz | patch -p1
+
+ echo "Applying reiserfs-quota patch..."
+# try bzip2 -dc ${DISTDIR}/reiserfs-quota-${OKV}.dif.bz2 | patch -p1
+ try bzip2 -dc ${DISTDIR}/reiserfs-quota-2.4.4.dif.bz2 | patch -p1
+
+# echo "Applying reiserfs patches..."
+# try bzip2 -dc ${DISTDIR}/bigpatch-${OKV}.diff.bz2 | patch -p1
+
+ if [ "`use lvm`" ] || [ "`use alsa`" ] || [ "`use i2c`" ] || [ "`use lm_sensors`" ] || [ "`use pcmcia-cs`" ]
+ then
+ mkdir -p ${S}/extras
+ fi
+
+#### XFS
+# if [ "`use xfs`" ]
+# then
+# cd ${S}
+# echo "Applying xfs patch..."
+# try gzip -dc ${DISTDIR}/linux-${KV}-xfs-${XFSV}.diff.gz | patch -p1
+# fi
+#### XFS
+
+ if [ "`use lvm`" ]
+ then
+ #create and apply LVM patch. The tools get built later.
+ cd ${S}/extras
+ echo "Unpacking and applying LVM patch..."
+ unpack lvm_${LVMVARC}.tar.gz
+ try cd LVM/${LVMV}
+
+ # I had to hack this in so that LVM will look in the current linux
+ # source directory instead of /usr/src/linux for stuff - pete
+ try CFLAGS=\""${CFLAGS} -I${S}/include"\" ./configure --prefix=/ --mandir=/usr/share/man --with-kernel_dir="${S}"
+
+ cd PATCHES
+ try make KERNEL_VERSION=${KV} KERNEL_DIR=${S}
+ cd ${S}
+ patch -p1 < ${FILESDIR}/${PVR}/linux-${KV}-gentoo-pre-lvm.diff
+ mv -f ${T}/lvm-snap.h drivers/md
+#### XFS
+# if [ "`use xfs`" ]
+# then
+# try patch -l -p1 < ${FILESDIR}/${PVR}/linux-${KV}-xfs-${XFSV}-pre-lvm.diff
+# fi
+#### XFS
+ # the -l option allows this patch to apply cleanly (ignore whitespace changes)
+ try patch -l -p1 < ${S}/extras/LVM/${LVMV}/PATCHES/lvm-${LVMV}-${KV}.patch
+ cd ${S}/drivers/md
+ try patch -p0 < ${FILESDIR}/${PVR}/lvm.c.diff
+ fi
+
+ if [ "`use alsa`" ]
+ then
+ #unpack alsa drivers
+ echo "Unpacking ALSA drivers..."
+ cd ${S}/extras
+ unpack alsa-driver-${AV}.tar.bz2
+ fi
+
+ if [ "`use i2c`" ] || [ "`use lm_sensors`" ]
+ then
+ if [ -z "`use i2c`" ]
+ then
+ echo "Note: Using i2c since lm_sensors is enabled."
+ fi
+ #unpack and apply the i2c patch
+ echo "Unpacking and applying i2c patch..."
+ cd ${S}/extras
+ unpack i2c-${I2CV}.tar.gz
+ try cd i2c-${I2CV}
+ try mkpatch/mkpatch.pl . ${S} > ${S}/i2c-patch
+ try cp -a Makefile Makefile.orig
+
+ cd ${S}
+ try patch -p1 < i2c-patch
+ rm -f i2c-patch
+ fi
+
+ if [ "`use lm_sensors`" ]
+ then
+ #unpack and apply the lm_sensors patch
+ echo "Unpacking and applying lm_sensors patch..."
+ cd ${S}/extras
+ unpack lm_sensors-${SENV}.tar.gz
+ try cd lm_sensors-${SENV}
+ try mkpatch/mkpatch.pl . ${S} > ${S}/lm_sensors-patch
+ try rmdir src
+ try ln -s ../.. src
+ try cp -a Makefile Makefile.orig
+
+ cd ${S}
+ try patch -p1 < lm_sensors-patch
+ rm -f lm_sensors-patch
+ fi
+
+#### XFS
+# if [ "`use xfs`" ]
+# then
+# echo "Applying xfs cleanup patch..."
+# try patch -p1 < ${FILESDIR}/${PVR}/linux-${KV}-xfs-${XFSV}-cleanup.diff
+# fi
+#### XFS
+
+ if [ "`use pcmcia-cs`" ]
+ then
+ echo "Unpacking pcmcia-cs tools..."
+ cd ${S}/extras
+ unpack pcmcia-cs-${PCV}.tar.gz
+ patch -p0 < ${FILESDIR}/${PVR}/pcmcia-cs-${PCV}-gentoo.diff
+ fi
+ #get sources ready for compilation or for sitting at /usr/src/linux
+ echo "Preparing for compilation..."
+
+ cd ${S}
+
+ #sometimes we have icky kernel symbols; this seems to get rid of them
+ try make mrproper
+
+ #fix silly permissions in tarball
+ cd ${WORKDIR}
+ chown -R 0.0 ${S}
+ chmod -R a+r-w+X,u+w ${S}
+ fi
+}
+
+src_compile() {
+
+ if [ "${PN}" != "linux-sources" ]
+ then
+ if [ "${PN}" = "linux" ]
+ then
+ #this is the configuration for the default kernel
+ try cp ${FILESDIR}/${PVR}/config.bootcomp .config
+ try yes \"\" \| make oldconfig
+ echo "Ignore any errors from the yes command above."
+ try make include/linux/version.h
+ fi
+
+ if [ "$PN" = "linux" ]
+ then
+ try make symlinks
+ fi
+
+ if [ "`use lvm`" ]
+ then
+ #LVM tools are included in the linux and linux-extras pakcages
+ cd ${S}/extras/LVM/${LVMV}
+
+ # This is needed for linux-extras
+ if [ -f "Makefile" ]
+ then
+ try make distclean
+ fi
+ # I had to hack this in so that LVM will look in the current linux
+ # source directory instead of /usr/src/linux for stuff - pete
+ try CFLAGS=\""${CFLAGS} -I${S}/include"\" ./configure --prefix=/ --mandir=/usr/share/man --with-kernel_dir="${S}"
+
+ try make
+ fi
+
+ if [ "`use i2c`" ] || [ "`use lm_sensors`" ]
+ then
+ cd ${S}/extras/i2c-${I2CV}
+ try sed -e \''s:^LINUX=.*:LINUX=src:'\' \
+ -e \''s/^COMPILE_KERNEL.*/COMPILE_KERNEL := 0/'\' \
+ -e \''s:^I2C_HEADERS.*:I2C_HEADERS=src/include:'\' \
+ -e \'"s#^DESTDIR.*#DESTDIR := ${D}#"\' \
+ Makefile.orig > Makefile
+
+ try make clean
+
+ try make
+ fi
+
+ if [ "`use lm_sensors`" ]
+ then
+ cd ${S}/extras/lm_sensors-${SENV}
+ try sed -e \''s:^LINUX=.*:LINUX=src:'\' \
+ -e \''s/^COMPILE_KERNEL.*/COMPILE_KERNEL := 0/'\' \
+ -e \''s:^I2C_HEADERS.*:I2C_HEADERS=src/include:'\' \
+ -e \'"s#^DESTDIR.*#DESTDIR := ${D}#"\' \
+ -e \''s#^PREFIX.*#PREFIX := /usr#'\' \
+ -e \''s#^MANDIR.*#MANDIR := /usr/share/man#'\' \
+ Makefile.orig > Makefile
+
+ try make clean
+
+ try make
+ fi
+
+#### XFS
+# if [ "`use xfs`" ]
+# then
+# cd ${S}/extras/xfs-${XFSV}/acl
+# try make distclean
+# rm -f include/builddefs
+# try make \
+# CPPFLAGS=\""-I${S}/include"\" \
+# configure
+# try make \
+# PKG_SBIN_DIR=/sbin \
+# PKG_INC_DIR=/usr/include/acl \
+# PKG_LIB_DIR=/usr/lib \
+# PKG_MAN_DIR=/usr/share/man \
+# CC=\""gcc -I${S}/include"\" \
+# OPTIMIZER=\""${CFLAGS}"\" \
+# DEBUG=\"\"
+#
+# cd ${S}/extras/xfs-${XFSV}/attr
+# try make distclean
+# rm -f include/builddefs
+# try make \
+# CPPFLAGS=\""-I${S}/include"\" \
+# configure
+# try make \
+# PKG_SBIN_DIR=/bin \
+# PKG_INC_DIR=/usr/include/acl \
+# PKG_LIB_DIR=/usr/lib \
+# PKG_MAN_DIR=/usr/share/man \
+# CC=\""gcc -I${S}/include"\" \
+# OPTIMIZER=\""${CFLAGS}"\" \
+# DEBUG=\"\"
+#
+# cd ${S}/extras/xfs-${XFSV}/xfsprogs
+# try make distclean
+# rm -f include/builddefs
+# try make \
+# CPPFLAGS=\""-I${S}/include"\" \
+# configure
+# try make \
+# PKG_SBIN_DIR=/sbin \
+# PKG_BIN_DIR=/usr/sbin \
+# PKG_INC_DIR=/usr/include/xfs \
+# PKG_LIB_DIR=/usr/lib \
+# PKG_MAN_DIR=/usr/share/man \
+# CC=\""gcc -I${S}/include"\" \
+# OPTIMIZER=\""${CFLAGS}"\" \
+# DEBUG=\"\"
+#
+# # dmapi and xfsdump must be built last, cuz they depend on libattr (in attr) and libxfs (in xfsprogs)
+# cd ${S}/extras/xfs-${XFSV}/dmapi
+# ln -sf ../../xfsprogs/include include/xfs
+# try make distclean
+# rm -f include/builddefs
+# try make \
+# CPPFLAGS=\""-I${S}/include -I${S}/extras/xfs-${XFSV}/dmapi/include"\" \
+# configure
+# try make \
+# PKG_INC_DIR=/usr/include/dmapi \
+# PKG_LIB_DIR=/usr/lib \
+# PKG_MAN_DIR=/usr/share/man \
+# CC=\""gcc -I${S}/include"\" \
+# OPTIMIZER=\""${CFLAGS}"\" \
+# DEBUG=\"\"
+#
+# cd ${S}/extras/xfs-${XFSV}/xfsdump
+# ln -sf ../../xfsprogs/include include/xfs
+# ln -sf ../../attr/include include/attr
+# try make distclean
+# rm -f include/builddefs
+# try make \
+# CPPFLAGS=\""-I${S}/include -I${S}/extras/xfs-${XFSV}/xfsdump/include -I${S}/extras/xfs-${XFSV}/xfsprogs/include -I${S}/extras/xfs-${XFSV}/attr/include"\" \
+# LDFLAGS=\""-L${S}/extras/xfs-${XFSV}/attr/libattr -L${S}/extras/xfs-${XFSV}/xfsprogs/libxfs -L${S}/extras/xfs-${XFSV}/xfsprogs/libhandle -lhandle"\" \
+# configure
+# try make \
+# PKG_BIN_DIR=/usr/sbin \
+# PKG_LIB_DIR=/usr/lib \
+# PKG_MAN_DIR=/usr/share/man \
+# CC=\""gcc -I${S}/include -I${S}/extras/xfs-${XFSV}/xfsprogs/include -I${S}/extras/xfs-${XFSV}/attr/include"\" \
+# OPTIMIZER=\""${CFLAGS}"\" \
+# DEBUG=\"\" \
+# LIBATTR=\""-L${S}/extras/xfs-${XFSV}/attr/libattr -lattr"\" \
+# LIBXFS=\""-L${S}/extras/xfs-${XFSV}/xfsprogs/libxfs -lxfs"\" \
+# LIBHANDLE=\""-L${S}/extras/xfs-${XFSV}/xfsprogs/libhandle -lhandle"\"
+#
+# fi
+#### XFS
+
+ cd ${S}
+
+ if [ "${PN}" == "linux" ]
+ then
+ try make HOSTCFLAGS=\""${LINUX_HOSTCFLAGS}"\" dep
+ try make HOSTCFLAGS=\""${LINUX_HOSTCFLAGS}"\" LEX=\""flex -l"\" bzImage
+ #LEX=\""flex -l"\" bzImage
+ try make HOSTCFLAGS=\""${LINUX_HOSTCFLAGS}"\" LEX=\""flex -l"\" modules
+ #LEX=\""flex -l"\" modules
+
+ fi
+ # This must come after the kernel compilation in linux
+ if [ "`use alsa`" ]
+ then
+ cd ${S}/extras/alsa-driver-${AV}
+ # This is needed for linux-extras
+ if [ -f "Makefile.conf" ]
+ then
+ try make mrproper
+ fi
+ try ./configure --with-kernel=\"${S}\" --with-isapnp=yes --with-sequencer=yes --with-oss=yes --with-cards=all
+ mkdir -p modules
+ try make
+ fi
+ if [ "`use pcmcia-cs`" ]
+ then
+ cd ${S}/extras/pcmcia-cs-${PCV}
+ # This is needed for linux-extras
+ if [ -f "Makefile" ]
+ then
+ try make clean
+ fi
+ try ./Configure -n --kernel=${S} --moddir=/lib/modules/${KV} \
+ --notrust --cardbus --nopnp --noapm --srctree --sysv --rcdir=/etc/rc.d/
+ try make all
+ fi
+ fi
+}
+
+src_install() {
+
+ # We install the alsa headers in all three packages
+ if [ "`use alsa`" ]
+ then
+ # get alsa includes
+ cd ${S}/extras/alsa-driver-${AV}
+ insinto /usr/src/linux-${KV}/include/linux
+ cd include
+ doins asound.h asoundid.h asequencer.h ainstr_*.h
+ fi
+
+ if [ "${PN}" != "linux-sources" ]
+ then
+ dodir /usr/lib
+
+ if [ "`use lvm`" ]
+ then
+ cd ${S}/extras/LVM/${LVMV}/tools
+
+ try CFLAGS=\""${CFLAGS} -I${S}/include"\" make install -e prefix=${D} mandir=${D}/usr/share/man \
+ sbindir=${D}/sbin libdir=${D}/lib
+ #no need for a static library in /lib
+ mv ${D}/lib/*.a ${D}/usr/lib
+
+ cd ${S}/extras/LVM/${LVMV}
+ docinto LVM-${LVMV}
+ dodoc ABSTRACT CHANGELOG CONTRIBUTORS COPYING COPYING.LIB FAQ KNOWN_BUGS LVM-HOWTO
+ dodoc README TODO WHATSNEW
+ fi
+
+ if [ "`use lm_sensors`" ]
+ then
+ echo "Install sensor tools..."
+ #install sensors tools
+ cd ${S}/extras/lm_sensors-${SENV}
+ make install
+ docinto lm_sensors-${SENV}
+ dodoc BACKGROUND BUGS CHANGES CONTRIBUTORS COPYING INSTALL QUICKSTART README
+ fi
+
+#### XFS
+# if [ "`use xfs`" ]
+# then
+# cd ${S}/extras/xfs-${XFSV}/acl
+# chmod +x install-sh
+# try make \
+# PKG_SBIN_DIR=${D}/sbin \
+# PKG_INC_DIR=${D}/usr/include/acl \
+# PKG_LIB_DIR=${D}/usr/lib \
+# PKG_MAN_DIR=${D}/usr/share/man \
+# install install-dev
+# rm -rf ${D}/usr/share/doc/acl
+# docinto xfs-${XFSV}/acl
+# dodoc README doc/CHANGES doc/COPYING doc/PORTING
+#
+# cd ${S}/extras/xfs-${XFSV}/attr
+# chmod +x install-sh
+# try make \
+# PKG_SBIN_DIR=${D}/bin \
+# PKG_INC_DIR=${D}/usr/include/acl \
+# PKG_LIB_DIR=${D}/usr/lib \
+# PKG_MAN_DIR=${D}/usr/share/man \
+# install install-dev
+# rm -rf ${D}/usr/share/doc/attr
+# docinto xfs-${XFSV}/attr
+# dodoc README doc/CHANGES doc/COPYING doc/PORTING
+#
+# cd ${S}/extras/xfs-${XFSV}/xfsprogs
+# chmod +x install-sh
+# try make \
+# PKG_SBIN_DIR=${D}/sbin \
+# PKG_BIN_DIR=${D}/usr/sbin \
+# PKG_INC_DIR=${D}/usr/include/xfs \
+# PKG_LIB_DIR=${D}/usr/lib \
+# PKG_MAN_DIR=${D}/usr/share/man \
+# install install-dev
+# rm -rf ${D}/usr/share/doc/xfsprogs
+# docinto xfs-${XFSV}/xfsprogs
+# dodoc README doc/CHANGES doc/COPYING docs/CREDITS doc/PORTING doc/README.LVM doc/README.quota
+#
+# cd ${S}/extras/xfs-${XFSV}/dmapi
+# chmod +x install-sh
+# try make \
+# PKG_INC_DIR=${D}/usr/include/dmapi \
+# PKG_LIB_DIR=${D}/usr/lib \
+# PKG_MAN_DIR=${D}/usr/share/man \
+# install install-dev
+# rm -rf ${D}/usr/share/doc/dmapi
+# docinto xfs-${XFSV}/dmapi
+# dodoc README doc/CHANGES doc/COPYING doc/PORTING
+#
+# cd ${S}/extras/xfs-${XFSV}/xfsdump
+# chmod +x install-sh
+# try make \
+# PKG_BIN_DIR=${D}/usr/sbin \
+# PKG_LIB_DIR=${D}/usr/lib \
+# PKG_MAN_DIR=${D}/usr/share/man \
+# install install-dev
+# rm -rf ${D}/usr/share/doc/xfsprogs
+# docinto xfs-${XFSV}/xfsdump
+# dodoc README doc/CHANGES doc/COPYING doc/PORTING doc/README.xfsdump
+# fi
+#### XFS
+
+ if [ "${PN}" = "linux" ]
+ then
+ dodir /usr/src
+
+ dodir /usr/src/linux-${KV}
+ cd ${D}/usr/src
+ #grab includes and documentation only
+ echo ">>> Copying includes and documentation..."
+ find ${S}/include ${S}/Documentation -type f -name "*~" -exec rm -vf {} \;
+ cp -ax ${S}/include ${D}/usr/src/linux-${KV}
+ cp -ax ${S}/Documentation ${D}/usr/src/linux-${KV}
+
+ #grab compiled kernel
+ dodir /boot/boot
+ insinto /boot/boot
+ cd ${S}
+ doins arch/i386/boot/bzImage
+
+ #grab modules
+ # Do we have a bug in modutils ?
+ # Meanwhile we use this quick fix (achim)
+
+ install -d ${D}/lib/modules/`uname -r`
+ try make INSTALL_MOD_PATH=${D} modules_install
+
+ depmod -b ${D} -F ${S}/System.map ${KV}
+# rm -rf ${D}/lib/modules/`uname -r`
+ #fix symlink
+ cd ${D}/lib/modules/${KV}
+ rm build
+ ln -sf /usr/src/linux-${KV} build
+ fi
+
+ if [ "`use alsa`" ]
+ then
+ cd ${S}/extras/alsa-driver-${AV}
+ docinto alsa-${AV}
+ dodoc COPYING INSTALL FAQ README WARNING
+ docinto alsa-${AV}/doc
+ dodoc doc/README.1st doc/SOUNDCARDS
+ mkdir -p ${D}/lib/modules/${KV}/misc
+ cp modules/*.o ${D}/lib/modules/${KV}/misc
+ fi
+ if [ "`use pcmcia-cs`" ]
+ then
+ #install PCMCIA modules and utilities
+ cd ${S}/extras/pcmcia-cs-${PCV}
+ try make PREFIX=${D} install
+ rm -rf ${D}/etc/rc.d
+ exeinto /etc/rc.d/init.d
+ doexe ${FILESDIR}/${PVR}/pcmcia
+ docinto pcmcia-cs-${PCV}
+ dodoc BUGS CHANGES COPYING LICENSE MAINTAINERS README README-2.4 SUPPORTED.CARDS
+ cd doc ; docinto pcmcia-cs-${PCV}/doc
+ dodoc PCMCIA-HOWTO PCMCIA-HOWTO.ps PCMCIA-PROG PCMCIA-PROG.ps
+ fi
+ else
+ dodir /usr/src
+
+ cd ${S}
+ make mrproper
+
+ if [ "`use lvm`" ]
+ then
+ cd ${S}/extras/LVM/${LVMV}
+ if [ -f Makefile ]
+ then
+ make distclean
+ fi
+ fi
+ if [ "`use lm_sensors`" ]
+ then
+ cd ${S}/extras/lm_sensors-${SENV}
+ make clean
+ fi
+
+ echo ">>> Copying sources..."
+ find ${S} -type f -name "*~" -exec rm -vf {} \;
+ cp -ax ${S} ${D}/usr/src
+
+ #don't overwrite existing .config if present
+ cd ${D}/usr/src/linux-${KV}
+ if [ -e .config ]
+ then
+ cp -a .config .config.eg
+ fi
+ fi
+}
+
+pkg_postinst() {
+ if [ "${PN}" != "linux-extras" ]
+ then
+ rm -f ${ROOT}/usr/src/linux
+ ln -sf linux-${KV} ${ROOT}/usr/src/linux
+ fi
+
+ #copy over our .config if one isn't already present
+ cd ${ROOT}/usr/src/linux-${KV}
+ if [ "${PN}" = "linux-sources" ] && [ -e .config.eg ] && [ ! -e .config ]
+ then
+ cp -a .config.eg .config
+ fi
+}
diff --git a/sys-kernel/linux-sources/files/2.4.5.5/linux-2.4.5-ac5-gentoo-pre-lvm.diff b/sys-kernel/linux-sources/files/2.4.5.5/linux-2.4.5-ac5-gentoo-pre-lvm.diff
new file mode 100644
index 000000000000..7322f1852a6c
--- /dev/null
+++ b/sys-kernel/linux-sources/files/2.4.5.5/linux-2.4.5-ac5-gentoo-pre-lvm.diff
@@ -0,0 +1,11 @@
+--- linux-2.4.5-ac5/drivers/md/Makefile.orig Sat Jun 2 00:49:51 2001
++++ linux-2.4.5-ac5/drivers/md/Makefile Sat Jun 2 00:50:01 2001
+@@ -6,7 +6,7 @@
+
+ export-objs := md.o xor.o
+ list-multi := lvm-mod.o
+-lvm-mod-objs := lvm.o lvm-snap.o lvm-fs.o
++lvm-mod-objs := lvm.o lvm-snap.o
+
+ # Note: link order is important. All raid personalities
+ # and xor.o must come before md.o, as they each initialise
diff --git a/sys-kernel/linux-sources/files/2.4.5.5/lvm.c.diff b/sys-kernel/linux-sources/files/2.4.5.5/lvm.c.diff
new file mode 100644
index 000000000000..6392671b8f7e
--- /dev/null
+++ b/sys-kernel/linux-sources/files/2.4.5.5/lvm.c.diff
@@ -0,0 +1,20 @@
+--- lvm.c.orig Sat Apr 28 10:48:37 2001
++++ lvm.c Sat Apr 28 11:07:07 2001
+@@ -1791,7 +1791,7 @@
+ int max_hardblocksize = 0, hardblocksize;
+
+ for (le = 0; le < lv->lv_allocated_le; le++) {
+- hardblocksize = get_hardblocksize(lv->lv_current_pe[le].dev);
++ hardblocksize = get_hardsect_size(lv->lv_current_pe[le].dev);
+ if (hardblocksize == 0)
+ hardblocksize = 512;
+ if (hardblocksize > max_hardblocksize)
+@@ -1801,7 +1801,7 @@
+ if (lv->lv_access & LV_SNAPSHOT) {
+ for (e = 0; e < lv->lv_remap_end; e++) {
+ hardblocksize =
+- get_hardblocksize(
++ get_hardsect_size(
+ lv->lv_block_exception[e].rdev_new);
+ if (hardblocksize == 0)
+ hardblocksize = 512;
diff --git a/sys-kernel/linux-sources/files/2.4.5.5/pcmcia b/sys-kernel/linux-sources/files/2.4.5.5/pcmcia
new file mode 100755
index 000000000000..4cfb368ff68a
--- /dev/null
+++ b/sys-kernel/linux-sources/files/2.4.5.5/pcmcia
@@ -0,0 +1,97 @@
+#!/bin/sh
+#RCUPDATE:3 4:69:This line is required for script management
+
+. /etc/rc.d/config/functions
+
+SERVICE=pcmcia
+opts="start stop restart"
+
+ # Slackware startup options go right here:
+ # Should be either i82365 or tcic
+ PCIC=i82365
+ # 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=
+
+cleanup()
+{
+ while read SN CLASS MOD INST DEV EXTRA ; do
+ if [ "$SN" != "Socket" ] ; then
+ /etc/pcmcia/$CLASS stop $DEV 2> /dev/null
+ fi
+ done
+}
+
+start() {
+ if [ -d /var/lib/pcmcia ] ; then
+ SC=/var/lib/pcmcia/scheme
+ RUN=/var/lib/pcmcia
+ else
+ SC=/var/run/pcmcia-scheme
+ RUN=/var/run
+ fi
+ 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
+ fgrep -q pcmcia /proc/devices
+ if [ $? -ne 0 ] ; then
+ if [ -d /lib/modules/preferred ] ; then
+ PC=/lib/modules/preferred/pcmcia
+ else
+ PC=/lib/modules/`uname -r`/pcmcia
+ fi
+ if [ -d $PC ] ; then
+ echo -n " modules"
+ /sbin/insmod $PC/pcmcia_core.o $CORE_OPTS 2>&1 > /dev/null
+ /sbin/insmod $PC/$PCIC.o $PCIC_OPTS 2>&1 > /dev/null
+ /sbin/insmod $PC/ds.o 2>&1 > /dev/null
+ 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
+ /sbin/cardmgr $CARDMGR_OPTS 2>&1 > /dev/null
+ fi
+ touch /var/lock/subsys/pcmcia 2>&1 > /dev/null
+}
+
+stop() {
+ 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
+ killall -q "CardBus Watcher"
+ if fgrep -q "ds " /proc/modules ; then
+ echo -n " modules"
+ /sbin/rmmod ds
+ /sbin/rmmod $PCIC
+ /sbin/rmmod pcmcia_core
+ fi
+ rm -f /var/lock/subsys/pcmcia
+}
+
+restart() {
+ stop
+ start
+}
+
+doservice ${@}
+
diff --git a/sys-kernel/linux-sources/files/2.4.5.5/pcmcia-cs-3.1.25-gentoo.diff b/sys-kernel/linux-sources/files/2.4.5.5/pcmcia-cs-3.1.25-gentoo.diff
new file mode 100644
index 000000000000..db555693924c
--- /dev/null
+++ b/sys-kernel/linux-sources/files/2.4.5.5/pcmcia-cs-3.1.25-gentoo.diff
@@ -0,0 +1,11 @@
+--- pcmcia-cs-3.1.25/cardmgr/cardinfo.c~ Wed Feb 14 04:25:48 2001
++++ pcmcia-cs-3.1.25/cardmgr/cardinfo.c Fri May 4 11:43:32 2001
+@@ -40,7 +40,7 @@
+ #include <fcntl.h>
+ #include <errno.h>
+ #include <signal.h>
+-#include <sys/time.h>
++#include <time.h>
+ #include <sys/ioctl.h>
+ #include <sys/stat.h>
+ #include <sys/file.h>
diff --git a/sys-kernel/linux-sources/files/digest-linux-sources-2.4.5.5 b/sys-kernel/linux-sources/files/digest-linux-sources-2.4.5.5
new file mode 100644
index 000000000000..a3ecb6bc9376
--- /dev/null
+++ b/sys-kernel/linux-sources/files/digest-linux-sources-2.4.5.5
@@ -0,0 +1,9 @@
+MD5 ff807499928379c4274a307855b9eeeb alsa-driver-0.5.11.tar.bz2
+MD5 5c8144c6543b1900dd9b99dde700d4ae i2c-20010530-gentoo.tar.gz
+MD5 25c825f461bb28cee03f7b216d763d6b linux-2.4.5-pre6-knfsd.patch.bz2
+MD5 923e94a6a4af9c8265bc1d66906659e4 linux-2.4.5.tar.bz2
+MD5 85be98dae125cb3d9398ba10cb595fc9 lm_sensors-20010530-gentoo.tar.gz
+MD5 1ce6fb607f26dc20d4c77461057acb3c lvm_0.9.1_beta7.tar.gz
+MD5 f16c87bc6f40c783625398c03ecbe38a patch-2.4.5-ac5.bz2
+MD5 4ec7264c95d17bb86c3a94f0a12ed11d pcmcia-cs-3.1.25.tar.gz
+MD5 e2c8f8769e698202e273498749c40186 reiserfs-quota-2.4.4.dif.bz2
diff --git a/sys-kernel/linux-sources/linux-sources-2.4.5.5.ebuild b/sys-kernel/linux-sources/linux-sources-2.4.5.5.ebuild
new file mode 100644
index 000000000000..31f64083c4ca
--- /dev/null
+++ b/sys-kernel/linux-sources/linux-sources-2.4.5.5.ebuild
@@ -0,0 +1,688 @@
+# Copyright 1999-2000 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License, v2 or later
+# Author Daniel Robbins <drobbins@gentoo.org>
+# /home/cvsroot/gentoo-x86/sys-kernel/linux/linux-2.4.4.3.ebuild,v 1.1 2001/05/02 14:31:06 achim Exp
+
+# *** WARNING: This kernel package does not have XFS support! ***
+
+#OKV=original kernel version, KV=patched kernel version
+OKV=2.4.5
+KV=2.4.5-ac5
+
+if [ "${PN}" = "linux-extras" ]
+then
+ S=/usr/src/linux-${KV}
+else
+ S=${WORKDIR}/linux-${KV}
+fi
+
+# Versions of LVM
+LVMV=0.9.1_beta7
+
+LVMVARC=0.9.1_beta7
+# Versions of alsa
+AV=0.5.11
+
+# Versionos of jfs
+JFSV=0.2.1
+
+# Versions of lm_sensors and i2c
+SENV=20010530-gentoo
+I2CV=20010530-gentoo
+
+# Versions of reiserfs
+RV=20010327
+KNV="6.g"
+PIV="1.d"
+
+# Versions of xmlprocfs
+XMLV=0.3
+
+# Versions of pcmcia-cs
+PCV="3.1.25"
+
+# Version of XFS
+XFSV=20010530-gentoo
+
+[ "${PN}" = "linux" ] && DESCRIPTION="Linux kernel version ${KV}, including modules, binary tools, libraries and includes"
+[ "${PN}" = "linux-sources" ] && DESCRIPTION="Linux kernel version ${KV} - full sources"
+[ "${PN}" = "linux-extras" ] && DESCRIPTION="Linux kernel support tools and libraries"
+
+# We use build in /usr/src/linux in case of linux-extras
+# so we need no sources
+if [ "${PN}" != "linux-extras" ]
+then
+ SRC_URI="http://www.kernel.org/pub/linux/kernel/v2.4/linux-${OKV}.tar.bz2
+ http://www.kernel.org/pub/linux/kernel/people/alan/2.4/patch-${KV}.bz2
+ http://dice.mfa.kfki.hu/download/reiserfs-3.6.25-${OKV}/linux-2.4.5-pre6-knfsd.patch.bz2
+ http://dice.mfa.kfki.hu/download/reiserfs-3.6.25-${OKV}/reiserfs-quota-2.4.4.dif.bz2"
+
+# http://dice.mfa.kfki.hu/download/reiserfs-3.6.25-${OKV}/bigpatch-${OKV}.diff.bz2
+# http://oss.software.ibm.com/developerworks/opensource/jfs/project/pub/jfs-${JFSV}-patch.tar.gz
+# http://download.sourceforge.net/xmlprocfs/linux-2.4-xmlprocfs-${XMLV}.patch.gz
+# ftp://ftp.reiserfs.com/pub/reiserfs-for-2.4/linux-${OKV}-reiserfs-${RV}.patch.gz
+
+ if [ "`use i2c`" ] || [ "`use lm_sensors`" ]
+ then
+# SRC_URI="${SRC_URI} http://www.netroedge.com/~lm78/archive/i2c-${I2CV}.tar.gz"
+ SRC_URI="${SRC_URI} ftp://ftp.ibiblio.org/pub/Linux/distributions/gentoo/gentoo-sources/i2c-${I2CV}.tar.gz"
+ fi
+ if [ "`use lm_sensors`" ]
+ then
+# SRC_URI="${SRC_URI} http://www.netroedge.com/~lm78/archive/lm_sensors-${SENV}.tar.gz"
+ SRC_URI="${SRC_URI} ftp://ftp.ibiblio.org/pub/Linux/distributions/gentoo/gentoo-sources/lm_sensors-${SENV}.tar.gz"
+ fi
+ if [ "`use lvm`" ]
+ then
+ SRC_URI="${SRC_URI} ftp://ftp.sistina.com/pub/LVM/0.9.1_beta/lvm_${LVMVARC}.tar.gz"
+ fi
+ if [ "`use alsa`" ]
+ then
+ SRC_URI="${SRC_URI} ftp://ftp.alsa-project.org/pub/driver/alsa-driver-${AV}.tar.bz2"
+ fi
+ if [ "`use pcmcia-cs`" ]
+ then
+ SRC_URI="${SRC_URI} http://prdownloads.sourceforge.net/pcmcia-cs/pcmcia-cs-${PCV}.tar.gz"
+ fi
+#### XFS
+# if [ "`use xfs`" ]
+# then
+# SRC_URI="${SRC_URI} ftp://ftp.ibiblio.org/pub/Linux/distributions/gentoo/gentoo-sources/linux-${KV}-xfs-${XFSV}.diff.gz"
+# fi
+#### XFS
+fi
+
+if [ "${PN}" = "linux-extras" ]
+then
+ DEPEND=">=sys-kernel/linux-sources-${PVR}"
+ RDEPEND=" "
+#### XFS
+# if [ "`use xfs`" ]
+# then
+# DEPEND="${DEPEND} >=sys-devel/autoconf-2.13"
+# fi
+#### XFS
+ if [ "`use alsa`" ]
+ then
+ PROVIDE="virtual/alsa"
+ fi
+elif [ "${PN}" = "linux" ]
+then
+ PROVIDE="virtual/kernel"
+ RDEPEND=">=sys-apps/reiserfs-utils-3.6.25-r1"
+ DEPEND=">=sys-apps/modutils-2.4.2
+ >=sys-devel/flex-2.5.4a-r3
+ >=dev-util/yacc-1.9.1-r1"
+#### XFS
+# if [ "`use xfs`" ]
+# then
+# DEPEND="${DEPEND} >=sys-devel/autoconf-2.13"
+# fi
+#### XFS
+ if [ "`use alsa`" ]
+ then
+ PROVIDE="${PROVIDE} virtual/alsa"
+ fi
+fi
+
+HOMEPAGE="http://www.kernel.org/
+ http://www.netroedge.com/~lm78/
+ http://www.namesys.com
+ http://www.sistina.com/lvm/
+ http://www.alsa-project.org
+ http://pcmcia-cs.sourceforge.net
+ http://linux-xfs.sgi.com/projects/xfs/"
+
+# this is not pretty...
+LINUX_HOSTCFLAGS="-Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -I${S}/include"
+
+src_unpack() {
+
+ # We only need to unpack for linux and linux-sources
+
+ if [ "${PN}" != "linux-extras" ]
+ then
+
+ #unpack kernel and apply reiserfs-related patches
+ cd ${WORKDIR}
+ unpack linux-${OKV}.tar.bz2
+ try mv linux linux-${KV}
+ cd ${S}
+
+ # save this for later...
+ cp -a drivers/md/lvm-snap.h ${T}
+
+ echo "Applying ${KV} patch..."
+ try bzip2 -dc ${DISTDIR}/patch-2.4.5-ac5.bz2 | patch -p1
+
+ echo "Applying reiserfs-knfsd patch..."
+# try gzip -dc ${DISTDIR}/linux-${OKV}-knfsd-${KNV}.patch.gz | patch -p1
+ try bzip2 -dc ${DISTDIR}/linux-2.4.5-pre6-knfsd.patch.bz2 | patch -p1
+
+# echo "Applying reiserfs-procinfo patch..."
+# try gzip -dc ${DISTDIR}/linux-${OKV}-procinfo-${PIV}.patch.gz | patch -p1
+
+ echo "Applying reiserfs-quota patch..."
+# try bzip2 -dc ${DISTDIR}/reiserfs-quota-${OKV}.dif.bz2 | patch -p1
+ try bzip2 -dc ${DISTDIR}/reiserfs-quota-2.4.4.dif.bz2 | patch -p1
+
+# echo "Applying reiserfs patches..."
+# try bzip2 -dc ${DISTDIR}/bigpatch-${OKV}.diff.bz2 | patch -p1
+
+ if [ "`use lvm`" ] || [ "`use alsa`" ] || [ "`use i2c`" ] || [ "`use lm_sensors`" ] || [ "`use pcmcia-cs`" ]
+ then
+ mkdir -p ${S}/extras
+ fi
+
+#### XFS
+# if [ "`use xfs`" ]
+# then
+# cd ${S}
+# echo "Applying xfs patch..."
+# try gzip -dc ${DISTDIR}/linux-${KV}-xfs-${XFSV}.diff.gz | patch -p1
+# fi
+#### XFS
+
+ if [ "`use lvm`" ]
+ then
+ #create and apply LVM patch. The tools get built later.
+ cd ${S}/extras
+ echo "Unpacking and applying LVM patch..."
+ unpack lvm_${LVMVARC}.tar.gz
+ try cd LVM/${LVMV}
+
+ # I had to hack this in so that LVM will look in the current linux
+ # source directory instead of /usr/src/linux for stuff - pete
+ try CFLAGS=\""${CFLAGS} -I${S}/include"\" ./configure --prefix=/ --mandir=/usr/share/man --with-kernel_dir="${S}"
+
+ cd PATCHES
+ try make KERNEL_VERSION=${KV} KERNEL_DIR=${S}
+ cd ${S}
+ patch -p1 < ${FILESDIR}/${PVR}/linux-${KV}-gentoo-pre-lvm.diff
+ mv -f ${T}/lvm-snap.h drivers/md
+#### XFS
+# if [ "`use xfs`" ]
+# then
+# try patch -l -p1 < ${FILESDIR}/${PVR}/linux-${KV}-xfs-${XFSV}-pre-lvm.diff
+# fi
+#### XFS
+ # the -l option allows this patch to apply cleanly (ignore whitespace changes)
+ try patch -l -p1 < ${S}/extras/LVM/${LVMV}/PATCHES/lvm-${LVMV}-${KV}.patch
+ cd ${S}/drivers/md
+ try patch -p0 < ${FILESDIR}/${PVR}/lvm.c.diff
+ fi
+
+ if [ "`use alsa`" ]
+ then
+ #unpack alsa drivers
+ echo "Unpacking ALSA drivers..."
+ cd ${S}/extras
+ unpack alsa-driver-${AV}.tar.bz2
+ fi
+
+ if [ "`use i2c`" ] || [ "`use lm_sensors`" ]
+ then
+ if [ -z "`use i2c`" ]
+ then
+ echo "Note: Using i2c since lm_sensors is enabled."
+ fi
+ #unpack and apply the i2c patch
+ echo "Unpacking and applying i2c patch..."
+ cd ${S}/extras
+ unpack i2c-${I2CV}.tar.gz
+ try cd i2c-${I2CV}
+ try mkpatch/mkpatch.pl . ${S} > ${S}/i2c-patch
+ try cp -a Makefile Makefile.orig
+
+ cd ${S}
+ try patch -p1 < i2c-patch
+ rm -f i2c-patch
+ fi
+
+ if [ "`use lm_sensors`" ]
+ then
+ #unpack and apply the lm_sensors patch
+ echo "Unpacking and applying lm_sensors patch..."
+ cd ${S}/extras
+ unpack lm_sensors-${SENV}.tar.gz
+ try cd lm_sensors-${SENV}
+ try mkpatch/mkpatch.pl . ${S} > ${S}/lm_sensors-patch
+ try rmdir src
+ try ln -s ../.. src
+ try cp -a Makefile Makefile.orig
+
+ cd ${S}
+ try patch -p1 < lm_sensors-patch
+ rm -f lm_sensors-patch
+ fi
+
+#### XFS
+# if [ "`use xfs`" ]
+# then
+# echo "Applying xfs cleanup patch..."
+# try patch -p1 < ${FILESDIR}/${PVR}/linux-${KV}-xfs-${XFSV}-cleanup.diff
+# fi
+#### XFS
+
+ if [ "`use pcmcia-cs`" ]
+ then
+ echo "Unpacking pcmcia-cs tools..."
+ cd ${S}/extras
+ unpack pcmcia-cs-${PCV}.tar.gz
+ patch -p0 < ${FILESDIR}/${PVR}/pcmcia-cs-${PCV}-gentoo.diff
+ fi
+ #get sources ready for compilation or for sitting at /usr/src/linux
+ echo "Preparing for compilation..."
+
+ cd ${S}
+
+ #sometimes we have icky kernel symbols; this seems to get rid of them
+ try make mrproper
+
+ #fix silly permissions in tarball
+ cd ${WORKDIR}
+ chown -R 0.0 ${S}
+ chmod -R a+r-w+X,u+w ${S}
+ fi
+}
+
+src_compile() {
+
+ if [ "${PN}" != "linux-sources" ]
+ then
+ if [ "${PN}" = "linux" ]
+ then
+ #this is the configuration for the default kernel
+ try cp ${FILESDIR}/${PVR}/config.bootcomp .config
+ try yes \"\" \| make oldconfig
+ echo "Ignore any errors from the yes command above."
+ try make include/linux/version.h
+ fi
+
+ if [ "$PN" = "linux" ]
+ then
+ try make symlinks
+ fi
+
+ if [ "`use lvm`" ]
+ then
+ #LVM tools are included in the linux and linux-extras pakcages
+ cd ${S}/extras/LVM/${LVMV}
+
+ # This is needed for linux-extras
+ if [ -f "Makefile" ]
+ then
+ try make distclean
+ fi
+ # I had to hack this in so that LVM will look in the current linux
+ # source directory instead of /usr/src/linux for stuff - pete
+ try CFLAGS=\""${CFLAGS} -I${S}/include"\" ./configure --prefix=/ --mandir=/usr/share/man --with-kernel_dir="${S}"
+
+ try make
+ fi
+
+ if [ "`use i2c`" ] || [ "`use lm_sensors`" ]
+ then
+ cd ${S}/extras/i2c-${I2CV}
+ try sed -e \''s:^LINUX=.*:LINUX=src:'\' \
+ -e \''s/^COMPILE_KERNEL.*/COMPILE_KERNEL := 0/'\' \
+ -e \''s:^I2C_HEADERS.*:I2C_HEADERS=src/include:'\' \
+ -e \'"s#^DESTDIR.*#DESTDIR := ${D}#"\' \
+ Makefile.orig > Makefile
+
+ try make clean
+
+ try make
+ fi
+
+ if [ "`use lm_sensors`" ]
+ then
+ cd ${S}/extras/lm_sensors-${SENV}
+ try sed -e \''s:^LINUX=.*:LINUX=src:'\' \
+ -e \''s/^COMPILE_KERNEL.*/COMPILE_KERNEL := 0/'\' \
+ -e \''s:^I2C_HEADERS.*:I2C_HEADERS=src/include:'\' \
+ -e \'"s#^DESTDIR.*#DESTDIR := ${D}#"\' \
+ -e \''s#^PREFIX.*#PREFIX := /usr#'\' \
+ -e \''s#^MANDIR.*#MANDIR := /usr/share/man#'\' \
+ Makefile.orig > Makefile
+
+ try make clean
+
+ try make
+ fi
+
+#### XFS
+# if [ "`use xfs`" ]
+# then
+# cd ${S}/extras/xfs-${XFSV}/acl
+# try make distclean
+# rm -f include/builddefs
+# try make \
+# CPPFLAGS=\""-I${S}/include"\" \
+# configure
+# try make \
+# PKG_SBIN_DIR=/sbin \
+# PKG_INC_DIR=/usr/include/acl \
+# PKG_LIB_DIR=/usr/lib \
+# PKG_MAN_DIR=/usr/share/man \
+# CC=\""gcc -I${S}/include"\" \
+# OPTIMIZER=\""${CFLAGS}"\" \
+# DEBUG=\"\"
+#
+# cd ${S}/extras/xfs-${XFSV}/attr
+# try make distclean
+# rm -f include/builddefs
+# try make \
+# CPPFLAGS=\""-I${S}/include"\" \
+# configure
+# try make \
+# PKG_SBIN_DIR=/bin \
+# PKG_INC_DIR=/usr/include/acl \
+# PKG_LIB_DIR=/usr/lib \
+# PKG_MAN_DIR=/usr/share/man \
+# CC=\""gcc -I${S}/include"\" \
+# OPTIMIZER=\""${CFLAGS}"\" \
+# DEBUG=\"\"
+#
+# cd ${S}/extras/xfs-${XFSV}/xfsprogs
+# try make distclean
+# rm -f include/builddefs
+# try make \
+# CPPFLAGS=\""-I${S}/include"\" \
+# configure
+# try make \
+# PKG_SBIN_DIR=/sbin \
+# PKG_BIN_DIR=/usr/sbin \
+# PKG_INC_DIR=/usr/include/xfs \
+# PKG_LIB_DIR=/usr/lib \
+# PKG_MAN_DIR=/usr/share/man \
+# CC=\""gcc -I${S}/include"\" \
+# OPTIMIZER=\""${CFLAGS}"\" \
+# DEBUG=\"\"
+#
+# # dmapi and xfsdump must be built last, cuz they depend on libattr (in attr) and libxfs (in xfsprogs)
+# cd ${S}/extras/xfs-${XFSV}/dmapi
+# ln -sf ../../xfsprogs/include include/xfs
+# try make distclean
+# rm -f include/builddefs
+# try make \
+# CPPFLAGS=\""-I${S}/include -I${S}/extras/xfs-${XFSV}/dmapi/include"\" \
+# configure
+# try make \
+# PKG_INC_DIR=/usr/include/dmapi \
+# PKG_LIB_DIR=/usr/lib \
+# PKG_MAN_DIR=/usr/share/man \
+# CC=\""gcc -I${S}/include"\" \
+# OPTIMIZER=\""${CFLAGS}"\" \
+# DEBUG=\"\"
+#
+# cd ${S}/extras/xfs-${XFSV}/xfsdump
+# ln -sf ../../xfsprogs/include include/xfs
+# ln -sf ../../attr/include include/attr
+# try make distclean
+# rm -f include/builddefs
+# try make \
+# CPPFLAGS=\""-I${S}/include -I${S}/extras/xfs-${XFSV}/xfsdump/include -I${S}/extras/xfs-${XFSV}/xfsprogs/include -I${S}/extras/xfs-${XFSV}/attr/include"\" \
+# LDFLAGS=\""-L${S}/extras/xfs-${XFSV}/attr/libattr -L${S}/extras/xfs-${XFSV}/xfsprogs/libxfs -L${S}/extras/xfs-${XFSV}/xfsprogs/libhandle -lhandle"\" \
+# configure
+# try make \
+# PKG_BIN_DIR=/usr/sbin \
+# PKG_LIB_DIR=/usr/lib \
+# PKG_MAN_DIR=/usr/share/man \
+# CC=\""gcc -I${S}/include -I${S}/extras/xfs-${XFSV}/xfsprogs/include -I${S}/extras/xfs-${XFSV}/attr/include"\" \
+# OPTIMIZER=\""${CFLAGS}"\" \
+# DEBUG=\"\" \
+# LIBATTR=\""-L${S}/extras/xfs-${XFSV}/attr/libattr -lattr"\" \
+# LIBXFS=\""-L${S}/extras/xfs-${XFSV}/xfsprogs/libxfs -lxfs"\" \
+# LIBHANDLE=\""-L${S}/extras/xfs-${XFSV}/xfsprogs/libhandle -lhandle"\"
+#
+# fi
+#### XFS
+
+ cd ${S}
+
+ if [ "${PN}" == "linux" ]
+ then
+ try make HOSTCFLAGS=\""${LINUX_HOSTCFLAGS}"\" dep
+ try make HOSTCFLAGS=\""${LINUX_HOSTCFLAGS}"\" LEX=\""flex -l"\" bzImage
+ #LEX=\""flex -l"\" bzImage
+ try make HOSTCFLAGS=\""${LINUX_HOSTCFLAGS}"\" LEX=\""flex -l"\" modules
+ #LEX=\""flex -l"\" modules
+
+ fi
+ # This must come after the kernel compilation in linux
+ if [ "`use alsa`" ]
+ then
+ cd ${S}/extras/alsa-driver-${AV}
+ # This is needed for linux-extras
+ if [ -f "Makefile.conf" ]
+ then
+ try make mrproper
+ fi
+ try ./configure --with-kernel=\"${S}\" --with-isapnp=yes --with-sequencer=yes --with-oss=yes --with-cards=all
+ mkdir -p modules
+ try make
+ fi
+ if [ "`use pcmcia-cs`" ]
+ then
+ cd ${S}/extras/pcmcia-cs-${PCV}
+ # This is needed for linux-extras
+ if [ -f "Makefile" ]
+ then
+ try make clean
+ fi
+ try ./Configure -n --kernel=${S} --moddir=/lib/modules/${KV} \
+ --notrust --cardbus --nopnp --noapm --srctree --sysv --rcdir=/etc/rc.d/
+ try make all
+ fi
+ fi
+}
+
+src_install() {
+
+ # We install the alsa headers in all three packages
+ if [ "`use alsa`" ]
+ then
+ # get alsa includes
+ cd ${S}/extras/alsa-driver-${AV}
+ insinto /usr/src/linux-${KV}/include/linux
+ cd include
+ doins asound.h asoundid.h asequencer.h ainstr_*.h
+ fi
+
+ if [ "${PN}" != "linux-sources" ]
+ then
+ dodir /usr/lib
+
+ if [ "`use lvm`" ]
+ then
+ cd ${S}/extras/LVM/${LVMV}/tools
+
+ try CFLAGS=\""${CFLAGS} -I${S}/include"\" make install -e prefix=${D} mandir=${D}/usr/share/man \
+ sbindir=${D}/sbin libdir=${D}/lib
+ #no need for a static library in /lib
+ mv ${D}/lib/*.a ${D}/usr/lib
+
+ cd ${S}/extras/LVM/${LVMV}
+ docinto LVM-${LVMV}
+ dodoc ABSTRACT CHANGELOG CONTRIBUTORS COPYING COPYING.LIB FAQ KNOWN_BUGS LVM-HOWTO
+ dodoc README TODO WHATSNEW
+ fi
+
+ if [ "`use lm_sensors`" ]
+ then
+ echo "Install sensor tools..."
+ #install sensors tools
+ cd ${S}/extras/lm_sensors-${SENV}
+ make install
+ docinto lm_sensors-${SENV}
+ dodoc BACKGROUND BUGS CHANGES CONTRIBUTORS COPYING INSTALL QUICKSTART README
+ fi
+
+#### XFS
+# if [ "`use xfs`" ]
+# then
+# cd ${S}/extras/xfs-${XFSV}/acl
+# chmod +x install-sh
+# try make \
+# PKG_SBIN_DIR=${D}/sbin \
+# PKG_INC_DIR=${D}/usr/include/acl \
+# PKG_LIB_DIR=${D}/usr/lib \
+# PKG_MAN_DIR=${D}/usr/share/man \
+# install install-dev
+# rm -rf ${D}/usr/share/doc/acl
+# docinto xfs-${XFSV}/acl
+# dodoc README doc/CHANGES doc/COPYING doc/PORTING
+#
+# cd ${S}/extras/xfs-${XFSV}/attr
+# chmod +x install-sh
+# try make \
+# PKG_SBIN_DIR=${D}/bin \
+# PKG_INC_DIR=${D}/usr/include/acl \
+# PKG_LIB_DIR=${D}/usr/lib \
+# PKG_MAN_DIR=${D}/usr/share/man \
+# install install-dev
+# rm -rf ${D}/usr/share/doc/attr
+# docinto xfs-${XFSV}/attr
+# dodoc README doc/CHANGES doc/COPYING doc/PORTING
+#
+# cd ${S}/extras/xfs-${XFSV}/xfsprogs
+# chmod +x install-sh
+# try make \
+# PKG_SBIN_DIR=${D}/sbin \
+# PKG_BIN_DIR=${D}/usr/sbin \
+# PKG_INC_DIR=${D}/usr/include/xfs \
+# PKG_LIB_DIR=${D}/usr/lib \
+# PKG_MAN_DIR=${D}/usr/share/man \
+# install install-dev
+# rm -rf ${D}/usr/share/doc/xfsprogs
+# docinto xfs-${XFSV}/xfsprogs
+# dodoc README doc/CHANGES doc/COPYING docs/CREDITS doc/PORTING doc/README.LVM doc/README.quota
+#
+# cd ${S}/extras/xfs-${XFSV}/dmapi
+# chmod +x install-sh
+# try make \
+# PKG_INC_DIR=${D}/usr/include/dmapi \
+# PKG_LIB_DIR=${D}/usr/lib \
+# PKG_MAN_DIR=${D}/usr/share/man \
+# install install-dev
+# rm -rf ${D}/usr/share/doc/dmapi
+# docinto xfs-${XFSV}/dmapi
+# dodoc README doc/CHANGES doc/COPYING doc/PORTING
+#
+# cd ${S}/extras/xfs-${XFSV}/xfsdump
+# chmod +x install-sh
+# try make \
+# PKG_BIN_DIR=${D}/usr/sbin \
+# PKG_LIB_DIR=${D}/usr/lib \
+# PKG_MAN_DIR=${D}/usr/share/man \
+# install install-dev
+# rm -rf ${D}/usr/share/doc/xfsprogs
+# docinto xfs-${XFSV}/xfsdump
+# dodoc README doc/CHANGES doc/COPYING doc/PORTING doc/README.xfsdump
+# fi
+#### XFS
+
+ if [ "${PN}" = "linux" ]
+ then
+ dodir /usr/src
+
+ dodir /usr/src/linux-${KV}
+ cd ${D}/usr/src
+ #grab includes and documentation only
+ echo ">>> Copying includes and documentation..."
+ find ${S}/include ${S}/Documentation -type f -name "*~" -exec rm -vf {} \;
+ cp -ax ${S}/include ${D}/usr/src/linux-${KV}
+ cp -ax ${S}/Documentation ${D}/usr/src/linux-${KV}
+
+ #grab compiled kernel
+ dodir /boot/boot
+ insinto /boot/boot
+ cd ${S}
+ doins arch/i386/boot/bzImage
+
+ #grab modules
+ # Do we have a bug in modutils ?
+ # Meanwhile we use this quick fix (achim)
+
+ install -d ${D}/lib/modules/`uname -r`
+ try make INSTALL_MOD_PATH=${D} modules_install
+
+ depmod -b ${D} -F ${S}/System.map ${KV}
+# rm -rf ${D}/lib/modules/`uname -r`
+ #fix symlink
+ cd ${D}/lib/modules/${KV}
+ rm build
+ ln -sf /usr/src/linux-${KV} build
+ fi
+
+ if [ "`use alsa`" ]
+ then
+ cd ${S}/extras/alsa-driver-${AV}
+ docinto alsa-${AV}
+ dodoc COPYING INSTALL FAQ README WARNING
+ docinto alsa-${AV}/doc
+ dodoc doc/README.1st doc/SOUNDCARDS
+ mkdir -p ${D}/lib/modules/${KV}/misc
+ cp modules/*.o ${D}/lib/modules/${KV}/misc
+ fi
+ if [ "`use pcmcia-cs`" ]
+ then
+ #install PCMCIA modules and utilities
+ cd ${S}/extras/pcmcia-cs-${PCV}
+ try make PREFIX=${D} install
+ rm -rf ${D}/etc/rc.d
+ exeinto /etc/rc.d/init.d
+ doexe ${FILESDIR}/${PVR}/pcmcia
+ docinto pcmcia-cs-${PCV}
+ dodoc BUGS CHANGES COPYING LICENSE MAINTAINERS README README-2.4 SUPPORTED.CARDS
+ cd doc ; docinto pcmcia-cs-${PCV}/doc
+ dodoc PCMCIA-HOWTO PCMCIA-HOWTO.ps PCMCIA-PROG PCMCIA-PROG.ps
+ fi
+ else
+ dodir /usr/src
+
+ cd ${S}
+ make mrproper
+
+ if [ "`use lvm`" ]
+ then
+ cd ${S}/extras/LVM/${LVMV}
+ if [ -f Makefile ]
+ then
+ make distclean
+ fi
+ fi
+ if [ "`use lm_sensors`" ]
+ then
+ cd ${S}/extras/lm_sensors-${SENV}
+ make clean
+ fi
+
+ echo ">>> Copying sources..."
+ find ${S} -type f -name "*~" -exec rm -vf {} \;
+ cp -ax ${S} ${D}/usr/src
+
+ #don't overwrite existing .config if present
+ cd ${D}/usr/src/linux-${KV}
+ if [ -e .config ]
+ then
+ cp -a .config .config.eg
+ fi
+ fi
+}
+
+pkg_postinst() {
+ if [ "${PN}" != "linux-extras" ]
+ then
+ rm -f ${ROOT}/usr/src/linux
+ ln -sf linux-${KV} ${ROOT}/usr/src/linux
+ fi
+
+ #copy over our .config if one isn't already present
+ cd ${ROOT}/usr/src/linux-${KV}
+ if [ "${PN}" = "linux-sources" ] && [ -e .config.eg ] && [ ! -e .config ]
+ then
+ cp -a .config.eg .config
+ fi
+}
diff --git a/sys-kernel/linux/files/2.4.5.5/linux-2.4.5-ac5-gentoo-pre-lvm.diff b/sys-kernel/linux/files/2.4.5.5/linux-2.4.5-ac5-gentoo-pre-lvm.diff
new file mode 100644
index 000000000000..7322f1852a6c
--- /dev/null
+++ b/sys-kernel/linux/files/2.4.5.5/linux-2.4.5-ac5-gentoo-pre-lvm.diff
@@ -0,0 +1,11 @@
+--- linux-2.4.5-ac5/drivers/md/Makefile.orig Sat Jun 2 00:49:51 2001
++++ linux-2.4.5-ac5/drivers/md/Makefile Sat Jun 2 00:50:01 2001
+@@ -6,7 +6,7 @@
+
+ export-objs := md.o xor.o
+ list-multi := lvm-mod.o
+-lvm-mod-objs := lvm.o lvm-snap.o lvm-fs.o
++lvm-mod-objs := lvm.o lvm-snap.o
+
+ # Note: link order is important. All raid personalities
+ # and xor.o must come before md.o, as they each initialise
diff --git a/sys-kernel/linux/files/2.4.5.5/lvm.c.diff b/sys-kernel/linux/files/2.4.5.5/lvm.c.diff
new file mode 100644
index 000000000000..6392671b8f7e
--- /dev/null
+++ b/sys-kernel/linux/files/2.4.5.5/lvm.c.diff
@@ -0,0 +1,20 @@
+--- lvm.c.orig Sat Apr 28 10:48:37 2001
++++ lvm.c Sat Apr 28 11:07:07 2001
+@@ -1791,7 +1791,7 @@
+ int max_hardblocksize = 0, hardblocksize;
+
+ for (le = 0; le < lv->lv_allocated_le; le++) {
+- hardblocksize = get_hardblocksize(lv->lv_current_pe[le].dev);
++ hardblocksize = get_hardsect_size(lv->lv_current_pe[le].dev);
+ if (hardblocksize == 0)
+ hardblocksize = 512;
+ if (hardblocksize > max_hardblocksize)
+@@ -1801,7 +1801,7 @@
+ if (lv->lv_access & LV_SNAPSHOT) {
+ for (e = 0; e < lv->lv_remap_end; e++) {
+ hardblocksize =
+- get_hardblocksize(
++ get_hardsect_size(
+ lv->lv_block_exception[e].rdev_new);
+ if (hardblocksize == 0)
+ hardblocksize = 512;
diff --git a/sys-kernel/linux/files/2.4.5.5/pcmcia b/sys-kernel/linux/files/2.4.5.5/pcmcia
new file mode 100755
index 000000000000..4cfb368ff68a
--- /dev/null
+++ b/sys-kernel/linux/files/2.4.5.5/pcmcia
@@ -0,0 +1,97 @@
+#!/bin/sh
+#RCUPDATE:3 4:69:This line is required for script management
+
+. /etc/rc.d/config/functions
+
+SERVICE=pcmcia
+opts="start stop restart"
+
+ # Slackware startup options go right here:
+ # Should be either i82365 or tcic
+ PCIC=i82365
+ # 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=
+
+cleanup()
+{
+ while read SN CLASS MOD INST DEV EXTRA ; do
+ if [ "$SN" != "Socket" ] ; then
+ /etc/pcmcia/$CLASS stop $DEV 2> /dev/null
+ fi
+ done
+}
+
+start() {
+ if [ -d /var/lib/pcmcia ] ; then
+ SC=/var/lib/pcmcia/scheme
+ RUN=/var/lib/pcmcia
+ else
+ SC=/var/run/pcmcia-scheme
+ RUN=/var/run
+ fi
+ 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
+ fgrep -q pcmcia /proc/devices
+ if [ $? -ne 0 ] ; then
+ if [ -d /lib/modules/preferred ] ; then
+ PC=/lib/modules/preferred/pcmcia
+ else
+ PC=/lib/modules/`uname -r`/pcmcia
+ fi
+ if [ -d $PC ] ; then
+ echo -n " modules"
+ /sbin/insmod $PC/pcmcia_core.o $CORE_OPTS 2>&1 > /dev/null
+ /sbin/insmod $PC/$PCIC.o $PCIC_OPTS 2>&1 > /dev/null
+ /sbin/insmod $PC/ds.o 2>&1 > /dev/null
+ 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
+ /sbin/cardmgr $CARDMGR_OPTS 2>&1 > /dev/null
+ fi
+ touch /var/lock/subsys/pcmcia 2>&1 > /dev/null
+}
+
+stop() {
+ 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
+ killall -q "CardBus Watcher"
+ if fgrep -q "ds " /proc/modules ; then
+ echo -n " modules"
+ /sbin/rmmod ds
+ /sbin/rmmod $PCIC
+ /sbin/rmmod pcmcia_core
+ fi
+ rm -f /var/lock/subsys/pcmcia
+}
+
+restart() {
+ stop
+ start
+}
+
+doservice ${@}
+
diff --git a/sys-kernel/linux/files/2.4.5.5/pcmcia-cs-3.1.25-gentoo.diff b/sys-kernel/linux/files/2.4.5.5/pcmcia-cs-3.1.25-gentoo.diff
new file mode 100644
index 000000000000..db555693924c
--- /dev/null
+++ b/sys-kernel/linux/files/2.4.5.5/pcmcia-cs-3.1.25-gentoo.diff
@@ -0,0 +1,11 @@
+--- pcmcia-cs-3.1.25/cardmgr/cardinfo.c~ Wed Feb 14 04:25:48 2001
++++ pcmcia-cs-3.1.25/cardmgr/cardinfo.c Fri May 4 11:43:32 2001
+@@ -40,7 +40,7 @@
+ #include <fcntl.h>
+ #include <errno.h>
+ #include <signal.h>
+-#include <sys/time.h>
++#include <time.h>
+ #include <sys/ioctl.h>
+ #include <sys/stat.h>
+ #include <sys/file.h>