wok-tiny view linux/receipt @ rev 157

Add geninitramfs & busybox-net
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Feb 28 16:03:43 2020 +0100 (2020-02-28)
parents b02f3505dd41
children 5f5bea2af6b6
line source
1 # SliTaz package receipt.
3 PACKAGE="linux"
4 VERSION="2.6.14"
5 CATEGORY="base-system"
6 SHORT_DESC="The Linux kernel."
7 TARGET="i486"
8 MAINTAINER="devel@slitaz.org"
9 LICENSE="GPL2"
10 TARBALL="$PACKAGE-$VERSION.tar.bz2"
11 WEB_SITE="http://www.kernel.org/"
12 WGET_URL="https://www.kernel.org/pub/linux/kernel/v${VERSION:0:3}/$TARBALL"
13 WEB_SITE2="http://elinux.org/Linux_Tiny"
14 PATCH="https://www.selenic.com/tiny/2.6.14-tiny1.patch.bz2"
15 AUTO_SELECTION="always"
17 DEPENDS=""
18 BUILD_DEPENDS="slitaz-toolchain perl git lzma wget gcc2 upx"
19 BUILD_SUGGESTED="advancecomp zopfli"
20 INSTALL_DEPENDS="lz4 grep"
22 case "$TARGET" in
23 i486) SUGGESTED="memtest ipxe plop";; # bundle may install a boot menu
24 esac
26 S2bin()
27 {
28 [ -s $stuff/$1.S ] &&
29 cc -o $1.o -Wa,-algms=$1.lst -c $stuff/$1.S &&
30 objcopy -O binary $1.o $1.bin
31 }
33 # Rules to configure and make the package.
34 compile_rules()
35 {
36 [ -s $SRC/$(basename $PATCH) ] ||
37 wget --no-check-certificate -O $SRC/$(basename $PATCH) $PATCH
38 bzcat $SRC/$(basename $PATCH) | patch -p1
39 patch -p0 < $stuff/linux-2.6.14-unpack.u
40 patch -p0 < $stuff/jsclipboard.u
41 sed -i 's|\([>\.]\)val|\1u.val|;s|\([>\.]\)next|\1u.next|;216s|};|} u;|' \
42 lib/inflate.c
43 sed '/DEBUG/,/* kstrdup/d' < mm/slab.c > mm/kstrdup.c
44 echo 'obj-y += kstrdup.o' >> mm/Makefile
45 sed -i 's|3.1024|11*256|' arch/i386/boot/compressed/misc.c
46 sed -i 's/O_CREAT/&|O_TRUNC/' init/initramfs.c
47 false && which advdef 2> /dev/null &&
48 sed -i 's|gzip)|&\n advdef -z4 $@|' \
49 usr/Makefile arch/i386/boot/compressed/Makefile
50 false && which zopfli 2> /dev/null &&
51 sed -i 's|gzip -f -9 <|time zopfli --i100 -c|' scripts/Makefile.lib
53 mkdir $src/slitaz
54 cp $stuff/list_modules.sh $src/slitaz
55 S2bin bootloader
56 S2bin helper
57 S2bin unpacklz4
58 cp $stuff/pack .
59 sh ./pack --build
61 sed -i '/config %config:/{NNNps/config %config:/%config:/}' Makefile
62 sed -i 's/^config %config:/config:/' Makefile
64 cp $stuff/linux-$VERSION-slitaz.config .config
65 yes '' | make ARCH=i386 HOSTCC=gcc-2 config
66 make ARCH=i386 CC=gcc-2 HOSTCC=gcc-2 -j 4 bzImage
67 which upx 2> /dev/null &&
68 upx --ultra-brute arch/i386/boot/bzImage
70 grep -q "CONFIG_MODULES=y" .config &&
71 make ARCH=i386 CC=gcc-2 HOSTCC=gcc-2 -j 4 modules &&
72 make ARCH=i386 INSTALL_MOD_PATH=$DESTDIR -j 1 modules_install || true
73 S2bin bundle
74 cp $stuff/bundle .
75 sh ./bundle
76 S2bin cmdline
77 }
79 # Rules to gen a SliTaz package suitable for Tazpkg.
80 genpkg_rules()
81 {
82 mkdir $fs/boot
83 cp -a $src/arch/i386/boot/bzImage $fs/boot/
84 dd if=$src/bootloader.bin of=$fs/boot/bzImage conv=notrunc
85 dd if=$src/cmdline.bin bs=1 seek=560 of=$fs/boot/bzImage conv=notrunc
86 cp -a $src/pack $fs/boot/
87 cp -a $src/System.map $fs/boot/
88 cp -a $src/.config $fs/boot/config
89 cp -a $src/bundle.sh $fs/boot/bundle
90 }
92 # Pre and post install commands for Tazpkg.
93 post_install()
94 {
95 [ -s $1/boot/cmdline ] && cat $1/boot/cmdline | sed 's/^ *//' | \
96 dd of=$1/boot/bzImage conv=notrunc bs=1 seek=768 count=3072
97 $1/boot/pack $1/boot/bzImage
98 }