wok-next view linux/receipt @ rev 7674

Fixed linux. Need to make folder PWD/_pkg before adding bzImage to it. Also i'm force copying kernel config file now so we have the right config. It is copyed twice so its needed and doesn't hunt anything i think.
author Christopher Rogers <slaxemulator@gmail.com>
date Thu Dec 16 17:16:06 2010 +0000 (2010-12-16)
parents 26db9394c095
children a361eb1b091e
line source
1 # SliTaz package receipt.
3 PACKAGE="linux"
4 VERSION="2.6.36"
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 {
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 local _AUFSVER=`grep ^VERSION= $WOK/aufs/receipt | cut -d "=" -f2 | sed -e 's/"//g'`
25 local AUFSDIR="aufs-${_AUFSVER}"
26 TARBALL=$SOURCES_REPOSITORY/$AUFSDIR.tar.gz
27 if [ -f $TARBALL ]; then
28 tar xzf $TARBALL
29 cd $AUFSDIR && git checkout origin/aufs2.1-36
30 cd $WOK/$PACKAGE
31 else
32 # Aufs2 from git repository
33 git clone http://git.c3sl.ufpr.br/pub/scm/aufs/aufs2-standalone.git $AUFSDIR
34 tar czf $TARBALL $AUFSDIR
35 cd $AUFSDIR && git checkout origin/aufs2.1-36
36 cd $WOK/$PACKAGE
37 fi
38 cp -a $AUFSDIR/Documentation $AUFSDIR/fs $AUFSDIR/include $src
39 cp -a $AUFSDIR/*.patch $WOK/$PACKAGE/stuff
40 # We need the real GNU patch
41 [ -L /usr/bin/patch ] && tazpkg get-install patch --forced
42 cd $src
43 # SliTaz db
44 [ -d slitaz ] && rm -rf slitaz 2> /dev/null
45 mkdir slitaz
46 echo "$WGET_URL" > slitaz/url
47 cp ../stuff/gztazmod.sh ../stuff/list_modules.sh slitaz
48 cp ../stuff/bootloader.sh slitaz
49 # Apply patches
50 while read patch_file; do
51 echo "$patch_file" >> slitaz/patches
52 cp ../stuff/$patch_file slitaz
53 if [ -f done.$patch_file ]; then
54 echo "Skipping $patch_file"
55 continue
56 fi
57 echo "Apply $patch_file"
58 patch -p1 < slitaz/$patch_file || exit 1
59 touch done.$patch_file
60 done <<EOT
61 $PACKAGE-diff-$VERSION.u
62 $PACKAGE-unlzma-$VERSION.u
63 $PACKAGE-header-$VERSION.u
64 $PACKAGE-freeinitrd-$VERSION.u
65 aufs2-base.patch
66 aufs2-standalone.patch
67 001-squashfs-decompressors-add-xz-decompressor-module.patch
68 002-squashfs-decompressors-add-boot-time-xz-support.patch
69 003-squashfs-x86-support-xz-compressed-kernel.patch
70 004-squashfs-add-xz-compression-support.patch
71 005-squashfs-add-xz-compression-configuration-option.patch
72 EOT
73 make mrproper
74 cd Documentation/lguest
75 make lguest || return 1
76 cd ../..
78 # Build bzImage without modules first
79 cp -f ../stuff/$PACKAGE-$VERSION-slitaz.config .config
80 sed -i 's/CONFIG_MODULES=y/# CONFIG_MODULES is not set/' .config
81 # We can't keep every driver in staging
82 sed -i -e 's/^CONFIG_RTL8192/#&/' \
83 -e 's/^CONFIG_R8187SE/#&/' \
84 -e 's/^CONFIG_RT2870/#&/' .config
85 yes '' | make oldconfig
86 make -j 4 bzImage || return 1
87 [-d $PWD/_pkg ] || mkdir -p $PWD/_pkg
88 mv arch/x86/boot/bzImage $PWD/_pkg
89 mv System.map System.map-without-modules
91 # Build bzImage with modules
92 cp -f ../stuff/$PACKAGE-$VERSION-slitaz.config .config
93 make oldconfig
94 ln .config slitaz/config
95 make -j 4 bzImage &&
96 make -j 4 modules &&
97 make INSTALL_MOD_PATH=$PWD/_pkg modules_install &&
98 make INSTALL_HDR_PATH=$PWD/_pkg/usr headers_install &&
99 [ -s arch/x86/boot/bzImage ] || return 1
100 mkdir -p $PWD/_pkg/boot 2> /dev/null
101 mv arch/x86/boot/bzImage $PWD/_pkg/boot/vmlinuz-$VERSION-slitaz
102 # Compress all modules.
103 $WOK/$PACKAGE/stuff/gztazmod.sh $PWD/_pkg/lib/modules/$VERSION-slitaz
104 ln System.map System.map-modules
105 ln Module.symvers Module.symvers-modules
106 }
108 # Rules to gen a SliTaz package suitable for Tazpkg.
109 genpkg_rules()
110 {
111 local path
112 cp -a $_pkg/boot $fs
113 # Compress all modules.
114 #./stuff/gztazmod.sh $_pkg/lib/modules/$VERSION-slitaz
115 path=$fs/lib/modules/$VERSION-slitaz/kernel
116 mkdir -p $path
117 cp -a $_pkg/lib/modules/$VERSION-slitaz/mo* \
118 $fs/lib/modules/$VERSION-slitaz
119 # Get the base modules
120 export src
121 export _pkg
122 $src/slitaz/list_modules.sh \
123 $(cat stuff/modules-$VERSION.list) > $src/modules.list
124 while read module; do
125 dir=$(dirname $module)
126 [ -d $path/$dir ] || mkdir -p $path/$dir
127 cp -a $_pkg/lib/modules/$VERSION-slitaz/kernel/$module $path/$dir
128 done < $src/modules.list
129 # Remove unresolved links
130 rm -f $fs/lib/modules/$VERSION-slitaz/build
131 rm -f $fs/lib/modules/$VERSION-slitaz/source
132 # Cook all packages with a kernel module
133 for i in $(cd $WOK; grep -l 'tazwok cook linux$' */receipt)
134 do
135 echo tazwok cook ${i%/receipt}
136 done
137 # Check and echo any module in kernel .config that's not added to
138 # one of linux-* pkgs
139 ./stuff/check_modules.sh
140 }
142 # Pre and post install commands for Tazpkg.
143 post_install()
144 {
145 echo "Processing post-install commands..."
146 chroot "$1/" depmod -a $VERSION-slitaz
147 # GRUB stuff.
148 if [ -f "$1/boot/grub/menu.lst" ]; then
149 root_dev=`cat $1/boot/grub/menu.lst | grep root= | sed 's/.*root=\([^ ]*\).*/\1/' | head -n 1`
150 grub_dev=`cat $1/boot/grub/menu.lst | grep "root (" | head -n 1`
151 # Add new kernel entry in case of upgrade for installed system.
152 if ! grep -q $PACKAGE-$VERSION-slitaz $1/boot/grub/menu.lst; then
153 cat >> $1/boot/grub/menu.lst << EOT
155 title SliTaz GNU/Linux (Kernel $VERSION-slitaz)
156 $grub_dev
157 kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev
158 EOT
159 fi
160 # Display information message.
161 cat <<EOT
162 ----
163 GRUB is installed, these tree lines must be in your /boot/grub/menu.lst:
165 title SliTaz GNU/Linux (Kernel $VERSION-slitaz)
166 $grub_dev
167 kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev
168 ----
169 EOT
170 fi
171 }
173 clean_wok()
174 {
175 #rm -rf aufs2
176 rm stuff/aufs2-base*
177 rm stuff/aufs2-standalone*
178 rm stuff/aufs2-kbuild*
179 rm -rf stuff/tmp
180 }