wok annotate linux/receipt @ rev 4056

Up: linux (2.6.30.6)
author Christophe Lincoln <pankso@slitaz.org>
date Wed Sep 09 23:20:53 2009 +0200 (2009-09-09)
parents f8cf76fcf2c8
children 3681131f240a
rev   line source
pankso@3 1 # SliTaz package receipt.
pankso@3 2
pankso@3 3 PACKAGE="linux"
pankso@4056 4 VERSION="2.6.30.6"
pankso@3 5 CATEGORY="base-system"
pankso@3 6 SHORT_DESC="The Linux kernel and modules."
pascal@2926 7 DEPENDS="depmod"
pankso@1154 8 BUILD_DEPENDS="slitaz-toolchain perl"
pankso@3864 9 MAINTAINER="devel@slitaz.org"
pankso@3 10 TARBALL="$PACKAGE-$VERSION.tar.bz2"
pankso@3 11 WEB_SITE="http://www.kernel.org/"
pascal@2990 12 WGET_URL="http://www.eu.kernel.org/pub/linux/kernel/v${VERSION:0:3}/$TARBALL"
pascal@1909 13 CONFIG_FILES="/lib/modules/$VERSION-slitaz/modules.dep"
pankso@3 14
pankso@3 15 # Rules to configure and make the package.
pankso@3 16 compile_rules()
pankso@3 17 {
erjo@253 18 cd $src
pascal@2158 19 rm -rf slitaz 2> /dev/null
pascal@1093 20 mkdir slitaz
pascal@1093 21 echo "$WGET_URL" > slitaz/url
pascal@1093 22 cp ../stuff/gztazmod.sh ../stuff/list_modules.sh slitaz
pascal@886 23 # lzma and misc patches from pascal
pascal@521 24 while read patch_file; do
pascal@4003 25 echo "$patch_file" >> slitaz/patches
pascal@4003 26 cp ../stuff/$patch_file slitaz/$patch_file
pascal@1442 27 if [ -f done.$patch_file ]; then
pascal@1442 28 echo "Skipping $patch_file"
pascal@1442 29 continue
pascal@1442 30 fi
pascal@521 31 echo "Apply $patch_file"
pascal@881 32 patch -p1 < ../stuff/$patch_file || return 1
pascal@1442 33 touch done.$patch_file
pascal@521 34 done <<EOT
pascal@886 35 $PACKAGE-utf8-$VERSION.u
pascal@886 36 $PACKAGE-diff-$VERSION.u
pascal@3879 37 $PACKAGE-freeinitrd-$VERSION.u
pascal@3908 38 $PACKAGE-unlzma-$VERSION.u
pascal@521 39 EOT
pankso@3864 40 make mrproper
erjo@253 41 cp ../stuff/$PACKAGE-$VERSION-slitaz.config .config
erjo@253 42 make oldconfig
pascal@1093 43 ln .config slitaz/config
pascal@3919 44 make bzImage &&
pascal@3919 45 make modules &&
pascal@3919 46 make INSTALL_MOD_PATH=$PWD/_pkg modules_install &&
pascal@3919 47 make INSTALL_HDR_PATH=$PWD/_pkg/usr headers_install &&
pascal@3919 48 [ -s arch/x86/boot/bzImage ]
pankso@3864 49 }
erjo@253 50
pankso@3 51 # Rules to gen a SliTaz package suitable for Tazpkg.
pankso@3 52 genpkg_rules()
pankso@3 53 {
pascal@521 54 local path
pankso@3 55 mkdir $fs/boot
pascal@214 56 cp -a $src/arch/x86/boot/bzImage $fs/boot/vmlinuz-$VERSION-slitaz
pankso@3 57 # Compress all modules.
pankso@3 58 # Package module-init-tools is compiled with zlib support.
pankso@3 59 #
pascal@521 60 ./stuff/gztazmod.sh $_pkg/lib/modules/$VERSION-slitaz
pascal@521 61 path=$fs/lib/modules/$VERSION-slitaz/kernel
pascal@521 62 mkdir -p $path
pascal@521 63 cp -a $_pkg/lib/modules/$VERSION-slitaz/mo* $fs/lib/modules/$VERSION-slitaz
pascal@886 64 export src
pascal@886 65 export _pkg
pascal@3920 66 $src/slitaz/list_modules.sh \
pascal@3920 67 $(cat stuff/modules-$VERSION.list) > $src/modules.list
pankso@3864 68 while read module; do
pascal@521 69 dir=$(dirname $module)
pankso@535 70 [ -d $path/$dir ] || mkdir -p $path/$dir
pankso@535 71 cp -a $_pkg/lib/modules/$VERSION-slitaz/kernel/$module $path/$dir
pascal@886 72 done < $src/modules.list
pascal@397 73 # Remove unresolved links
pascal@397 74 rm -f $fs/lib/modules/$VERSION-slitaz/build
pascal@397 75 rm -f $fs/lib/modules/$VERSION-slitaz/source
pascal@886 76 # Package all linux pkgs
pascal@886 77 for i in $(cd $WOK; ls -d linux-*)
pankso@871 78 do
pascal@886 79 tazwok genpkg $i
pascal@886 80 done
pascal@886 81 # Cook all packages with a kernel module
pascal@886 82 for i in $(cd $WOK; grep -l 'tazwok cook linux$' */receipt)
pascal@886 83 do
pascal@886 84 echo tazwok cook ${i%/receipt}
pankso@871 85 done
pankso@3 86 }
pankso@3 87
pankso@3 88 # Pre and post install commands for Tazpkg.
pankso@3 89 # GRUB stuf.
pankso@3 90 post_install()
pankso@3 91 {
pascal@521 92 echo "Processing post-install commands..."
pascal@2926 93 chroot "$1/" depmod -a $VERSION-slitaz
pankso@1154 94 if [ -f "$1/boot/grub/menu.lst" ]; then
pankso@4056 95 root_dev=`cat $1/boot/grub/menu.lst | grep root= | sed 's/.*root=\([^ ]*\).*/\1/' | head -n 1`
pankso@4056 96 grub_dev=`cat $1/boot/grub/menu.lst | grep "root (" | head -n 1`
pankso@3864 97 # Add new kernel entry in case of upgrade for installed system.
pankso@4056 98 if ! grep -q $PACKAGE-$VERSION-slitaz $1/boot/grub/menu.lst; then
pankso@4056 99 cat >> $1/boot/grub/menu.lst << EOT
pankso@4056 100
pankso@4056 101 title SliTaz GNU/Linux (Kernel $VERSION-slitaz)
pankso@4056 102 $grub_dev
pankso@4056 103 kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev
pankso@4056 104 EOT
pankso@4056 105 fi
pankso@4056 106 # Display information message.
pankso@4056 107 cat <<EOT
pankso@4056 108 ----
pankso@4056 109 GRUB is installed, these tree lines must be in your /boot/grub/menu.lst:
pankso@1154 110
pankso@1154 111 title SliTaz GNU/Linux (Kernel $VERSION-slitaz)
pankso@1154 112 $grub_dev
pankso@4056 113 kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev
pascal@886 114 ----
pascal@886 115 EOT
pankso@1154 116 fi
pankso@3 117 }