wok-stable view linux/receipt @ rev 5691
linux: add missing patches
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sat Jun 05 13:07:53 2010 +0200 (2010-06-05) |
parents | 003ddfde863e |
children | ce1a465271d9 |
line source
1 # SliTaz package receipt.
3 PACKAGE="linux"
4 VERSION="2.6.34"
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-34
22 fi
23 cd aufs2
24 cp -a Documentation fs include $src
25 cp -a *.patch ../stuff
26 # We need the real GNU patch
27 [ -L /usr/bin/patch ] && tazpkg get-install patch --forced
28 cd $src
29 # SliTaz db
30 rm -rf slitaz 2> /dev/null
31 mkdir slitaz
32 echo "$WGET_URL" > slitaz/url
33 cp ../stuff/gztazmod.sh ../stuff/list_modules.sh slitaz
34 cp ../stuff/bootloader.sh slitaz
35 # Apply patches
36 while read patch_file; do
37 echo "$patch_file" >> slitaz/patches
38 cp ../stuff/$patch_file slitaz
39 if [ -f done.$patch_file ]; then
40 echo "Skipping $patch_file"
41 continue
42 fi
43 echo "Apply $patch_file"
44 patch -p1 < slitaz/$patch_file || exit 1
45 touch done.$patch_file
46 done <<EOT
47 $PACKAGE-diff-$VERSION.u
48 $PACKAGE-unlzma-$VERSION.u
49 $PACKAGE-header-$VERSION.u
50 aufs2-base.patch
51 aufs2-kbuild.patch
52 aufs2-standalone.patch
53 $PACKAGE-freeinitrd-$VERSION.u
54 $PACKAGE-squashfs-lzma-$VERSION.u
55 EOT
56 make mrproper
57 cd Documentation/lguest
58 make lguest || return 1
59 cd ../..
60 cp ../stuff/$PACKAGE-$VERSION-slitaz.config .config
61 make oldconfig
62 ln .config slitaz/config
63 make -j 4 bzImage &&
64 make -j 4 modules &&
65 make INSTALL_MOD_PATH=$PWD/_pkg modules_install &&
66 make INSTALL_HDR_PATH=$PWD/_pkg/usr headers_install &&
67 [ -s arch/x86/boot/bzImage ]
68 }
70 # Rules to gen a SliTaz package suitable for Tazpkg.
71 genpkg_rules()
72 {
73 local path
74 mkdir $fs/boot
75 cp -a $src/arch/x86/boot/bzImage \
76 $fs/boot/vmlinuz-$VERSION-slitaz
77 # Compress all modules.
78 ./stuff/gztazmod.sh $_pkg/lib/modules/$VERSION-slitaz
79 path=$fs/lib/modules/$VERSION-slitaz/kernel
80 mkdir -p $path
81 cp -a $_pkg/lib/modules/$VERSION-slitaz/mo* \
82 $fs/lib/modules/$VERSION-slitaz
83 # Get the base modules
84 export src
85 export _pkg
86 $src/slitaz/list_modules.sh \
87 $(cat stuff/modules-$VERSION.list) > $src/modules.list
88 while read module; do
89 dir=$(dirname $module)
90 [ -d $path/$dir ] || mkdir -p $path/$dir
91 cp -a $_pkg/lib/modules/$VERSION-slitaz/kernel/$module $path/$dir
92 done < $src/modules.list
93 # Remove unresolved links
94 rm -f $fs/lib/modules/$VERSION-slitaz/build
95 rm -f $fs/lib/modules/$VERSION-slitaz/source
96 # Package all linux pkgs
97 for i in $(cd $WOK; ls -d linux-*)
98 do
99 tazwok genpkg $i
100 done
101 # Cook all packages with a kernel module
102 for i in $(cd $WOK; grep -l 'tazwok cook linux$' */receipt)
103 do
104 echo tazwok cook ${i%/receipt}
105 done
106 # Check and echo any module in kernel .config that's not added to
107 # one of linux-* pkgs
108 ./stuff/check_modules.sh
109 }
111 # Pre and post install commands for Tazpkg.
112 post_install()
113 {
114 echo "Processing post-install commands..."
115 chroot "$1/" depmod -a $VERSION-slitaz
116 # GRUB stuff.
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 rm stuff/aufs2-*
146 rm -rf stuff/tmp
147 }