# SliTaz package receipt.
PACKED_SIZE="1.1M"
UNPACKED_SIZE="1.9M"
PACKAGE="linux"
VERSION="2.6.20"
CATEGORY="base-system"
SHORT_DESC="The Linux kernel."
TARGET="i486"
MAINTAINER="devel@slitaz.org"
LICENSE="GPL2"
TARBALL="$PACKAGE-$VERSION.tar.bz2"
WEB_SITE="http://www.kernel.org/"
WGET_URL="https://www.kernel.org/pub/linux/kernel/v${VERSION:0:3}/$TARBALL"
AUTO_SELECTION="always"
DEPENDS=""
BUILD_DEPENDS="slitaz-toolchain perl git lzma wget upx"
INSTALL_DEPENDS="lz4 grep"
case "$TARGET" in
i486) SUGGESTED="memtest ipxe plop tfttest x86test";; # bundle may install a boot menu
esac
S2bin()
{
[ -s $stuff/$1.S ] &&
cc $2 -o $1.o -Wa,-algms=$1.lst -c $stuff/$1.S &&
objcopy -O binary $1.o $1.bin
}
rootfs()
{
[ -s $stuff/root.cpio ] && cp $stuff/root.cpio . &&
sed -i 's|CONFIG_INITRAMFS_SOURCE="|&root.cpio|' .config
}
setup_code()
{
echo $((514 + $(od -An -j 513 -N 1 -i $1)))
}
# Rules to configure and make the package.
compile_rules()
{
export CFLAGS="-march=i386 -Os -pipe -fomit-frame-pointer"
for i in $stuff/linux-$VERSION-*.u ; do
patch -p0 < $i
done
sed -i 's/O_CREAT/&|O_TRUNC/' init/initramfs.c
sed -i 's|hostname|echo tank|' scripts/mkcompile_h
mkdir $src/slitaz
cp $stuff/list_modules.sh $src/slitaz
S2bin bootloader
S2bin helper
S2bin unpacklz4
cp $stuff/pack $stuff/un*.S .
sed -i '/config %config:/{NNNps/config %config:/%config:/}' Makefile &&
sed -i 's/^config %config:/config:/' Makefile
#2.6.20
sed -i '/\/ %\/:/{NNps/\/ %\/:/%\/:/}' Makefile &&
sed -i 's/^\/ %\/:/\/:/' Makefile
sed -i 's|.*netinet/in|#include
for any CPU starting from 386sx | optimized for pentium or newer CPU |