wok-tiny annotate 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 |
rev | line source |
---|---|
pascal@94 | 1 # SliTaz package receipt. |
pascal@94 | 2 |
pascal@94 | 3 PACKAGE="linux" |
pascal@94 | 4 VERSION="2.6.14" |
pascal@94 | 5 CATEGORY="base-system" |
pascal@94 | 6 SHORT_DESC="The Linux kernel." |
pascal@94 | 7 TARGET="i486" |
pascal@94 | 8 MAINTAINER="devel@slitaz.org" |
pascal@94 | 9 LICENSE="GPL2" |
pascal@94 | 10 TARBALL="$PACKAGE-$VERSION.tar.bz2" |
pascal@94 | 11 WEB_SITE="http://www.kernel.org/" |
pascal@94 | 12 WGET_URL="https://www.kernel.org/pub/linux/kernel/v${VERSION:0:3}/$TARBALL" |
pascal@94 | 13 WEB_SITE2="http://elinux.org/Linux_Tiny" |
pascal@94 | 14 PATCH="https://www.selenic.com/tiny/2.6.14-tiny1.patch.bz2" |
pascal@94 | 15 AUTO_SELECTION="always" |
pascal@94 | 16 |
pascal@104 | 17 DEPENDS="memtest ipxe" # bundle may install a boot menu |
pascal@94 | 18 BUILD_DEPENDS="slitaz-toolchain perl git lzma wget gcc2 advancecomp" |
pascal@94 | 19 |
pascal@94 | 20 # Rules to configure and make the package. |
pascal@94 | 21 compile_rules() |
pascal@94 | 22 { |
pascal@94 | 23 [ -s $SRC/$(basename $PATCH) ] || |
pascal@94 | 24 wget --no-check-certificate -O $SRC/$(basename $PATCH) $PATCH |
pascal@94 | 25 bzcat $SRC/$(basename $PATCH) | patch -p1 |
pascal@94 | 26 sed -i 's|\([>\.]\)val|\1u.val|;s|\([>\.]\)next|\1u.next|;216s|};|} u;|' lib/inflate.c |
pascal@94 | 27 sed '/DEBUG/,/* kstrdup/d' < mm/slab.c > mm/kstrdup.c |
pascal@94 | 28 echo 'obj-y += kstrdup.o' >> mm/Makefile |
pascal@94 | 29 sed -i 's|3.1024|11*256|' arch/i386/boot/compressed/misc.c |
pascal@94 | 30 which advdef 2> /dev/null && |
pascal@94 | 31 sed -i 's|gzip)|&\n advdef -z4 $@|' usr/Makefile arch/i386/boot/compressed/Makefile |
pascal@94 | 32 |
pascal@94 | 33 if [ ! -s $WOK/busybox/source/busybox*/rootfs.cpio ]; then |
pascal@94 | 34 tazwok cook busybox |
pascal@94 | 35 fi |
pascal@94 | 36 cp $WOK/busybox/source/busybox*/rootfs.cpio $src |
pascal@94 | 37 cp $WOK/busybox/source/busybox*/.config $src/config-busybox |
pascal@94 | 38 mkdir $src/slitaz |
pascal@94 | 39 cp $stuff/list_modules.sh $src/slitaz |
pascal@95 | 40 cc -o bootloader.o -Wa,-algms=bootloader.lst -c $stuff/bootloader.S |
pascal@95 | 41 objcopy -O binary bootloader.o bootloader.bin |
pascal@94 | 42 |
pascal@94 | 43 sed -i 's/^config %config/config/' Makefile |
pascal@94 | 44 cp $stuff/linux-$VERSION-slitaz.config .config |
pascal@94 | 45 yes '' | make ARCH=i386 HOSTCC=gcc-2 config |
pascal@94 | 46 make ARCH=i386 CC=gcc-2 HOSTCC=gcc-2 -j 4 bzImage |
pascal@94 | 47 grep -q "CONFIG_MODULES=y" .config && |
pascal@94 | 48 make ARCH=i386 CC=gcc-2 HOSTCC=gcc-2 -j 4 modules && |
pascal@94 | 49 make ARCH=i386 INSTALL_MOD_PATH=$DESTDIR -j 1 modules_install || true |
pascal@104 | 50 cc -o bundle.o -Wa,-algms=bundle.lst -c $stuff/bundle.S |
pascal@104 | 51 objcopy -O binary bundle.o bundle.bin |
pascal@104 | 52 cp $stuff/bundle . |
pascal@104 | 53 ./bundle |
pascal@94 | 54 } |
pascal@94 | 55 |
pascal@94 | 56 # Rules to gen a SliTaz package suitable for Tazpkg. |
pascal@94 | 57 genpkg_rules() |
pascal@94 | 58 { |
pascal@94 | 59 mkdir $fs/boot |
pascal@94 | 60 cp -a $src/arch/i386/boot/bzImage $fs/boot/ |
pascal@95 | 61 dd if=$src/bootloader.bin of=$fs/boot/bzImage conv=notrunc |
pascal@94 | 62 cp -a $src/System.map $fs/boot/ |
pascal@94 | 63 cp -a $src/.config $fs/boot/config |
pascal@94 | 64 cp -a $src/config-busybox $fs/boot |
pascal@104 | 65 cp -a $src/bundle.sh $fs/boot/bundle |
pascal@94 | 66 } |
pascal@94 | 67 |
pascal@94 | 68 # Pre and post install commands for Tazpkg. |
pascal@94 | 69 post_install() |
pascal@94 | 70 { |
pascal@94 | 71 echo "Processing post-install commands..." |
pascal@94 | 72 chroot "$1/" depmod -a $VERSION-slitaz |
pascal@94 | 73 # GRUB stuff. |
pascal@94 | 74 if [ -f "$1/boot/grub/menu.lst" ]; then |
pascal@94 | 75 root_dev=`cat $1/boot/grub/menu.lst | grep root= | sed 's/.*root=\([^ ]*\).*/\1/' | head -n 1` |
pascal@94 | 76 grub_dev=`cat $1/boot/grub/menu.lst | grep "root (" | head -n 1` |
pascal@94 | 77 # Add new kernel entry in case of upgrade for installed system. |
pascal@94 | 78 if ! grep -q $SOURCE-$VERSION-slitaz $1/boot/grub/menu.lst; then |
pascal@94 | 79 cat >> $1/boot/grub/menu.lst << EOT |
pascal@94 | 80 |
pascal@94 | 81 title SliTaz GNU/Linux (Kernel $VERSION-slitaz) |
pascal@94 | 82 $grub_dev |
pascal@94 | 83 kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev |
pascal@94 | 84 EOT |
pascal@94 | 85 fi |
pascal@94 | 86 # Display information message. |
pascal@94 | 87 cat <<EOT |
pascal@94 | 88 ---- |
pascal@94 | 89 GRUB is installed, these tree lines must be in your /boot/grub/menu.lst: |
pascal@94 | 90 |
pascal@94 | 91 title SliTaz GNU/Linux (Kernel $VERSION-slitaz) |
pascal@94 | 92 $grub_dev |
pascal@94 | 93 kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev |
pascal@94 | 94 ---- |
pascal@94 | 95 EOT |
pascal@94 | 96 fi |
pascal@94 | 97 } |