wok-next view linux/receipt @ rev 5195

slitaz-doc: fix version for 3.0
author Christophe Lincoln <pankso@slitaz.org>
date Sun Mar 28 17:16:33 2010 +0200 (2010-03-28)
parents 16c22102d014
children 2ae67cafd57e
line source
1 # SliTaz package receipt.
3 PACKAGE="linux"
4 VERSION="2.6.30.6"
5 CATEGORY="base-system"
6 SHORT_DESC="The Linux kernel and modules."
7 DEPENDS="depmod"
8 BUILD_DEPENDS="slitaz-toolchain perl git"
9 MAINTAINER="devel@slitaz.org"
10 TARBALL="$PACKAGE-$VERSION.tar.bz2"
11 WEB_SITE="http://www.kernel.org/"
12 WGET_URL="http://www.eu.kernel.org/pub/linux/kernel/v${VERSION:0:3}/$TARBALL"
13 CONFIG_FILES="/lib/modules/$VERSION-slitaz/modules.dep"
15 # Rules to configure and make the package.
16 compile_rules()
17 {
18 # Aufs2 from git repository
19 if [ ! -d aufs2 ]; then
20 git clone http://git.c3sl.ufpr.br/pub/scm/aufs/aufs2-standalone.git aufs2
21 #cd aufs2 && git checkout origin/aufs2-30
22 #Use a well known version rather than the last one...
23 cd aufs2 && git checkout ee5557abdf9bb6fda673c19d239bb85869418045
24 fi
25 cd aufs2
26 cp -a Documentation fs include $src
27 cp -a *.patch ../stuff
28 [ -L /usr/bin/patch ] && tazpkg get-install patch --forced
29 cd $src
30 # SliTaz db
31 rm -rf slitaz 2> /dev/null
32 mkdir slitaz
33 echo "$WGET_URL" > slitaz/url
34 cp ../stuff/gztazmod.sh ../stuff/list_modules.sh slitaz
35 cp ../stuff/bootloader.sh slitaz
36 # Misc patches from pascal
37 while read patch_file; do
38 echo "$patch_file" >> slitaz/patches
39 #cp ../stuff/$patch_file slitaz/$patch_file
40 cp ../stuff/$patch_file slitaz
41 if [ -f done.$patch_file ]; then
42 echo "Skipping $patch_file"
43 continue
44 fi
45 echo "Apply $patch_file"
46 patch -p1 < slitaz/$patch_file || exit 1
47 touch done.$patch_file
48 done <<EOT
49 $PACKAGE-diff-$VERSION.u
50 $PACKAGE-freeinitrd-$VERSION.u
51 $PACKAGE-unlzma-$VERSION.u
52 aufs2-base.patch
53 aufs2-kbuild.patch
54 aufs2-standalone.patch
55 $PACKAGE-header-$VERSION.u
56 $PACKAGE-squashfs-lzma-$VERSION.u
57 EOT
58 make mrproper
59 cd Documentation/lguest
60 make lguest || return 1
61 cd ../..
62 cp ../stuff/$PACKAGE-$VERSION-slitaz.config .config
63 make oldconfig
64 ln .config slitaz/config
65 make bzImage &&
66 make modules &&
67 make INSTALL_MOD_PATH=$PWD/_pkg modules_install &&
68 make INSTALL_HDR_PATH=$PWD/_pkg/usr headers_install &&
69 [ -s arch/x86/boot/bzImage ]
70 }
72 # Rules to gen a SliTaz package suitable for Tazpkg.
73 genpkg_rules()
74 {
75 local path
76 mkdir $fs/boot
77 cp -a $src/arch/x86/boot/bzImage $fs/boot/vmlinuz-$VERSION-slitaz
78 # Compress all modules.
79 # Package module-init-tools is compiled with zlib support.
80 #
81 ./stuff/gztazmod.sh $_pkg/lib/modules/$VERSION-slitaz
82 path=$fs/lib/modules/$VERSION-slitaz/kernel
83 mkdir -p $path
84 cp -a $_pkg/lib/modules/$VERSION-slitaz/mo* $fs/lib/modules/$VERSION-slitaz
85 export src
86 export _pkg
87 $src/slitaz/list_modules.sh \
88 $(cat stuff/modules-$VERSION.list) > $src/modules.list
89 while read module; do
90 dir=$(dirname $module)
91 [ -d $path/$dir ] || mkdir -p $path/$dir
92 cp -a $_pkg/lib/modules/$VERSION-slitaz/kernel/$module $path/$dir
93 done < $src/modules.list
94 # Remove unresolved links
95 rm -f $fs/lib/modules/$VERSION-slitaz/build
96 rm -f $fs/lib/modules/$VERSION-slitaz/source
97 # Package all linux pkgs
98 for i in $(cd $WOK; ls -d linux-*)
99 do
100 tazwok genpkg $i
101 done
102 # Cook all packages with a kernel module
103 for i in $(cd $WOK; grep -l 'tazwok cook linux$' */receipt)
104 do
105 echo tazwok cook ${i%/receipt}
106 done
107 # check and echo any module in kernel .config that's not added to one of linux-* pkgs
108 ./stuff/check_modules.sh
109 }
111 # Pre and post install commands for Tazpkg.
112 # GRUB stuf.
113 post_install()
114 {
115 echo "Processing post-install commands..."
116 chroot "$1/" depmod -a $VERSION-slitaz
117 if [ -f "$1/boot/grub/menu.lst" ]; then
118 root_dev=`cat $1/boot/grub/menu.lst | grep root= | sed 's/.*root=\([^ ]*\).*/\1/' | head -n 1`
119 grub_dev=`cat $1/boot/grub/menu.lst | grep "root (" | head -n 1`
120 # Add new kernel entry in case of upgrade for installed system.
121 if ! grep -q $PACKAGE-$VERSION-slitaz $1/boot/grub/menu.lst; then
122 cat >> $1/boot/grub/menu.lst << EOT
124 title SliTaz GNU/Linux (Kernel $VERSION-slitaz)
125 $grub_dev
126 kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev
127 EOT
128 fi
129 # Display information message.
130 cat <<EOT
131 ----
132 GRUB is installed, these tree lines must be in your /boot/grub/menu.lst:
134 title SliTaz GNU/Linux (Kernel $VERSION-slitaz)
135 $grub_dev
136 kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev
137 ----
138 EOT
139 fi
140 }
142 clean_wok()
143 {
144 rm -rf aufs2
145 }