add a/linux for kernel package
This commit is contained in:
parent
54060275ea
commit
7b716c32a4
2 changed files with 83 additions and 0 deletions
83
a/linux/linux.SlackBuild
Executable file
83
a/linux/linux.SlackBuild
Executable file
|
@ -0,0 +1,83 @@
|
|||
#!/bin/sh -x
|
||||
|
||||
CLEAN_SRC=${CLEAN_SRC:-NO}
|
||||
|
||||
PRGNAM=linux
|
||||
VERSION=${VERSION:-$(echo linux-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
|
||||
BUILD=${BUILD:-1}
|
||||
PACKAGER=cyco
|
||||
ARCH=$(uname -m)
|
||||
|
||||
CWD=$(pwd)
|
||||
SOURCES=/usr/src/
|
||||
TMP=/tmp/$PACKAGER
|
||||
PKG=$TMP/pkg-$PRGNAM
|
||||
OUTPUT=/tmp
|
||||
|
||||
SRC_URL="http://www.kernel.org/pub/linux/kernel/v2.6$(echo \"$VERSION\" | grep -q \"\-rc\" && echo \"/testing\" )"
|
||||
|
||||
rm -fr $PKG
|
||||
if [ $CLEAN_SRC != "NO" ] ; then
|
||||
rm -fr $SOURCES/$PRGNAM-$VERSION
|
||||
fi
|
||||
|
||||
if [ $CLEAN_SRC != "NO" ]; then
|
||||
[ ! -e $CWD/$PRGNAM-$VERSION.tar.?z* ] && wget -c "$SRC_URL/$PRGNAM-$VERSION.tar.bz2" -O $CWD/$PRGNAM-$VERSION.tar.bz2
|
||||
[ ! -e $SOURCES ] && mkdir -p $SOURCES
|
||||
tar xf $CWD/$PRGNAM-$VERSION.tar.?z* -C $SOURCES
|
||||
fi
|
||||
|
||||
cd $SOURCES/$PRGNAM-$VERSION
|
||||
|
||||
if [ $CLEAN_SRC != "NO" ]; then
|
||||
[ -e $CWD/patches/ ] && \
|
||||
for p in $CWD/patches/*.{diff,patch} ; do
|
||||
patch -p1 -i $p || exit 1 # if patching fail we want to know
|
||||
done
|
||||
[ -e $CWD/patches/$VERSION ] && \
|
||||
for p in $CWD/patches/$VERSION/*.{diff,patch} ; do
|
||||
patch -p1 -i $p || exit 1 # if patching fail we want to know
|
||||
done
|
||||
fi
|
||||
if [ $CLEAN_SRC != "NO" ] || [ ! -e .config ] ; then
|
||||
if [ -e $CWD/config-$VERSION ] ; then
|
||||
cp $CWD/config-$VERSION .config
|
||||
else
|
||||
if [ -e $CWD/config ]; then
|
||||
cp $CWD/config .config
|
||||
else
|
||||
zcat /proc/config.gz > .config
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
make oldconfig $1
|
||||
make
|
||||
|
||||
KERNEL_VERSION=$(grep -o "2\.6\.[0-9a-z\-]*" .config)$(grep "CONFIG_LOCALVERSION=" .config | sed 's|CONFIG_LOCALVERSION=||' | tr -d \" )
|
||||
|
||||
mkdir -p $PKG/boot/$KERNEL_VERSION
|
||||
|
||||
cp .config System.map arch/x86/boot/bzImage $PKG/boot/$KERNEL_VERSION
|
||||
mv $PKG/boot/$KERNEL_VERSION/{.,}config
|
||||
|
||||
make modules_install INSTALL_MOD_PATH=$PKG
|
||||
|
||||
mkdir -p $PKG/install
|
||||
|
||||
cat <<EOF > $PKG/install/slack-desc
|
||||
$PRGNAM-$(echo $VERSION | tr - _): $PRGNAM-$(echo $VERSION | tr - _) (kernel)
|
||||
$PRGNAM-$(echo $VERSION | tr - _):
|
||||
$PRGNAM-$(echo $VERSION | tr - _): Linux is a clone of the operating system Unix, written from scratch by
|
||||
$PRGNAM-$(echo $VERSION | tr - _): Linus Torvalds with assistance from a loosely-knit team of hackers
|
||||
$PRGNAM-$(echo $VERSION | tr - _): across the Net. It aims towards POSIX and Single UNIX Specification
|
||||
$PRGNAM-$(echo $VERSION | tr - _): compliance.
|
||||
$PRGNAM-$(echo $VERSION | tr - _):
|
||||
$PRGNAM-$(echo $VERSION | tr - _): It has all the features you would expect in a modern fully-fledged Unix
|
||||
$PRGNAM-$(echo $VERSION | tr - _):
|
||||
$PRGNAM-$(echo $VERSION | tr - _): http://www.kernel.org
|
||||
$PRGNAM-$(echo $VERSION | tr - _):
|
||||
EOF
|
||||
|
||||
cd $PKG
|
||||
makepkg -l y -c n $OUTPUT/$PRGNAM-$(echo $VERSION | tr - _)-$(echo $KERNEL_VERSION | tr - _)-$ARCH-$BUILD$PACKAGER.txz
|
0
a/linux/patches/autogroup.patch
Normal file
0
a/linux/patches/autogroup.patch
Normal file
Loading…
Reference in a new issue