wok-current view linux/receipt @ rev 9117

scim-tables-additional: remove spurrious part of genpkg_rules
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Mar 05 13:01:38 2011 +0100 (2011-03-05)
parents 34e3298168a8
children 0c90dea68e8d
line source
1 # SliTaz package receipt.
3 PACKAGE="linux"
4 VERSION="2.6.37"
5 CATEGORY="base-system"
6 SHORT_DESC="The Linux kernel and modules."
7 DEPENDS="depmod"
8 BUILD_DEPENDS="slitaz-toolchain perl git lzma patch"
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 {
19 # this is code to help update the kernel version faster
20 #for i in $(grep -l 'WANTED="linux"' $WOK/*/receipt)
21 #do
22 # sed -i 's|VERSION="OLDVERSION"|VERSION="NEWVERSION"|g' $i
23 #done
24 report open-bloc
26 _AUFSVER=`grep ^VERSION= $WOK/aufs/receipt | cut -d "=" -f2 | sed -e 's/"//g'`
27 AUFSDIR=$WOK/$PACKAGE/aufs-${_AUFSVER}
28 tazwok get-src aufs --target=$AUFSDIR || { report close-bloc; return 1; }
29 cp -a $AUFSDIR/Documentation $AUFSDIR/fs $AUFSDIR/include $src
30 cp -a $AUFSDIR/*.patch $WOK/$PACKAGE/stuff
31 cd $src
32 # SliTaz db
33 [ -d $WOK/$PACKAGE/slitaz ] && rm -rf $WOK/$PACKAGE/slitaz 2> /dev/null
34 mkdir $WOK/$PACKAGE/slitaz
35 echo "$WGET_URL" > slitaz/url
36 cp $stuff/gztazmod.sh $stuff/list_modules.sh $WOK/$PACKAGE/slitaz
37 cp $stuff/bootloader.sh $WOK/$PACKAGE/slitaz
38 # Apply patches
39 report step "Applying patches"
40 while read patch_file; do
41 echo "$patch_file" >> $WOK/$PACKAGE/slitaz/patches
42 cp $stuff/$patch_file $WOK/$PACKAGE/slitaz
43 if [ -f done.$patch_file ]; then
44 echo "Skipping $patch_file"
45 continue
46 fi
47 echo "Apply $patch_file"
48 patch -p1 < $WOK/$PACKAGE/slitaz/$patch_file || { report close-bloc; return 1; }
49 touch done.$patch_file
50 done <<EOT
51 $PACKAGE-diff-$VERSION.u
52 $PACKAGE-unlzma-$VERSION.u
53 $PACKAGE-header-$VERSION.u
54 $PACKAGE-freeinitrd-$VERSION.u
55 aufs2-base.patch
56 aufs2-standalone.patch
57 001-squashfs-decompressors-add-xz-decompressor-module.patch
58 002-squashfs-decompressors-add-boot-time-xz-support.patch
59 003-squashfs-x86-support-xz-compressed-kernel.patch
60 004-squashfs-add-xz-compression-support.patch
61 005-squashfs-add-xz-compression-configuration-option.patch
62 EOT
63 report step "Make kernel proper and then build lguest"
64 make mrproper
65 cd Documentation/lguest
66 make lguest || { report close-bloc; return 1; }
67 cd $src
69 report step "Make bzImage without modules first"
70 # Build bzImage without modules first
71 cp -f $stuff/$PACKAGE-$VERSION-slitaz.config .config
72 sed -i 's/CONFIG_MODULES=y/# CONFIG_MODULES is not set/' .config
73 # We can't keep every driver in staging
74 sed -i -e 's/^CONFIG_RTL8192/#&/' \
75 -e 's/^CONFIG_R8187SE/#&/' \
76 -e 's/^CONFIG_RT2870/#&/' .config
77 yes '' | make oldconfig
78 make -j 4 bzImage || { report close-bloc; return 1; }
79 [ -d $PWD/_pkg ] || mkdir -p $PWD/_pkg
80 mv arch/x86/boot/bzImage $PWD/_pkg
81 mv System.map System.map-without-modules
83 report step "Now build bzImage with modules"
84 # Build bzImage with modules
85 cp -f $stuff/$PACKAGE-$VERSION-slitaz.config .config
86 make oldconfig
87 ln .config $WOK/$PACKAGE/slitaz/config
88 make -j 4 bzImage &&
89 make -j 4 modules &&
90 make INSTALL_MOD_PATH=$PWD/_pkg modules_install &&
91 make INSTALL_HDR_PATH=$PWD/_pkg/usr headers_install &&
92 [ -s arch/x86/boot/bzImage ] || { report close-bloc; return 1; }
93 mkdir -p $PWD/_pkg/boot 2> /dev/null
94 mv arch/x86/boot/bzImage $PWD/_pkg/boot/vmlinuz-$VERSION-slitaz
95 # Compress all modules.
96 report step "Compressing all modules"
97 $stuff/gztazmod.sh $PWD/_pkg/lib/modules/$VERSION-slitaz
98 ln System.map System.map-modules
99 ln Module.symvers Module.symvers-modules
100 report close-bloc
101 }
103 # Rules to gen a SliTaz package suitable for Tazpkg.
104 genpkg_rules()
105 {
106 local path
107 cp -a $_pkg/boot $fs
108 # Compress all modules.
109 #./stuff/gztazmod.sh $_pkg/lib/modules/$VERSION-slitaz
110 path=$fs/lib/modules/$VERSION-slitaz/kernel
111 mkdir -p $path
112 cp -a $_pkg/lib/modules/$VERSION-slitaz/mo* \
113 $fs/lib/modules/$VERSION-slitaz
114 # Get the base modules
115 export src
116 export _pkg
117 mkdir $WOK/$PACKAGE/tmp
118 $WOK/$PACKAGE/stuff/list_modules.sh \
119 $(cat stuff/modules-$VERSION.list) > $WOK/$PACKAGE/tmp/modules.list
120 while read module; do
121 dir=$(dirname $module)
122 [ -d $path/$dir ] || mkdir -p $path/$dir
123 cp -a $_pkg/lib/modules/$VERSION-slitaz/kernel/$module $path/$dir
124 done < $WOK/$PACKAGE/tmp/modules.list
125 # Remove unresolved links
126 rm -f $fs/lib/modules/$VERSION-slitaz/build
127 rm -f $fs/lib/modules/$VERSION-slitaz/source
128 # Cook all packages with a kernel module
129 for i in $(cd $WOK; grep -l 'tazwok cook linux$' */receipt)
130 do
131 echo tazwok cook ${i%/receipt}
132 done
133 # Check and echo any module in kernel .config that's not added to
134 # one of linux-* pkgs
135 ./stuff/check_modules.sh
136 }
138 # Pre and post install commands for Tazpkg.
139 post_install()
140 {
141 echo "Processing post-install commands..."
142 chroot "$1/" depmod -a $VERSION-slitaz
143 # GRUB stuff.
144 if [ -f "$1/boot/grub/menu.lst" ]; then
145 root_dev=`cat $1/boot/grub/menu.lst | grep root= | sed 's/.*root=\([^ ]*\).*/\1/' | head -n 1`
146 grub_dev=`cat $1/boot/grub/menu.lst | grep "root (" | head -n 1`
147 # Add new kernel entry in case of upgrade for installed system.
148 if ! grep -q $PACKAGE-$VERSION-slitaz $1/boot/grub/menu.lst; then
149 cat >> $1/boot/grub/menu.lst << EOT
151 title SliTaz GNU/Linux (Kernel $VERSION-slitaz)
152 $grub_dev
153 kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev
154 EOT
155 fi
156 # Display information message.
157 cat <<EOT
158 ----
159 GRUB is installed, these tree lines must be in your /boot/grub/menu.lst:
161 title SliTaz GNU/Linux (Kernel $VERSION-slitaz)
162 $grub_dev
163 kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev
164 ----
165 EOT
166 fi
167 }