wok annotate linux-tickless/receipt @ rev 2720
Up: snownews (1.5.11)
author | Paul Issott <paul@slitaz.org> |
---|---|
date | Thu Apr 23 19:21:07 2009 +0000 (2009-04-23) |
parents | |
children | f306d126580e |
rev | line source |
---|---|
pascal@2382 | 1 # SliTaz package receipt. |
pascal@2382 | 2 |
pascal@2382 | 3 PACKAGE="linux-tickless" |
pascal@2382 | 4 VERSION="2.6.25.5" |
pascal@2382 | 5 CATEGORY="base-system" |
pascal@2382 | 6 SHORT_DESC="The Linux kernel and modules." |
pascal@2382 | 7 BUILD_DEPENDS="slitaz-toolchain perl" |
pascal@2382 | 8 MAINTAINER="pascal.bellard@slitaz.org" |
pascal@2382 | 9 SOURCE="linux" |
pascal@2382 | 10 TARBALL="$SOURCE-$VERSION.tar.bz2" |
pascal@2382 | 11 WEB_SITE="http://www.kernel.org/" |
pascal@2382 | 12 WGET_URL="http://www.eu.kernel.org/pub/linux/kernel/v2.6/$TARBALL" |
pascal@2382 | 13 CONFIG_FILES="/lib/modules/$VERSION-slitaz/modules.dep" |
pascal@2382 | 14 PROVIDE="linux" |
pascal@2382 | 15 |
pascal@2382 | 16 # Rules to configure and make the package. |
pascal@2382 | 17 compile_rules() |
pascal@2382 | 18 { |
pascal@2382 | 19 cd $src |
pascal@2382 | 20 rm -rf slitaz 2> /dev/null |
pascal@2382 | 21 mkdir slitaz |
pascal@2382 | 22 echo "$WGET_URL" > slitaz/url |
pascal@2382 | 23 cp $WOK/linux/stuff/gztazmod.sh $WOK/linux/stuff/list_modules.sh slitaz |
pascal@2382 | 24 # lzma and misc patches from pascal |
pascal@2382 | 25 while read patch_file; do |
pascal@2382 | 26 if [ -f done.$patch_file ]; then |
pascal@2382 | 27 echo "Skipping $patch_file" |
pascal@2382 | 28 continue |
pascal@2382 | 29 fi |
pascal@2382 | 30 echo "Apply $patch_file" |
pascal@2382 | 31 patch -p1 < $WOK/linux/stuff/$patch_file || return 1 |
pascal@2382 | 32 echo "$patch_file" >> slitaz/patches |
pascal@2382 | 33 cp $WOK/linux/stuff/$patch_file slitaz/$patch_file |
pascal@2382 | 34 touch done.$patch_file |
pascal@2382 | 35 done <<EOT |
pascal@2382 | 36 $SOURCE-lzma-$VERSION.u |
pascal@2382 | 37 $SOURCE-utf8-$VERSION.u |
pascal@2382 | 38 $SOURCE-diff-$VERSION.u |
pascal@2382 | 39 $SOURCE-rootdev.u |
pascal@2382 | 40 EOT |
pascal@2382 | 41 make mrproper |
pascal@2382 | 42 cp $WOK/linux/stuff/$SOURCE-$VERSION-slitaz.config .config |
pascal@2382 | 43 sed -i -e 's/# CONFIG_TICK_ONESHOT .*/CONFIG_TICK_ONESHOT=y/' |
pascal@2382 | 44 -e 's/# CONFIG_NO_HZ .*/CONFIG_NO_HZ=y/' .config |
pascal@2382 | 45 make oldconfig |
pascal@2382 | 46 ln .config slitaz/config |
pascal@2382 | 47 make bzImage |
pascal@2382 | 48 make modules |
pascal@2382 | 49 make INSTALL_MOD_PATH=$PWD/_pkg modules_install |
pascal@2382 | 50 make INSTALL_HDR_PATH=$PWD/_pkg/usr headers_install |
pascal@2382 | 51 } |
pascal@2382 | 52 |
pascal@2382 | 53 # Rules to gen a SliTaz package suitable for Tazpkg. |
pascal@2382 | 54 genpkg_rules() |
pascal@2382 | 55 { |
pascal@2382 | 56 local path |
pascal@2382 | 57 mkdir $fs/boot |
pascal@2382 | 58 cp -a $src/arch/x86/boot/bzImage $fs/boot/vmlinuz-$VERSION-slitaz |
pascal@2382 | 59 # Compress all modules. |
pascal@2382 | 60 # Package module-init-tools is compiled with zlib support. |
pascal@2382 | 61 # |
pascal@2382 | 62 $WOK/linux/stuff/gztazmod.sh $_pkg/lib/modules/$VERSION-slitaz |
pascal@2382 | 63 path=$fs/lib/modules/$VERSION-slitaz/kernel |
pascal@2382 | 64 mkdir -p $path |
pascal@2382 | 65 cp -a $_pkg/lib/modules/$VERSION-slitaz/mo* $fs/lib/modules/$VERSION-slitaz |
pascal@2382 | 66 cp $WOK/linux/stuff/list_modules.sh $src |
pascal@2382 | 67 export src |
pascal@2382 | 68 export _pkg |
pascal@2382 | 69 $src/list_modules.sh $(cat $WOK/linux/stuff/modules-$VERSION.list) > $src/modules.list |
pascal@2382 | 70 while read module; do |
pascal@2382 | 71 dir=$(dirname $module) |
pascal@2382 | 72 [ -d $path/$dir ] || mkdir -p $path/$dir |
pascal@2382 | 73 cp -a $_pkg/lib/modules/$VERSION-slitaz/kernel/$module $path/$dir |
pascal@2382 | 74 done < $src/modules.list |
pascal@2382 | 75 # Remove unresolved links |
pascal@2382 | 76 rm -f $fs/lib/modules/$VERSION-slitaz/build |
pascal@2382 | 77 rm -f $fs/lib/modules/$VERSION-slitaz/source |
pascal@2382 | 78 } |
pascal@2382 | 79 |
pascal@2382 | 80 # Pre and post install commands for Tazpkg. |
pascal@2382 | 81 # GRUB stuf. |
pascal@2382 | 82 post_install() |
pascal@2382 | 83 { |
pascal@2382 | 84 echo "Processing post-install commands..." |
pascal@2382 | 85 depmod -a -b "$1/" $VERSION-slitaz |
pascal@2382 | 86 if [ -f "$1/boot/grub/menu.lst" ]; then |
pascal@2382 | 87 root_dev=`cat $1/boot/grub/menu.lst | grep root= | sed 's/.*root=\([^ ]*\).*/\1/'` |
pascal@2382 | 88 grub_dev=`cat $1/boot/grub/menu.lst | grep "root ("` |
pascal@2382 | 89 # Add new kernel entry in case of upgrade for installed system. |
pascal@2382 | 90 cat >> $1/boot/grub/menu.lst << EOT |
pascal@2382 | 91 |
pascal@2382 | 92 title SliTaz GNU/Linux (Kernel $VERSION-slitaz) |
pascal@2382 | 93 $grub_dev |
pascal@2382 | 94 kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev |
pascal@2382 | 95 EOT |
pascal@2382 | 96 # Display information message. |
pascal@2382 | 97 cat <<EOT |
pascal@2382 | 98 ---- |
pascal@2382 | 99 GRUB is installed, these tree lines has been added to the menu.lst: |
pascal@2382 | 100 |
pascal@2382 | 101 title SliTaz GNU/Linux (Kernel $VERSION-slitaz) |
pascal@2382 | 102 $grub_dev |
pascal@2382 | 103 kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev |
pascal@2382 | 104 ---- |
pascal@2382 | 105 EOT |
pascal@2382 | 106 fi |
pascal@2382 | 107 } |