wok view linux/receipt @ rev 5061

linux: fetch a well known aufs version
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Mar 10 11:52:09 2010 +0100 (2010-03-10)
parents 0c0c693fe4c6
children 16c22102d014
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 c0a6988a5e0d16636f15c264cf8872dad497ff
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-utf8-$VERSION.u
50 $PACKAGE-diff-$VERSION.u
51 $PACKAGE-freeinitrd-$VERSION.u
52 $PACKAGE-unlzma-$VERSION.u
53 aufs2-base.patch
54 aufs2-kbuild.patch
55 aufs2-standalone.patch
56 $PACKAGE-header-$VERSION.u
57 $PACKAGE-squashfs-lzma-$VERSION.u
58 EOT
59 make mrproper
60 cd Documentation/lguest
61 make lguest || return 1
62 cd ../..
63 cp ../stuff/$PACKAGE-$VERSION-slitaz.config .config
64 make oldconfig
65 ln .config slitaz/config
66 make bzImage &&
67 make modules &&
68 make INSTALL_MOD_PATH=$PWD/_pkg modules_install &&
69 make INSTALL_HDR_PATH=$PWD/_pkg/usr headers_install &&
70 [ -s arch/x86/boot/bzImage ]
71 }
73 # Rules to gen a SliTaz package suitable for Tazpkg.
74 genpkg_rules()
75 {
76 local path
77 mkdir $fs/boot
78 cp -a $src/arch/x86/boot/bzImage $fs/boot/vmlinuz-$VERSION-slitaz
79 # Compress all modules.
80 # Package module-init-tools is compiled with zlib support.
81 #
82 ./stuff/gztazmod.sh $_pkg/lib/modules/$VERSION-slitaz
83 path=$fs/lib/modules/$VERSION-slitaz/kernel
84 mkdir -p $path
85 cp -a $_pkg/lib/modules/$VERSION-slitaz/mo* $fs/lib/modules/$VERSION-slitaz
86 export src
87 export _pkg
88 $src/slitaz/list_modules.sh \
89 $(cat stuff/modules-$VERSION.list) > $src/modules.list
90 while read module; do
91 dir=$(dirname $module)
92 [ -d $path/$dir ] || mkdir -p $path/$dir
93 cp -a $_pkg/lib/modules/$VERSION-slitaz/kernel/$module $path/$dir
94 done < $src/modules.list
95 # Remove unresolved links
96 rm -f $fs/lib/modules/$VERSION-slitaz/build
97 rm -f $fs/lib/modules/$VERSION-slitaz/source
98 # Package all linux pkgs
99 for i in $(cd $WOK; ls -d linux-*)
100 do
101 tazwok genpkg $i
102 done
103 # Cook all packages with a kernel module
104 for i in $(cd $WOK; grep -l 'tazwok cook linux$' */receipt)
105 do
106 echo tazwok cook ${i%/receipt}
107 done
108 # check and echo any module in kernel .config that's not added to one of linux-* pkgs
109 ./stuff/check_modules.sh
110 }
112 # Pre and post install commands for Tazpkg.
113 # GRUB stuf.
114 post_install()
115 {
116 echo "Processing post-install commands..."
117 chroot "$1/" depmod -a $VERSION-slitaz
118 if [ -f "$1/boot/grub/menu.lst" ]; then
119 root_dev=`cat $1/boot/grub/menu.lst | grep root= | sed 's/.*root=\([^ ]*\).*/\1/' | head -n 1`
120 grub_dev=`cat $1/boot/grub/menu.lst | grep "root (" | head -n 1`
121 # Add new kernel entry in case of upgrade for installed system.
122 if ! grep -q $PACKAGE-$VERSION-slitaz $1/boot/grub/menu.lst; then
123 cat >> $1/boot/grub/menu.lst << EOT
125 title SliTaz GNU/Linux (Kernel $VERSION-slitaz)
126 $grub_dev
127 kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev
128 EOT
129 fi
130 # Display information message.
131 cat <<EOT
132 ----
133 GRUB is installed, these tree lines must be in your /boot/grub/menu.lst:
135 title SliTaz GNU/Linux (Kernel $VERSION-slitaz)
136 $grub_dev
137 kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev
138 ----
139 EOT
140 fi
141 }
143 clean_wok()
144 {
145 rm -rf aufs2
146 }