#!/bin/sh # Slackware build script for kernel-source ## Copyright (c) 2008, Antonio Hernandez Blas # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1.- Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # Modified by Robby Workman # Modified by Patrick Volkerding PRGNAM=kernel-source VERSION=${VERSION:-2.4.33.3} ARCH=${ARCH:-i686} 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 $PKG mkdir -p $TMP $PKG cd $PKG || exit 1 rm -rf usr mkdir -p usr/src/ cd usr/src/ echo Unpacking the kernel sources, so be patient... tar -jxf $CWD/linux-$VERSION.tar.bz2 || exit 1 ln -sf linux-${VERSION} linux cd linux-$VERSION || exit 1 cp -a scripts scripts.save chown -R root:root . chmod -R a-s,u+rw,go-w . zcat $CWD/s390-patches/lnx24333-36.timer.gz | patch -p1 || exit 1 cat $CWD/s390-patches/reiserfs.strcpy.fix.diff | patch -p1 || exit 1 cat $CWD/s390-patches/dasd_int.h.diff | patch -p1 || exit 1 cat $CWD/s390-patches/chandev.c.diff | patch -p1 || exit 1 cat $CWD/s390-patches/tape.h.diff | patch -p1 || exit 1 cat $CWD/s390-patches/tubttybld.c.diff | patch -p1 || exit 1 cat $CWD/s390-patches/qeth.c.diff | patch -p1 || exit 1 cat $CWD/s390-patches/lcs.c.diff | patch -p1 || exit 1 cp -vpi ${CWD}/config-s390-${VERSION} .config ARCH="s390" make oldconfig || exit 1 rm .config.old ARCH="s390" make dep || exit 1 ARCH="s390" make ${NUMJOBS} image || exit 1 ARCH="s390" make ${NUMJOBS} modules || exit 1 ARCH="s390" make clean || exit 1 rm -f .version find . -name .depend -o -name .hdepend | xargs rm rm -rf scripts mv scripts.save scripts mkdir -p $PKG/install cat $CWD/slack-desc.s390 > $PKG/install/slack-desc cd $PKG /sbin/makepkg -l y -c n $TMP/${PRGNAM}-$VERSION-$ARCH-$BUILD.tgz