wok-tiny view linux/receipt @ rev 104

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