wok view linux/receipt @ rev 4472

linux .config (some changes similar to 2.6.29.3); add a modules check to receipt
author Rohit Joshi <jozee@slitaz.org>
date Mon Nov 09 14:00:35 2009 +0000 (2009-11-09)
parents 3681131f240a
children 271e813eaddc
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 cp -a Documentation fs include $src
23 cp -a *.patch ../stuff
24 fi
25 cd $src
26 # SliTaz db
27 rm -rf slitaz 2> /dev/null
28 mkdir slitaz
29 echo "$WGET_URL" > slitaz/url
30 cp ../stuff/gztazmod.sh ../stuff/list_modules.sh slitaz
31 # Misc patches from pascal
32 while read patch_file; do
33 echo "$patch_file" >> slitaz/patches
34 #cp ../stuff/$patch_file slitaz/$patch_file
35 cp ../stuff/$patch_file slitaz
36 if [ -f done.$patch_file ]; then
37 echo "Skipping $patch_file"
38 continue
39 fi
40 echo "Apply $patch_file"
41 patch -p1 < slitaz/$patch_file || exit 1
42 touch done.$patch_file
43 done <<EOT
44 $PACKAGE-utf8-$VERSION.u
45 $PACKAGE-diff-$VERSION.u
46 $PACKAGE-freeinitrd-$VERSION.u
47 $PACKAGE-unlzma-$VERSION.u
48 aufs2-base.patch
49 aufs2-kbuild.patch
50 aufs2-standalone.patch
51 EOT
52 make mrproper
53 cp ../stuff/$PACKAGE-$VERSION-slitaz.config .config
54 make oldconfig
55 ln .config slitaz/config
56 make bzImage &&
57 make modules &&
58 make INSTALL_MOD_PATH=$PWD/_pkg modules_install &&
59 make INSTALL_HDR_PATH=$PWD/_pkg/usr headers_install &&
60 [ -s arch/x86/boot/bzImage ]
61 }
63 # Rules to gen a SliTaz package suitable for Tazpkg.
64 genpkg_rules()
65 {
66 local path
67 mkdir $fs/boot
68 cp -a $src/arch/x86/boot/bzImage $fs/boot/vmlinuz-$VERSION-slitaz
69 # Compress all modules.
70 # Package module-init-tools is compiled with zlib support.
71 #
72 ./stuff/gztazmod.sh $_pkg/lib/modules/$VERSION-slitaz
73 path=$fs/lib/modules/$VERSION-slitaz/kernel
74 mkdir -p $path
75 cp -a $_pkg/lib/modules/$VERSION-slitaz/mo* $fs/lib/modules/$VERSION-slitaz
76 export src
77 export _pkg
78 $src/slitaz/list_modules.sh \
79 $(cat stuff/modules-$VERSION.list) > $src/modules.list
80 while read module; do
81 dir=$(dirname $module)
82 [ -d $path/$dir ] || mkdir -p $path/$dir
83 cp -a $_pkg/lib/modules/$VERSION-slitaz/kernel/$module $path/$dir
84 done < $src/modules.list
85 # Remove unresolved links
86 rm -f $fs/lib/modules/$VERSION-slitaz/build
87 rm -f $fs/lib/modules/$VERSION-slitaz/source
88 # Package all linux pkgs
89 for i in $(cd $WOK; ls -d linux-*)
90 do
91 tazwok genpkg $i
92 done
93 # Cook all packages with a kernel module
94 for i in $(cd $WOK; grep -l 'tazwok cook linux$' */receipt)
95 do
96 echo tazwok cook ${i%/receipt}
97 done
98 # check and echo any module in kernel .config that's not added to one of linux-* pkgs
99 ./stuff/check_modules.sh
100 }
102 # Pre and post install commands for Tazpkg.
103 # GRUB stuf.
104 post_install()
105 {
106 echo "Processing post-install commands..."
107 chroot "$1/" depmod -a $VERSION-slitaz
108 if [ -f "$1/boot/grub/menu.lst" ]; then
109 root_dev=`cat $1/boot/grub/menu.lst | grep root= | sed 's/.*root=\([^ ]*\).*/\1/' | head -n 1`
110 grub_dev=`cat $1/boot/grub/menu.lst | grep "root (" | head -n 1`
111 # Add new kernel entry in case of upgrade for installed system.
112 if ! grep -q $PACKAGE-$VERSION-slitaz $1/boot/grub/menu.lst; then
113 cat >> $1/boot/grub/menu.lst << EOT
115 title SliTaz GNU/Linux (Kernel $VERSION-slitaz)
116 $grub_dev
117 kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev
118 EOT
119 fi
120 # Display information message.
121 cat <<EOT
122 ----
123 GRUB is installed, these tree lines must be in your /boot/grub/menu.lst:
125 title SliTaz GNU/Linux (Kernel $VERSION-slitaz)
126 $grub_dev
127 kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev
128 ----
129 EOT
130 fi
131 }
133 clean_wok()
134 {
135 rm -rf aufs2
136 }