diff options
author | Peter Gavin <pete@gentoo.org> | 2001-06-01 23:46:39 +0000 |
---|---|---|
committer | Peter Gavin <pete@gentoo.org> | 2001-06-01 23:46:39 +0000 |
commit | 43c9818b107a55d61163e0b9567e2397e1df78fa (patch) | |
tree | 0ca1f4f911d3c06276ecc0b0c28d35d79bbc86d1 /sys-kernel | |
parent | rc-update line (diff) | |
download | historical-43c9818b107a55d61163e0b9567e2397e1df78fa.tar.gz historical-43c9818b107a55d61163e0b9567e2397e1df78fa.tar.bz2 historical-43c9818b107a55d61163e0b9567e2397e1df78fa.zip |
linux-2.4.5 w/ xfs support and reiserfs unmount fix
Diffstat (limited to 'sys-kernel')
21 files changed, 2478 insertions, 0 deletions
diff --git a/sys-kernel/linux-extras/files/2.4.5-r1/fs-super.c.diff b/sys-kernel/linux-extras/files/2.4.5-r1/fs-super.c.diff new file mode 100644 index 000000000000..f7a51cbc6eb3 --- /dev/null +++ b/sys-kernel/linux-extras/files/2.4.5-r1/fs-super.c.diff @@ -0,0 +1,18 @@ +--- fs/super.c~ Wed May 30 15:51:48 2001 ++++ fs/super.c Wed May 30 16:32:28 2001 +@@ -872,6 +872,7 @@ + } + spin_unlock(&dcache_lock); + down_write(&sb->s_umount); ++ lock_kernel(); + sb->s_root = NULL; + /* Need to clean after the sucker */ + if (fs->fs_flags & FS_LITTER) +@@ -900,6 +901,7 @@ + put_filesystem(fs); + sb->s_type = NULL; + unlock_super(sb); ++ unlock_kernel(); + up_write(&sb->s_umount); + if (bdev) { + blkdev_put(bdev, BDEV_FS); diff --git a/sys-kernel/linux-extras/files/2.4.5-r1/linux-2.4.5-xfs-20010530-gentoo-cleanup.diff b/sys-kernel/linux-extras/files/2.4.5-r1/linux-2.4.5-xfs-20010530-gentoo-cleanup.diff new file mode 100644 index 000000000000..7d9383a572a9 --- /dev/null +++ b/sys-kernel/linux-extras/files/2.4.5-r1/linux-2.4.5-xfs-20010530-gentoo-cleanup.diff @@ -0,0 +1,12 @@ +diff -u linux-2.4.5-xfs-20010530-gentoo/Makefile linux-2.4.5-xfs-20010530-gentoo-cleanup/Makefile +--- linux-2.4.5-xfs-20010530-gentoo/Makefile Wed May 30 22:19:20 2001 ++++ linux-2.4.5-xfs-20010530-gentoo-cleanup/Makefile Wed May 30 22:20:11 2001 +@@ -105,7 +105,7 @@ + CPPFLAGS := -D__KERNEL__ -I$(HPATH) + CPPFLAGS += $(patsubst %,-I%,$(CROSS_COMPILE_INC)) + +-CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -fno-strict-aliasing ++CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -O2 -fno-strict-aliasing + ifndef CONFIG_FRAME_POINTER + CFLAGS += -fomit-frame-pointer + endif diff --git a/sys-kernel/linux-extras/files/2.4.5-r1/linux-2.4.5-xfs-20010530-gentoo-pre-lvm.diff b/sys-kernel/linux-extras/files/2.4.5-r1/linux-2.4.5-xfs-20010530-gentoo-pre-lvm.diff new file mode 100644 index 000000000000..0dd32180b35d --- /dev/null +++ b/sys-kernel/linux-extras/files/2.4.5-r1/linux-2.4.5-xfs-20010530-gentoo-pre-lvm.diff @@ -0,0 +1,12 @@ +diff -urP linux-2.4.5-xfs-20010530-gentoo/drivers/md/Makefile linux-2.4.5-xfs-22010530-pre-lvm/drivers/md/Makefile +--- linux-2.4.5-xfs-20010530-gentoo/drivers/md/Makefile Wed May 30 16:08:52 2001 ++++ linux-2.4.5-xfs-20010530-pre-lvm/drivers/md/Makefile Wed May 30 16:09:27 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-r1/lvm.c.diff b/sys-kernel/linux-extras/files/2.4.5-r1/lvm.c.diff new file mode 100644 index 000000000000..6392671b8f7e --- /dev/null +++ b/sys-kernel/linux-extras/files/2.4.5-r1/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-r1/pcmcia b/sys-kernel/linux-extras/files/2.4.5-r1/pcmcia new file mode 100755 index 000000000000..4cfb368ff68a --- /dev/null +++ b/sys-kernel/linux-extras/files/2.4.5-r1/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-r1/pcmcia-cs-3.1.25-gentoo.diff b/sys-kernel/linux-extras/files/2.4.5-r1/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-r1/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-r1.ebuild b/sys-kernel/linux-extras/linux-extras-2.4.5-r1.ebuild new file mode 100644 index 000000000000..6a3ecd90eb9a --- /dev/null +++ b/sys-kernel/linux-extras/linux-extras-2.4.5-r1.ebuild @@ -0,0 +1,656 @@ +# 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 + +#OKV=original kernel version, KV=patched kernel version +OKV=2.4.5 +KV=${OKV} +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://dice.mfa.kfki.hu/download/reiserfs-3.6.25-${OKV}/bigpatch-${OKV}.diff.bz2 + ftp://ftp.namesys.com/pub/reiserfs-for-2.4/linux-2.4.5-reiserfs-umount-fix.patch" +# http://www.kernel.org/pub/linux/kernel/people/alan/2.4/patch-${KV}.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 + 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 +fi + +if [ "${PN}" = "linux-extras" ] +then + DEPEND=">=sys-kernel/linux-sources-${PVR}" + RDEPEND=" " + if [ "`use xfs`" ] + then + DEPEND="${DEPEND} >=sys-devel/autoconf-2.13" + fi + 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" + if [ "`use xfs`" ] + then + DEPEND="${DEPEND} >=sys-devel/autoconf-2.13" + fi + 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} + +# echo "Applying reiserfs-knfsd patch..." +# try gzip -dc ${DISTDIR}/linux-${OKV}-knfsd-${KNV}.patch.gz | 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 + echo "Applying reiserfs patches..." + try bzip2 -dc ${DISTDIR}/bigpatch-${OKV}.diff.bz2 | patch -p1 + try patch -p1 < ${DISTDIR}/linux-2.4.5-reiserfs-umount-fix.patch + try patch -p0 < ${FILESDIR}/${PVR}/fs-super.c.diff + + if [ "`use lvm`" ] || [ "`use alsa`" ] || [ "`use i2c`" ] || [ "`use lm_sensors`" ] || [ "`use pcmcia-cs`" ] + then + mkdir -p ${S}/extras + fi + + if [ "`use xfs`" ] + then + cd ${S} + echo "Applying xfs patch..." + try gzip -dc ${DISTDIR}/linux-${KV}-xfs-${XFSV}.diff.gz | patch -p1 + fi + + 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} + # the -l option allows this patch to apply cleanly (ignore whitespace changes) + if [ "`use xfs`" ] + then + try patch -l -p1 < ${FILESDIR}/${PVR}/linux-${KV}-xfs-${XFSV}-pre-lvm.diff + fi + 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 + + if [ "`use xfs`" ] + then + echo "Applying xfs cleanup patch..." + try patch -p1 < ${FILESDIR}/${PVR}/linux-${KV}-xfs-${XFSV}-cleanup.diff + fi + + 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 + + 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 + + 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 + + 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 + + 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-r1/fs-super.c.diff b/sys-kernel/linux-sources/files/2.4.5-r1/fs-super.c.diff new file mode 100644 index 000000000000..f7a51cbc6eb3 --- /dev/null +++ b/sys-kernel/linux-sources/files/2.4.5-r1/fs-super.c.diff @@ -0,0 +1,18 @@ +--- fs/super.c~ Wed May 30 15:51:48 2001 ++++ fs/super.c Wed May 30 16:32:28 2001 +@@ -872,6 +872,7 @@ + } + spin_unlock(&dcache_lock); + down_write(&sb->s_umount); ++ lock_kernel(); + sb->s_root = NULL; + /* Need to clean after the sucker */ + if (fs->fs_flags & FS_LITTER) +@@ -900,6 +901,7 @@ + put_filesystem(fs); + sb->s_type = NULL; + unlock_super(sb); ++ unlock_kernel(); + up_write(&sb->s_umount); + if (bdev) { + blkdev_put(bdev, BDEV_FS); diff --git a/sys-kernel/linux-sources/files/2.4.5-r1/linux-2.4.5-xfs-20010530-gentoo-cleanup.diff b/sys-kernel/linux-sources/files/2.4.5-r1/linux-2.4.5-xfs-20010530-gentoo-cleanup.diff new file mode 100644 index 000000000000..7d9383a572a9 --- /dev/null +++ b/sys-kernel/linux-sources/files/2.4.5-r1/linux-2.4.5-xfs-20010530-gentoo-cleanup.diff @@ -0,0 +1,12 @@ +diff -u linux-2.4.5-xfs-20010530-gentoo/Makefile linux-2.4.5-xfs-20010530-gentoo-cleanup/Makefile +--- linux-2.4.5-xfs-20010530-gentoo/Makefile Wed May 30 22:19:20 2001 ++++ linux-2.4.5-xfs-20010530-gentoo-cleanup/Makefile Wed May 30 22:20:11 2001 +@@ -105,7 +105,7 @@ + CPPFLAGS := -D__KERNEL__ -I$(HPATH) + CPPFLAGS += $(patsubst %,-I%,$(CROSS_COMPILE_INC)) + +-CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -fno-strict-aliasing ++CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -O2 -fno-strict-aliasing + ifndef CONFIG_FRAME_POINTER + CFLAGS += -fomit-frame-pointer + endif diff --git a/sys-kernel/linux-sources/files/2.4.5-r1/linux-2.4.5-xfs-20010530-gentoo-pre-lvm.diff b/sys-kernel/linux-sources/files/2.4.5-r1/linux-2.4.5-xfs-20010530-gentoo-pre-lvm.diff new file mode 100644 index 000000000000..0dd32180b35d --- /dev/null +++ b/sys-kernel/linux-sources/files/2.4.5-r1/linux-2.4.5-xfs-20010530-gentoo-pre-lvm.diff @@ -0,0 +1,12 @@ +diff -urP linux-2.4.5-xfs-20010530-gentoo/drivers/md/Makefile linux-2.4.5-xfs-22010530-pre-lvm/drivers/md/Makefile +--- linux-2.4.5-xfs-20010530-gentoo/drivers/md/Makefile Wed May 30 16:08:52 2001 ++++ linux-2.4.5-xfs-20010530-pre-lvm/drivers/md/Makefile Wed May 30 16:09:27 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-r1/lvm.c.diff b/sys-kernel/linux-sources/files/2.4.5-r1/lvm.c.diff new file mode 100644 index 000000000000..6392671b8f7e --- /dev/null +++ b/sys-kernel/linux-sources/files/2.4.5-r1/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-r1/pcmcia b/sys-kernel/linux-sources/files/2.4.5-r1/pcmcia new file mode 100755 index 000000000000..4cfb368ff68a --- /dev/null +++ b/sys-kernel/linux-sources/files/2.4.5-r1/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-r1/pcmcia-cs-3.1.25-gentoo.diff b/sys-kernel/linux-sources/files/2.4.5-r1/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-r1/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/linux-sources-2.4.5-r1.ebuild b/sys-kernel/linux-sources/linux-sources-2.4.5-r1.ebuild new file mode 100644 index 000000000000..6a3ecd90eb9a --- /dev/null +++ b/sys-kernel/linux-sources/linux-sources-2.4.5-r1.ebuild @@ -0,0 +1,656 @@ +# 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 + +#OKV=original kernel version, KV=patched kernel version +OKV=2.4.5 +KV=${OKV} +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://dice.mfa.kfki.hu/download/reiserfs-3.6.25-${OKV}/bigpatch-${OKV}.diff.bz2 + ftp://ftp.namesys.com/pub/reiserfs-for-2.4/linux-2.4.5-reiserfs-umount-fix.patch" +# http://www.kernel.org/pub/linux/kernel/people/alan/2.4/patch-${KV}.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 + 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 +fi + +if [ "${PN}" = "linux-extras" ] +then + DEPEND=">=sys-kernel/linux-sources-${PVR}" + RDEPEND=" " + if [ "`use xfs`" ] + then + DEPEND="${DEPEND} >=sys-devel/autoconf-2.13" + fi + 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" + if [ "`use xfs`" ] + then + DEPEND="${DEPEND} >=sys-devel/autoconf-2.13" + fi + 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} + +# echo "Applying reiserfs-knfsd patch..." +# try gzip -dc ${DISTDIR}/linux-${OKV}-knfsd-${KNV}.patch.gz | 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 + echo "Applying reiserfs patches..." + try bzip2 -dc ${DISTDIR}/bigpatch-${OKV}.diff.bz2 | patch -p1 + try patch -p1 < ${DISTDIR}/linux-2.4.5-reiserfs-umount-fix.patch + try patch -p0 < ${FILESDIR}/${PVR}/fs-super.c.diff + + if [ "`use lvm`" ] || [ "`use alsa`" ] || [ "`use i2c`" ] || [ "`use lm_sensors`" ] || [ "`use pcmcia-cs`" ] + then + mkdir -p ${S}/extras + fi + + if [ "`use xfs`" ] + then + cd ${S} + echo "Applying xfs patch..." + try gzip -dc ${DISTDIR}/linux-${KV}-xfs-${XFSV}.diff.gz | patch -p1 + fi + + 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} + # the -l option allows this patch to apply cleanly (ignore whitespace changes) + if [ "`use xfs`" ] + then + try patch -l -p1 < ${FILESDIR}/${PVR}/linux-${KV}-xfs-${XFSV}-pre-lvm.diff + fi + 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 + + if [ "`use xfs`" ] + then + echo "Applying xfs cleanup patch..." + try patch -p1 < ${FILESDIR}/${PVR}/linux-${KV}-xfs-${XFSV}-cleanup.diff + fi + + 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 + + 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 + + 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 + + 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 + + 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-r1/fs-super.c.diff b/sys-kernel/linux/files/2.4.5-r1/fs-super.c.diff new file mode 100644 index 000000000000..f7a51cbc6eb3 --- /dev/null +++ b/sys-kernel/linux/files/2.4.5-r1/fs-super.c.diff @@ -0,0 +1,18 @@ +--- fs/super.c~ Wed May 30 15:51:48 2001 ++++ fs/super.c Wed May 30 16:32:28 2001 +@@ -872,6 +872,7 @@ + } + spin_unlock(&dcache_lock); + down_write(&sb->s_umount); ++ lock_kernel(); + sb->s_root = NULL; + /* Need to clean after the sucker */ + if (fs->fs_flags & FS_LITTER) +@@ -900,6 +901,7 @@ + put_filesystem(fs); + sb->s_type = NULL; + unlock_super(sb); ++ unlock_kernel(); + up_write(&sb->s_umount); + if (bdev) { + blkdev_put(bdev, BDEV_FS); diff --git a/sys-kernel/linux/files/2.4.5-r1/linux-2.4.5-xfs-20010530-gentoo-cleanup.diff b/sys-kernel/linux/files/2.4.5-r1/linux-2.4.5-xfs-20010530-gentoo-cleanup.diff new file mode 100644 index 000000000000..7d9383a572a9 --- /dev/null +++ b/sys-kernel/linux/files/2.4.5-r1/linux-2.4.5-xfs-20010530-gentoo-cleanup.diff @@ -0,0 +1,12 @@ +diff -u linux-2.4.5-xfs-20010530-gentoo/Makefile linux-2.4.5-xfs-20010530-gentoo-cleanup/Makefile +--- linux-2.4.5-xfs-20010530-gentoo/Makefile Wed May 30 22:19:20 2001 ++++ linux-2.4.5-xfs-20010530-gentoo-cleanup/Makefile Wed May 30 22:20:11 2001 +@@ -105,7 +105,7 @@ + CPPFLAGS := -D__KERNEL__ -I$(HPATH) + CPPFLAGS += $(patsubst %,-I%,$(CROSS_COMPILE_INC)) + +-CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -fno-strict-aliasing ++CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -O2 -fno-strict-aliasing + ifndef CONFIG_FRAME_POINTER + CFLAGS += -fomit-frame-pointer + endif diff --git a/sys-kernel/linux/files/2.4.5-r1/linux-2.4.5-xfs-20010530-gentoo-pre-lvm.diff b/sys-kernel/linux/files/2.4.5-r1/linux-2.4.5-xfs-20010530-gentoo-pre-lvm.diff new file mode 100644 index 000000000000..0dd32180b35d --- /dev/null +++ b/sys-kernel/linux/files/2.4.5-r1/linux-2.4.5-xfs-20010530-gentoo-pre-lvm.diff @@ -0,0 +1,12 @@ +diff -urP linux-2.4.5-xfs-20010530-gentoo/drivers/md/Makefile linux-2.4.5-xfs-22010530-pre-lvm/drivers/md/Makefile +--- linux-2.4.5-xfs-20010530-gentoo/drivers/md/Makefile Wed May 30 16:08:52 2001 ++++ linux-2.4.5-xfs-20010530-pre-lvm/drivers/md/Makefile Wed May 30 16:09:27 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-r1/lvm.c.diff b/sys-kernel/linux/files/2.4.5-r1/lvm.c.diff new file mode 100644 index 000000000000..6392671b8f7e --- /dev/null +++ b/sys-kernel/linux/files/2.4.5-r1/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-r1/pcmcia b/sys-kernel/linux/files/2.4.5-r1/pcmcia new file mode 100755 index 000000000000..4cfb368ff68a --- /dev/null +++ b/sys-kernel/linux/files/2.4.5-r1/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-r1/pcmcia-cs-3.1.25-gentoo.diff b/sys-kernel/linux/files/2.4.5-r1/pcmcia-cs-3.1.25-gentoo.diff new file mode 100644 index 000000000000..db555693924c --- /dev/null +++ b/sys-kernel/linux/files/2.4.5-r1/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/linux-2.4.5-r1.ebuild b/sys-kernel/linux/linux-2.4.5-r1.ebuild new file mode 100644 index 000000000000..6a3ecd90eb9a --- /dev/null +++ b/sys-kernel/linux/linux-2.4.5-r1.ebuild @@ -0,0 +1,656 @@ +# 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 + +#OKV=original kernel version, KV=patched kernel version +OKV=2.4.5 +KV=${OKV} +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://dice.mfa.kfki.hu/download/reiserfs-3.6.25-${OKV}/bigpatch-${OKV}.diff.bz2 + ftp://ftp.namesys.com/pub/reiserfs-for-2.4/linux-2.4.5-reiserfs-umount-fix.patch" +# http://www.kernel.org/pub/linux/kernel/people/alan/2.4/patch-${KV}.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 + 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 +fi + +if [ "${PN}" = "linux-extras" ] +then + DEPEND=">=sys-kernel/linux-sources-${PVR}" + RDEPEND=" " + if [ "`use xfs`" ] + then + DEPEND="${DEPEND} >=sys-devel/autoconf-2.13" + fi + 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" + if [ "`use xfs`" ] + then + DEPEND="${DEPEND} >=sys-devel/autoconf-2.13" + fi + 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} + +# echo "Applying reiserfs-knfsd patch..." +# try gzip -dc ${DISTDIR}/linux-${OKV}-knfsd-${KNV}.patch.gz | 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 + echo "Applying reiserfs patches..." + try bzip2 -dc ${DISTDIR}/bigpatch-${OKV}.diff.bz2 | patch -p1 + try patch -p1 < ${DISTDIR}/linux-2.4.5-reiserfs-umount-fix.patch + try patch -p0 < ${FILESDIR}/${PVR}/fs-super.c.diff + + if [ "`use lvm`" ] || [ "`use alsa`" ] || [ "`use i2c`" ] || [ "`use lm_sensors`" ] || [ "`use pcmcia-cs`" ] + then + mkdir -p ${S}/extras + fi + + if [ "`use xfs`" ] + then + cd ${S} + echo "Applying xfs patch..." + try gzip -dc ${DISTDIR}/linux-${KV}-xfs-${XFSV}.diff.gz | patch -p1 + fi + + 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} + # the -l option allows this patch to apply cleanly (ignore whitespace changes) + if [ "`use xfs`" ] + then + try patch -l -p1 < ${FILESDIR}/${PVR}/linux-${KV}-xfs-${XFSV}-pre-lvm.diff + fi + 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 + + if [ "`use xfs`" ] + then + echo "Applying xfs cleanup patch..." + try patch -p1 < ${FILESDIR}/${PVR}/linux-${KV}-xfs-${XFSV}-cleanup.diff + fi + + 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 + + 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 + + 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 + + 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 + + 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 +} |