wok-tiny view linux/receipt @ rev 109

Update custom-console
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Feb 27 10:51:46 2016 +0100 (2016-02-27)
parents 93ea2d4c06f3
children fe3786524709
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 advancecomp"
20 case "$TARGET" in
21 i486) SUGGESTED="memtest ipxe";; # bundle may install a boot menu
22 esac
24 # Rules to configure and make the package.
25 compile_rules()
26 {
27 [ -s $SRC/$(basename $PATCH) ] ||
28 wget --no-check-certificate -O $SRC/$(basename $PATCH) $PATCH
29 bzcat $SRC/$(basename $PATCH) | patch -p1
30 sed -i 's|\([>\.]\)val|\1u.val|;s|\([>\.]\)next|\1u.next|;216s|};|} u;|' lib/inflate.c
31 sed '/DEBUG/,/* kstrdup/d' < mm/slab.c > mm/kstrdup.c
32 echo 'obj-y += kstrdup.o' >> mm/Makefile
33 sed -i 's|3.1024|11*256|' arch/i386/boot/compressed/misc.c
34 which advdef 2> /dev/null &&
35 sed -i 's|gzip)|&\n advdef -z4 $@|' usr/Makefile arch/i386/boot/compressed/Makefile
37 if [ ! -s $WOK/busybox/source/busybox*/rootfs.cpio ]; then
38 tazwok cook busybox
39 fi
40 cp $WOK/busybox/source/busybox*/rootfs.cpio $src
41 cp $WOK/busybox/source/busybox*/.config $src/config-busybox
42 mkdir $src/slitaz
43 cp $stuff/list_modules.sh $src/slitaz
44 cc -o bootloader.o -Wa,-algms=bootloader.lst -c $stuff/bootloader.S
45 objcopy -O binary bootloader.o bootloader.bin
47 sed -i 's/^config %config/config/' Makefile
48 cp $stuff/linux-$VERSION-slitaz.config .config
49 yes '' | make ARCH=i386 HOSTCC=gcc-2 config
50 make ARCH=i386 CC=gcc-2 HOSTCC=gcc-2 -j 4 bzImage
51 grep -q "CONFIG_MODULES=y" .config &&
52 make ARCH=i386 CC=gcc-2 HOSTCC=gcc-2 -j 4 modules &&
53 make ARCH=i386 INSTALL_MOD_PATH=$DESTDIR -j 1 modules_install || true
54 cc -o bundle.o -Wa,-algms=bundle.lst -c $stuff/bundle.S
55 objcopy -O binary bundle.o bundle.bin
56 cp $stuff/bundle .
57 ./bundle
58 cc -o cmdline.o -Wa,-algms=cmdline.lst -c $stuff/cmdline.S
59 objcopy -O binary cmdline.o cmdline.bin
60 }
62 # Rules to gen a SliTaz package suitable for Tazpkg.
63 genpkg_rules()
64 {
65 mkdir $fs/boot
66 cp -a $src/arch/i386/boot/bzImage $fs/boot/
67 dd if=$src/bootloader.bin of=$fs/boot/bzImage conv=notrunc
68 dd if=$src/cmdline.bin bs=1 seek=560 of=$fs/boot/bzImage conv=notrunc
69 cp -a $src/System.map $fs/boot/
70 cp -a $src/.config $fs/boot/config
71 cp -a $src/config-busybox $fs/boot
72 cp -a $src/bundle.sh $fs/boot/bundle
73 }
75 # Pre and post install commands for Tazpkg.
76 post_install()
77 {
78 echo "Processing post-install commands..."
79 chroot "$1/" /boot/depmod -a $VERSION-slitaz
80 [ -s $1/boot/cmdline ] && cat $1/boot/cmdline | sed 's/^ *//' | \
81 dd of=$1/boot/bzImage conv=notrunc bs=1 seek=768 count=3072
82 # GRUB stuff.
83 if [ -f "$1/boot/grub/menu.lst" ]; then
84 root_dev=`cat $1/boot/grub/menu.lst | grep root= | sed 's/.*root=\([^ ]*\).*/\1/' | head -n 1`
85 grub_dev=`cat $1/boot/grub/menu.lst | grep "root (" | head -n 1`
86 # Add new kernel entry in case of upgrade for installed system.
87 if ! grep -q $SOURCE-$VERSION-slitaz $1/boot/grub/menu.lst; then
88 cat >> $1/boot/grub/menu.lst << EOT
90 title SliTaz GNU/Linux (Kernel $VERSION-slitaz)
91 $grub_dev
92 kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev
93 EOT
94 fi
95 # Display information message.
96 cat <<EOT
97 ----
98 GRUB is installed, these tree lines must be in your /boot/grub/menu.lst:
100 title SliTaz GNU/Linux (Kernel $VERSION-slitaz)
101 $grub_dev
102 kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev
103 ----
104 EOT
105 fi
106 }