wok-6.x view linux/receipt @ rev 8711

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