#!/bin/bash ##################################################### # Script : kernel-sourcepackage.SlackBuild # Purpose: Build a source package of the Linux Kernel # Author : Stuart Winter # Date...: 27-May-2006 ##################################################### source /usr/share/slackdev/buildkit.sh # Package information: export PKGNAM=kernel-source eval $( egrep '^export VERSION' arm/build ) export BUILD=${BUILD:-1_slack14.2} export PKGSERIES=${PKGSERIES:-patches} export SLACKPACKAGE=$PKGNAM-$VERSION-$PKGARCH-$BUILD.txz ## ******************************************************************* ## # For test packages - best to store in another location rather than # overwriting the working copy in the main tree: export PKGSTORE=/tmp/ mkdir -vpm755 $PKGSTORE/$PKGSERIES ## ******************************************************************* ## CWD=$PWD TMP=/tmp/package-kernel-source rm -rf $TMP mkdir -pm755 $TMP/usr/src echo "*****************************************************************" echo "Building source package slackware/k/$SLACKPACKAGE" echo "*****************************************************************" # Extract the previously compiled "armv5" kernel source. # We use the "armv5" kernels because they're (at the time of writing - May 2010) # are the most widely used hardware platform for Slackware ARM. cd $TMP/usr/src echo " + Extracting compiled source" tar xf $CWD/compiled-sources/armv7-kernel-$VERSION-compiled.tar # Ensure that the linux dir name matches the $VERSION of the package so that # in the a/kernel-modules package, the /lib/modules/*/{build,source} # symlinks are correct. mv -fv linux-* linux-$VERSION ln -vfs linux-$VERSION linux cd linux || exit 1 # Prepare: echo " + Cleaning up the source tree" make clean make prepare #rm -fv .version find . -name '.gitignore' -print0 | xargs -0 rm -rf find . -name '.tmp*' -print0 | xargs -0 rm -rf # Install package description. This modified from the Slackware version # because we need to mention the additional 'armedslack' directory. cd $TMP mkdir -vm755 install install -vpm644 $CWD/slack-descs/kernel-source install/slack-desc echo " + Setting sane file ownerships and permissions" chown -R root:root . chmod -R og-w . # Replace version number with a _ so it doesn't get confused with # the package name. # This is incase we're using any '-rc' releases. export VERSION="$( echo $VERSION | sed 's?-??g' )" export SLACKPACKAGE=$PKGNAM-$VERSION-$PKGARCH-$BUILD.txz echo " + Building Slackware package" slackmp # run makepkg