wok-tiny view linux/receipt @ rev 143

Add some SCSI modules
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Aug 31 18:58:32 2019 +0200 (2019-08-31)
parents d22f6fcf51da
children bd7b94f2c7d0
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"
19 BUILD_SUGGESTED="advancecomp zopfli"
20 INSTALL_DEPENDS="lz4 grep"
22 case "$TARGET" in
23 i486) SUGGESTED="memtest ipxe";; # 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 which advdef 2> /dev/null &&
48 sed -i 's|gzip)|&\n advdef -z4 $@|' \
49 usr/Makefile arch/i386/boot/compressed/Makefile
50 which zopfli 2> /dev/null &&
51 sed -i 's|gzip -f -9 <|time zopfli --i100 -c|' scripts/Makefile.lib
53 [ -s $WOK/busybox/source/busybox*/rootfs.cpio ] || tazwok cook busybox
54 cp $WOK/busybox/source/busybox*/rootfs.cpio $src
55 cp $WOK/busybox/source/busybox*/.config $src/config-busybox
56 mkdir $src/slitaz
57 cp $stuff/list_modules.sh $src/slitaz
58 S2bin bootloader
59 S2bin helper
60 S2bin unpacklz4
61 cp $stuff/pack .
62 ./pack --build
64 sed -i '/config %config:/{NNNps/config %config:/%config:/}' Makefile
65 sed -i 's/^config %config:/config:/' Makefile
66 cp $stuff/linux-$VERSION-slitaz.config .config
67 yes '' | make ARCH=i386 HOSTCC=gcc-2 config
68 make ARCH=i386 CC=gcc-2 HOSTCC=gcc-2 -j 4 bzImage
69 grep -q "CONFIG_MODULES=y" .config &&
70 make ARCH=i386 CC=gcc-2 HOSTCC=gcc-2 -j 4 modules &&
71 make ARCH=i386 INSTALL_MOD_PATH=$DESTDIR -j 1 modules_install || true
72 S2bin bundle
73 cp $stuff/bundle .
74 ./bundle
75 S2bin cmdline
76 }
78 # Rules to gen a SliTaz package suitable for Tazpkg.
79 genpkg_rules()
80 {
81 mkdir $fs/boot
82 cp -a $src/arch/i386/boot/bzImage $fs/boot/
83 dd if=$src/bootloader.bin of=$fs/boot/bzImage conv=notrunc
84 dd if=$src/cmdline.bin bs=1 seek=560 of=$fs/boot/bzImage conv=notrunc
85 cp -a $src/pack $fs/boot/
86 cp -a $src/System.map $fs/boot/
87 cp -a $src/.config $fs/boot/config
88 cp -a $src/config-busybox $fs/boot
89 cp -a $src/bundle.sh $fs/boot/bundle
90 }
92 # Pre and post install commands for Tazpkg.
93 post_install()
94 {
95 echo "Processing post-install commands..."
96 [ -s $1/boot/cmdline ] && cat $1/boot/cmdline | sed 's/^ *//' | \
97 dd of=$1/boot/bzImage conv=notrunc bs=1 seek=768 count=3072
98 $1/boot/pack $1/boot/bzImage
100 # GRUB stuff.
101 if [ -f "$1/boot/grub/menu.lst" ]; then
102 root_dev=$(sed '/root=/!d;s/.*root=\([^ ]*\).*/\1/' \
103 < $1/boot/grub/menu.lst | head -n 1)
104 grub_dev=$(grep "root (" < $1/boot/grub/menu.lst | head -n 1)
105 # Add new kernel entry in case of upgrade for installed system.
106 grep -q $SOURCE-$VERSION-slitaz $1/boot/grub/menu.lst ||
107 [ -s $1/boot/cmdline ] && cmdline=" $(cat $1/boot/cmdline)"
108 cat >> $1/boot/grub/menu.lst << EOT
110 title SliTaz GNU/Linux (Kernel $VERSION-slitaz)
111 $grub_dev
112 kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev$cmdline
113 EOT
114 # Display information message.
115 cat <<EOT
116 ----
117 GRUB is installed, these tree lines must be in your /boot/grub/menu.lst:
119 title SliTaz GNU/Linux (Kernel $VERSION-slitaz)
120 $grub_dev
121 kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev$cmdline
122 ----
123 EOT
124 fi
125 }