# vim: set syn=sh: #Maintainer: Dimitris Tzemos # Use fake-uname -r to match the kernel version you want to compile KVER=$(fake-uname -r) pkgname=kernel-source pkgver=$(echo $KVER|tr - .) pkgrel=1dj arch=noarch source=("https://www.kernel.org/pub/linux/kernel/v5.x/linux-${VERSION}.tar.xz") #source=() #options=('nosrcpack') slackdesc=\ ( #|-----handy-ruler------------------------------------------------------| "kernel-source (Linux kernel source for Salix)" "" "Source code for Linus Torvalds' Linux kernel." "" "This is the complete and unmodified source code for the Linux kernel." "" "Packaged by Dimitris Tzemos " ) build() { export KVEREXTRA=$(fake-uname -r) export KVER=$(echo $KVEREXTRA|sed 's/\(.*\)-.*/\1/') export SRC=$startdir/src export DEST=$startdir/pkg export nbthreads=$(cat /proc/cpuinfo | grep ^processor | wc -l) # clone the kernel echo '########################################' echo "Cloning /usr/src/linux-$KVER..." echo '########################################' mkdir -p $SRC/usr/src/linux-$KVER/ rsync --inplace --progress -a $SRC/linux-$KVER/ $SRC/usr/src/linux-$KVER/ || exit 1 ( ARCH_BAK=$arch unset arch cd $SRC/usr/src/linux-$KVER/ make mrproper || exit 1 zcat /proc/config.gz > $SRC/usr/src/linux-$KVER/.config || exit 1 make oldconfig scripts prepare clean || exit 1 arch=$ARCH_BAK ) mkdir -p $DEST/usr/src/linux-$KVER/ echo "Please wait .... kernel source package is build" cp -r $SRC/usr/src/linux-$KVER/* $DEST/usr/src/linux-$KVER/ || exit 1 cd $DEST/usr/src/ ln -sf linux-$KVER linux if [ $? -ne 0 ]; then exit 1 fi }