wok-current view linux/receipt @ rev 10419
binutils: Replaced $BUILD_HOST with $HOST_SYSTEM.
author | Christopher Rogers <slaxemulator@gmail.com> |
---|---|
date | Tue May 24 13:39:17 2011 +0000 (2011-05-24) |
parents | efa076e44811 |
children | 93f683705964 |
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 MAINTAINER="devel@slitaz.org"
8 TARBALL="$PACKAGE-$VERSION.tar.bz2"
9 WEB_SITE="http://www.kernel.org/"
10 WGET_URL="http://www.eu.kernel.org/pub/linux/kernel/v${VERSION:0:3}/$TARBALL"
11 CONFIG_FILES="/lib/modules/$VERSION-slitaz/modules.dep"
13 DEPENDS="depmod"
14 BUILD_DEPENDS="slitaz-toolchain perl git lzma patch"
16 # FIXME: tazwok specific code in functions
18 # Rules to configure and make the package.
19 compile_rules()
20 {
21 cd $src
22 # this is code to help update the kernel version faster
23 #for i in $(grep -l 'WANTED="linux"' $WOK/*/receipt)
24 #do
25 # sed -i 's|VERSION="OLDVERSION"|VERSION="NEWVERSION"|g' $i
26 #done
28 # FIXME: tazwok specific code
29 #report open-bloc
31 # Check for Aufs and cook it if unbuilt.
32 echo "Checking for Aufs packages..."
33 _AUFSVER=`grep ^VERSION= $WOK/aufs/receipt | cut -d "=" -f2 | sed -e 's/"//g'`
34 AUFSDIR=$WOK/aufs/aufs-${_AUFSVER}
35 [ -d "$AUFSDIR" ] || AUFSDIR=$WOK/aufs/source/aufs-${_AUFSVER}
36 if [ ! -d "$AUFSDIR" ]; then
37 if [ -x /usr/bin/cook ]; then
38 # Give info an redirect to /dev/null since aufs got it own log.
39 echo "Cook: aufs $_AUFSVER"
40 cook aufs > /dev/null
41 else [ -x /usr/bin/tazwok ]
42 tazwok cook aufs
43 fi
44 fi
46 # FIXME: tazwok specific code (if aufs is cooked you dont need to get-src)
47 #tazwok get-src aufs --target=$AUFSDIR || { report close-bloc; return 1; }
49 echo "Copying Aufs files and patches..."
50 cp -a $AUFSDIR/Documentation $AUFSDIR/fs $AUFSDIR/include $src
51 cp -a $AUFSDIR/*.patch $stuff
53 # SliTaz db
54 rm -rf $WOK/$PACKAGE/slitaz && mkdir $WOK/$PACKAGE/slitaz
55 echo "$WGET_URL" > $WOK/$PACKAGE/slitaz/url
56 cp $stuff/gztazmod.sh $stuff/list_modules.sh $WOK/$PACKAGE/slitaz
57 cp $stuff/bootloader.sh $WOK/$PACKAGE/slitaz
59 # Apply patches
60 echo "Applying patches..."
61 while read patch_file; do
62 echo "$patch_file" >> $WOK/$PACKAGE/slitaz/patches
63 cp $stuff/$patch_file $WOK/$PACKAGE/slitaz
64 if [ -f done.$patch_file ]; then
65 echo "Skipping $patch_file"
66 continue
67 fi
68 echo "Apply $patch_file"
69 patch -p1 < $WOK/$PACKAGE/slitaz/$patch_file || { report close-bloc; return 1; }
70 touch done.$patch_file
71 done <<EOT
72 $PACKAGE-diff-$VERSION.u
73 $PACKAGE-unlzma-$VERSION.u
74 $PACKAGE-header-$VERSION.u
75 $PACKAGE-freeinitrd-$VERSION.u
76 aufs2-base.patch
77 aufs2-standalone.patch
78 001-squashfs-decompressors-add-xz-decompressor-module.patch
79 002-squashfs-decompressors-add-boot-time-xz-support.patch
80 003-squashfs-x86-support-xz-compressed-kernel.patch
81 004-squashfs-add-xz-compression-support.patch
82 005-squashfs-add-xz-compression-configuration-option.patch
83 EOT
85 # FIXME: tazwok specific code
86 #report step "Make kernel proper and then build lguest"
88 make mrproper
89 cd Documentation/lguest
90 make lguest || { report close-bloc; return 1; }
91 cd $src
93 # FIXME: tazwok specific code
94 #report step "Make bzImage without modules first"
96 # Build bzImage without modules first
97 cp -f $stuff/$PACKAGE-$VERSION-slitaz.config .config
98 sed -i 's/CONFIG_MODULES=y/# CONFIG_MODULES is not set/' .config
100 # We can't keep every driver in staging
101 sed -i -e 's/^CONFIG_RTL8192/#&/' \
102 -e 's/^CONFIG_R8187SE/#&/' \
103 -e 's/^CONFIG_RT2870/#&/' .config
104 yes '' | make oldconfig
105 make -j 4 bzImage || { report close-bloc; return 1; }
106 [ -d $PWD/_pkg ] || mkdir -p $PWD/_pkg
107 mv arch/x86/boot/bzImage $PWD/_pkg
108 mv System.map System.map-without-modules
110 # FIXME: tazwok specific code
111 #report step "Now build bzImage with modules"
113 # Build bzImage with modules
114 cp -f $stuff/$PACKAGE-$VERSION-slitaz.config .config
115 make oldconfig
116 ln .config $WOK/$PACKAGE/slitaz/config
117 make -j 4 bzImage &&
118 make -j 4 modules &&
119 make INSTALL_MOD_PATH=$PWD/_pkg modules_install &&
120 make INSTALL_HDR_PATH=$PWD/_pkg/usr headers_install &&
121 [ -s arch/x86/boot/bzImage ] || { report close-bloc; return 1; }
122 mkdir -p $PWD/_pkg/boot 2> /dev/null
123 mv arch/x86/boot/bzImage $PWD/_pkg/boot/vmlinuz-$VERSION-slitaz
125 # FIXME: tazwok specific code
126 #report step "Compressing all modules"
128 # Compress all modules.
129 $stuff/gztazmod.sh $PWD/_pkg/lib/modules/$VERSION-slitaz
130 ln System.map System.map-modules
131 ln Module.symvers Module.symvers-modules
133 # FIXME: tazwok specific code
134 #report close-bloc
135 }
137 # Rules to gen a SliTaz package suitable for Tazpkg.
138 genpkg_rules()
139 {
140 local path
141 cp -a $_pkg/boot $fs
142 # Compress all modules.
143 #$stuff/gztazmod.sh $_pkg/lib/modules/$VERSION-slitaz
144 path=$fs/lib/modules/$VERSION-slitaz/kernel
145 mkdir -p $path
146 cp -a $_pkg/lib/modules/$VERSION-slitaz/mo* \
147 $fs/lib/modules/$VERSION-slitaz
148 # Get the base modules
149 export src
150 export _pkg
151 mkdir $WOK/$PACKAGE/tmp
152 $stuff/list_modules.sh \
153 $(cat stuff/modules-$VERSION.list) > $WOK/$PACKAGE/tmp/modules.list
154 while read module; do
155 dir=$(dirname $module)
156 [ -d $path/$dir ] || mkdir -p $path/$dir
157 cp -a $_pkg/lib/modules/$VERSION-slitaz/kernel/$module $path/$dir
158 done < $WOK/$PACKAGE/tmp/modules.list
159 # Remove unresolved links
160 rm -f $fs/lib/modules/$VERSION-slitaz/build
161 rm -f $fs/lib/modules/$VERSION-slitaz/source
162 # Cook all packages with a kernel module
163 for i in $(cd $WOK; grep -l 'tazwok cook linux$' */receipt)
164 do
165 echo tazwok cook ${i%/receipt}
166 done
167 # Check and echo any module in kernel .config that's not added to
168 # one of linux-* pkgs
169 $stuff/check_modules.sh
170 }
172 # Pre and post install commands for Tazpkg.
173 post_install()
174 {
175 echo "Processing post-install commands..."
176 chroot "$1/" depmod -a $VERSION-slitaz
177 # GRUB stuff.
178 if [ -f "$1/boot/grub/menu.lst" ]; then
179 root_dev=`cat $1/boot/grub/menu.lst | grep root= | sed 's/.*root=\([^ ]*\).*/\1/' | head -n 1`
180 grub_dev=`cat $1/boot/grub/menu.lst | grep "root (" | head -n 1`
181 # Add new kernel entry in case of upgrade for installed system.
182 if ! grep -q $PACKAGE-$VERSION-slitaz $1/boot/grub/menu.lst; then
183 cat >> $1/boot/grub/menu.lst << EOT
185 title SliTaz GNU/Linux (Kernel $VERSION-slitaz)
186 $grub_dev
187 kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev
188 EOT
189 fi
190 # Display information message.
191 cat <<EOT
192 ----
193 GRUB is installed, these tree lines must be in your /boot/grub/menu.lst:
195 title SliTaz GNU/Linux (Kernel $VERSION-slitaz)
196 $grub_dev
197 kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev
198 ----
199 EOT
200 fi
201 }