#!/bin/sh PRGNAM=kernel-modules VERSION=${VERSION:-2.4.33.3} ARCH=${ARCH:-s390x} BUILD=${BUILD:-1} CWD=$(pwd) TMP=${TMP:-/tmp} PKG=${TMP}/package-${PRGNAM} NUMJOBS=${NUMJOBS:--j3} if [ "${ARCH}" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mtune=i686" elif [ "${ARCH}" = "i686" ]; then SLKCFLAGS="-O2 -march=i686 -mtune=i686" elif [ "${ARCH}" = "s390x" ]; then SLKCFLAGS="-O2" elif [ "${ARCH}" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC" fi rm -rf ${TMP}/${PRGNAM}-${VERSION} ${PKG} mkdir -p ${TMP}/${PRGNAM}-${VERSION}/usr/src ${PKG} cd ${TMP}/${PRGNAM}-${VERSION}/usr/src || exit 1 echo "Unpacking the tarball. Please wait..." tar -jxf ${CWD}/../../k/linux-${VERSION}.tar.bz2 cd linux-${VERSION} || exit 1 chown -R root.root . chmod -R a-s,u+rw,go-w . zcat ${CWD}/../../k/s390-patches/lnx24333-36.timer.gz | patch -p1 || exit 1 cat ${CWD}/../../k/s390-patches/reiserfs.strcpy.fix.diff | patch -p1 || exit 1 cat ${CWD}/../../k/s390-patches/dasd_int.h.diff | patch -p1 || exit 1 cat ${CWD}/../../k/s390-patches/chandev.c.diff | patch -p1 || exit 1 cat ${CWD}/../../k/s390-patches/tape.h.diff | patch -p1 || exit 1 cat ${CWD}/../../k/s390-patches/tubttybld.c.diff | patch -p1 || exit 1 cat ${CWD}/../../k/s390-patches/qeth.c.diff | patch -p1 || exit 1 cat ${CWD}/../../k/s390-patches/lcs.c.diff | patch -p1 || exit 1 cp -vpi ${CWD}/../../k/config-s390-${VERSION} .config || exit 1 ARCH="s390" make oldconfig || exit 1 ARCH="s390" make dep || exit 1 ARCH="s390" make ${NUMJOBS} modules || exit 1 ARCH="s390" make modules_install INSTALL_MOD_PATH=${PKG} || exit 1 ( mkdir -p ${PKG}/etc/rc.d/ cd ${PKG}/etc/rc.d/ cp ${CWD}/rc.modules.new . cat ${CWD}/rc.modules.s390.diff | patch -p0 --verbose ) ( cd ${PKG}/lib/modules/${VERSION} rm -rf build ; ln -s /usr/src/linux-${VERSION} build find . -type f -name "*.o" | xargs gzip -9 ) ( cd ${PKG} tar -zxvf ${CWD}/../../../extra/cpint-1.1.6/cpint-1.1.6_2.4.33.3-s390x-1.tgz \ lib/modules/${VERSION}/misc/cpint.o.gz chown -R root.root lib/modules/ ) depmod -a -b ${PKG} ${VERSION} mkdir ${PKG}/install cd ${PKG}/install cat ${CWD}/slack-desc > slack-desc cd ${PKG} makepkg -c n -l y ../${PRGNAM}-${VERSION}-${ARCH}-${BUILD}.tgz