wok annotate linux/receipt @ rev 4384

Up: phpmyadmin(3.2.2.1)
author Eric Joseph-Alexandre <erjo@slitaz.org>
date Wed Oct 14 14:11:45 2009 +0000 (2009-10-14)
parents 7589496c772c
children e8d2c0b1111b
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@4251 8 BUILD_DEPENDS="slitaz-toolchain perl git"
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 {
pankso@4251 18 # Aufs2 from git repository
pankso@4251 19 if [ ! -d aufs2 ]; then
pankso@4251 20 git clone http://git.c3sl.ufpr.br/pub/scm/aufs/aufs2-standalone.git aufs2
pankso@4251 21 cd aufs2 && git checkout origin/aufs2-30
pankso@4251 22 cp -a Documentation fs include $src
pankso@4251 23 fi
erjo@253 24 cd $src
pankso@4251 25 # SliTaz db
pascal@2158 26 rm -rf slitaz 2> /dev/null
pascal@1093 27 mkdir slitaz
pascal@1093 28 echo "$WGET_URL" > slitaz/url
pascal@1093 29 cp ../stuff/gztazmod.sh ../stuff/list_modules.sh slitaz
pankso@4251 30 # Misc patches from pascal
pascal@521 31 while read patch_file; do
pascal@4003 32 echo "$patch_file" >> slitaz/patches
pascal@4003 33 cp ../stuff/$patch_file slitaz/$patch_file
pascal@1442 34 if [ -f done.$patch_file ]; then
pascal@1442 35 echo "Skipping $patch_file"
pascal@1442 36 continue
pascal@1442 37 fi
pascal@521 38 echo "Apply $patch_file"
pankso@4251 39 patch -p1 < $patch_file || exit 1
pascal@1442 40 touch done.$patch_file
pascal@521 41 done <<EOT
pankso@4251 42 ../stuff/$PACKAGE-utf8-$VERSION.u
pankso@4251 43 ../stuff/$PACKAGE-diff-$VERSION.u
pankso@4251 44 ../stuff/$PACKAGE-freeinitrd-$VERSION.u
pankso@4251 45 ../stuff/$PACKAGE-unlzma-$VERSION.u
pankso@4251 46 ../aufs2/aufs2-base.patch
pankso@4251 47 ../aufs2/aufs2-kbuild.patch
pankso@4251 48 ../aufs2/aufs2-standalone.patch
pascal@521 49 EOT
pankso@3864 50 make mrproper
erjo@253 51 cp ../stuff/$PACKAGE-$VERSION-slitaz.config .config
erjo@253 52 make oldconfig
pascal@1093 53 ln .config slitaz/config
pascal@3919 54 make bzImage &&
pascal@3919 55 make modules &&
pascal@3919 56 make INSTALL_MOD_PATH=$PWD/_pkg modules_install &&
pascal@3919 57 make INSTALL_HDR_PATH=$PWD/_pkg/usr headers_install &&
pascal@3919 58 [ -s arch/x86/boot/bzImage ]
pankso@3864 59 }
erjo@253 60
pankso@3 61 # Rules to gen a SliTaz package suitable for Tazpkg.
pankso@3 62 genpkg_rules()
pankso@3 63 {
pascal@521 64 local path
pankso@3 65 mkdir $fs/boot
pascal@214 66 cp -a $src/arch/x86/boot/bzImage $fs/boot/vmlinuz-$VERSION-slitaz
pankso@3 67 # Compress all modules.
pankso@3 68 # Package module-init-tools is compiled with zlib support.
pankso@3 69 #
pascal@521 70 ./stuff/gztazmod.sh $_pkg/lib/modules/$VERSION-slitaz
pascal@521 71 path=$fs/lib/modules/$VERSION-slitaz/kernel
pascal@521 72 mkdir -p $path
pascal@521 73 cp -a $_pkg/lib/modules/$VERSION-slitaz/mo* $fs/lib/modules/$VERSION-slitaz
pascal@886 74 export src
pascal@886 75 export _pkg
pascal@3920 76 $src/slitaz/list_modules.sh \
pascal@3920 77 $(cat stuff/modules-$VERSION.list) > $src/modules.list
pankso@3864 78 while read module; do
pascal@521 79 dir=$(dirname $module)
pankso@535 80 [ -d $path/$dir ] || mkdir -p $path/$dir
pankso@535 81 cp -a $_pkg/lib/modules/$VERSION-slitaz/kernel/$module $path/$dir
pascal@886 82 done < $src/modules.list
pascal@397 83 # Remove unresolved links
pascal@397 84 rm -f $fs/lib/modules/$VERSION-slitaz/build
pascal@397 85 rm -f $fs/lib/modules/$VERSION-slitaz/source
pascal@886 86 # Package all linux pkgs
pascal@886 87 for i in $(cd $WOK; ls -d linux-*)
pankso@871 88 do
pascal@886 89 tazwok genpkg $i
pascal@886 90 done
pascal@886 91 # Cook all packages with a kernel module
pascal@886 92 for i in $(cd $WOK; grep -l 'tazwok cook linux$' */receipt)
pascal@886 93 do
pascal@886 94 echo tazwok cook ${i%/receipt}
pankso@871 95 done
pankso@3 96 }
pankso@3 97
pankso@3 98 # Pre and post install commands for Tazpkg.
pankso@3 99 # GRUB stuf.
pankso@3 100 post_install()
pankso@3 101 {
pascal@521 102 echo "Processing post-install commands..."
pascal@2926 103 chroot "$1/" depmod -a $VERSION-slitaz
pankso@1154 104 if [ -f "$1/boot/grub/menu.lst" ]; then
pankso@4056 105 root_dev=`cat $1/boot/grub/menu.lst | grep root= | sed 's/.*root=\([^ ]*\).*/\1/' | head -n 1`
pankso@4056 106 grub_dev=`cat $1/boot/grub/menu.lst | grep "root (" | head -n 1`
pankso@3864 107 # Add new kernel entry in case of upgrade for installed system.
pankso@4056 108 if ! grep -q $PACKAGE-$VERSION-slitaz $1/boot/grub/menu.lst; then
pankso@4056 109 cat >> $1/boot/grub/menu.lst << EOT
pankso@4056 110
pankso@4056 111 title SliTaz GNU/Linux (Kernel $VERSION-slitaz)
pankso@4056 112 $grub_dev
pankso@4056 113 kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev
pankso@4056 114 EOT
pankso@4056 115 fi
pankso@4056 116 # Display information message.
pankso@4056 117 cat <<EOT
pankso@4056 118 ----
pankso@4056 119 GRUB is installed, these tree lines must be in your /boot/grub/menu.lst:
pankso@1154 120
pankso@1154 121 title SliTaz GNU/Linux (Kernel $VERSION-slitaz)
pankso@1154 122 $grub_dev
pankso@4056 123 kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev
pascal@886 124 ----
pascal@886 125 EOT
pankso@1154 126 fi
pankso@3 127 }
pankso@4251 128
pankso@4251 129 clean_wok()
pankso@4251 130 {
pankso@4251 131 rm -rf aufs2
pankso@4251 132 }