wok diff linux/receipt @ rev 12285
Up: linux (3.2.14) Let play with the kernel :-)
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Sun Apr 15 16:27:00 2012 +0200 (2012-04-15) |
parents | 41cee386ada1 |
children | a8baf2428b53 |
line diff
1.1 --- a/linux/receipt Wed Mar 07 09:10:02 2012 +0100 1.2 +++ b/linux/receipt Sun Apr 15 16:27:00 2012 +0200 1.3 @@ -1,17 +1,19 @@ 1.4 # SliTaz package receipt. 1.5 1.6 PACKAGE="linux" 1.7 -VERSION="2.6.37" 1.8 +VERSION="3.2.14" 1.9 +KBASEVER="${VERSION:0:3}" 1.10 CATEGORY="base-system" 1.11 SHORT_DESC="The Linux kernel and modules." 1.12 MAINTAINER="devel@slitaz.org" 1.13 -TARBALL="$PACKAGE-$VERSION.tar.bz2" 1.14 +TARBALL="$PACKAGE-$KBASEVER.tar.xz" 1.15 WEB_SITE="http://www.kernel.org/" 1.16 -WGET_URL="http://www.kernel.org/pub/linux/kernel/v${VERSION:0:3}/$TARBALL" 1.17 -CONFIG_FILES="/lib/modules/$VERSION-slitaz/modules.dep" 1.18 +WGET_URL="http://www.kernel.org/pub/linux/kernel/v3.0/$TARBALL" 1.19 +CONFIG_FILES="/lib/modules/$KBASEVER-slitaz/modules.dep" 1.20 1.21 DEPENDS="depmod" 1.22 -BUILD_DEPENDS="slitaz-toolchain perl git lzma patch" 1.23 +BUILD_DEPENDS="slitaz-toolchain perl git lzma patch uclibc-cross-compiler-x86_64" 1.24 +[ "$KBASEVER" != "$VERSION" ] && PATCH="http://www.kernel.org/pub/linux/kernel/v3.0/patch-$VERSION.xz" 1.25 1.26 # Rules to configure and make the package. 1.27 compile_rules() 1.28 @@ -27,66 +29,89 @@ 1.29 1.30 # Check for Aufs and cook it if unbuilt. 1.31 echo "Checking for Aufs packages..." 1.32 - _AUFSVER=`grep ^VERSION= $WOK/aufs/receipt | cut -d "=" -f2 | sed -e 's/"//g'` 1.33 - if [ ! -d "$AUFSDIR" ] && [ -x /usr/bin/cook ]; then 1.34 + _AUFSVER=`grep ^VERSION= $WOK/aufs/receipt | cut -d "=" -f2 | sed -e 's/"//g'` 1.35 + if [ -x /usr/bin/cook ]; then 1.36 # Give info an redirect to /dev/null since aufs got it own log. 1.37 AUFSDIR=$WOK/aufs/source/aufs-${_AUFSVER} 1.38 - echo "Cook: aufs $_AUFSVER" 1.39 - cook aufs > /dev/null 1.40 - elif [ ! -x /usr/bin/cook ]; then 1.41 - # We only need aufs source. Also cooking now is a bad idea since it 1.42 - # needs linux-module-headers. 1.43 + [ -d "$AUFSDIR" ] && rm -rf $AUFSDIR 1.44 + #echo "Cook: aufs $_AUFSVER" 1.45 + cook aufs --getsrc --extract > /dev/null 1.46 + elif [ -x /usr/bin/tazwok ]; then 1.47 + # we just need aufs source. Also cooking now is a bad idea since it 1.48 + # needs linux-module-headers. The one your cooking not the one from the web. 1.49 AUFSDIR=$WOK/aufs/aufs-${_AUFSVER} 1.50 [ -d "$AUFSDIR" ] && rm -rf $AUFSDIR 1.51 tazwok get-src aufs --target=$AUFSDIR || { report close-bloc; return 1; } 1.52 fi 1.53 - 1.54 + echo "cook:linux" > $command 1.55 + 1.56 echo "Copying Aufs files and patches..." 1.57 cp -a $AUFSDIR/Documentation $AUFSDIR/fs $AUFSDIR/include $src 1.58 - cp -a $AUFSDIR/*.patch $stuff 1.59 - 1.60 + cp -a $AUFSDIR/aufs3-*.patch $stuff 1.61 + 1.62 # SliTaz db 1.63 - rm -rf $WOK/$PACKAGE/slitaz && mkdir $WOK/$PACKAGE/slitaz 1.64 + [ -d $WOK/$PACKAGE/source/slitaz ] && rm -rf $WOK/$PACKAGE/source/slitaz 2> /dev/null 1.65 + mkdir -p $WOK/$PACKAGE/source/slitaz 1.66 echo "$WGET_URL" > $WOK/$PACKAGE/slitaz/url 1.67 - cp $stuff/gztazmod.sh $stuff/list_modules.sh $WOK/$PACKAGE/slitaz 1.68 - cp $stuff/bootloader.sh $WOK/$PACKAGE/slitaz 1.69 + cp $stuff/gztazmod.sh $stuff/list_modules.sh $WOK/$PACKAGE/source/slitaz 1.70 + cp $stuff/bootloader.sh $WOK/$PACKAGE/source/slitaz 1.71 1.72 # Apply patches 1.73 echo "Applying patches..." 1.74 while read patch_file; do 1.75 - echo "$patch_file" >> $WOK/$PACKAGE/slitaz/patches 1.76 - cp $stuff/$patch_file $WOK/$PACKAGE/slitaz 1.77 + echo "$patch_file" >> $WOK/$PACKAGE/source/slitaz/patches 1.78 + cp $stuff/$patch_file $WOK/$PACKAGE/source/slitaz 1.79 if [ -f done.$patch_file ]; then 1.80 echo "Skipping $patch_file" 1.81 continue 1.82 fi 1.83 echo "Apply $patch_file" 1.84 - patch -p1 < $WOK/$PACKAGE/slitaz/$patch_file || { report close-bloc; return 1; } 1.85 + if [ -x /usr/bin/cook ]; then 1.86 + patch -p1 < $WOK/$PACKAGE/source/slitaz/$patch_file || return 1 1.87 + elif [ -x /usr/bin/tazwok ]; then 1.88 + patch -p1 < $WOK/$PACKAGE/source/slitaz/$patch_file || { report close-bloc; return 1; } 1.89 + fi 1.90 touch done.$patch_file 1.91 done <<EOT 1.92 -$PACKAGE-diff-$VERSION.u 1.93 -$PACKAGE-header-$VERSION.u 1.94 -$PACKAGE-freeinitrd-$VERSION.u 1.95 -aufs2-base.patch 1.96 -aufs2-standalone.patch 1.97 -001-squashfs-decompressors-add-xz-decompressor-module.patch 1.98 -002-squashfs-decompressors-add-boot-time-xz-support.patch 1.99 -003-squashfs-x86-support-xz-compressed-kernel.patch 1.100 -004-squashfs-add-xz-compression-support.patch 1.101 -005-squashfs-add-xz-compression-configuration-option.patch 1.102 +$PACKAGE-diff.u 1.103 +$PACKAGE-header.u 1.104 +$PACKAGE-freeinitrd.u 1.105 +aufs3-base.patch 1.106 +aufs3-standalone.patch 1.107 +aufs3-loopback.patch 1.108 +aufs3-proc_map.patch 1.109 +channel-negative-one-maxim.patch 1.110 +mac80211.compat08082009.wl_frag+ack_v1.patch 1.111 EOT 1.112 1.113 + if [ "$KBASEVER" != "$VERSION" ]; then 1.114 + if [ -f $SOURCES_REPOSITORY/$(basename $PATCH) ]; then 1.115 + xzcat $SOURCES_REPOSITORY/$(basename $PATCH) | patch -Np1 1.116 + touch done.patch-$VERSION 1.117 + else 1.118 + wget $PATCH -O $SRC/$(basename $PATCH) 1.119 + xzcat $SRC/$(basename $PATCH) | patch -Np1 1.120 + touch done.patch-$VERSION 1.121 + fi 1.122 + fi 1.123 + 1.124 + sed -i 's|SUBLEVEL =.*|SUBLEVEL =|g' Makefile 1.125 + 1.126 [ ! -x /usr/bin/cook ] && report step "Make kernel proper and then build lguest" 1.127 1.128 make mrproper 1.129 - cd Documentation/lguest 1.130 - make $MAKEFLAGS lguest || { report close-bloc; return 1; } 1.131 + cd Documentation/virtual/lguest 1.132 + if [ -x /usr/bin/cook ]; then 1.133 + make lguest || return 1 1.134 + elif [ -x /usr/bin/tazwok ]; then 1.135 + make lguest || { report close-bloc; return 1; } 1.136 + fi 1.137 cd $src 1.138 1.139 [ ! -x /usr/bin/cook ] && report step "Make bzImage without modules first" 1.140 1.141 # Build bzImage without modules first 1.142 - cp -f $stuff/$PACKAGE-$VERSION-slitaz.config .config 1.143 + cp -f $stuff/$PACKAGE-slitaz.config .config 1.144 sed -i 's/CONFIG_MODULES=y/# CONFIG_MODULES is not set/' .config 1.145 1.146 # We can't keep every driver in staging 1.147 @@ -94,29 +119,78 @@ 1.148 -e 's/^CONFIG_R8187SE/#&/' \ 1.149 -e 's/^CONFIG_RT2870/#&/' .config 1.150 yes '' | make oldconfig 1.151 - make $MAKEFLAGS bzImage || { report close-bloc; return 1; } 1.152 - [ -d $PWD/_pkg ] || mkdir -p $PWD/_pkg 1.153 - mv arch/x86/boot/bzImage $PWD/_pkg 1.154 + if [ -x /usr/bin/cook ]; then 1.155 + make -j 4 bzImage || exit 1 1.156 + elif [ -x /usr/bin/tazwok ]; then 1.157 + make -j 4 bzImage || { report close-bloc; return 1; } 1.158 + fi 1.159 + [ -d $DESTDIR ] || mkdir -p $DESTDIR 1.160 + mv arch/x86/boot/bzImage $DESTDIR 1.161 mv System.map System.map-without-modules 1.162 1.163 [ ! -x /usr/bin/cook ] && report step "Now build bzImage with modules" 1.164 1.165 # Build bzImage with modules 1.166 - cp -f $stuff/$PACKAGE-$VERSION-slitaz.config .config 1.167 - make oldconfig 1.168 - ln .config $WOK/$PACKAGE/slitaz/config 1.169 - make $MAKEFLAGS bzImage && 1.170 - make $MAKEFLAGS modules && 1.171 - make INSTALL_MOD_PATH=$PWD/_pkg modules_install && 1.172 - make INSTALL_HDR_PATH=$PWD/_pkg/usr headers_install && 1.173 - [ -s arch/x86/boot/bzImage ] || { report close-bloc; return 1; } 1.174 - mkdir -p $PWD/_pkg/boot 2> /dev/null 1.175 - mv arch/x86/boot/bzImage $PWD/_pkg/boot/vmlinuz-$VERSION-slitaz 1.176 + cp -f $stuff/$PACKAGE-slitaz.config .config 1.177 + #make oldconfig 1.178 + ln .config $WOK/$PACKAGE/source/slitaz/config 1.179 + make -j 4 bzImage && 1.180 + make -j 4 modules && 1.181 + make INSTALL_MOD_PATH=$DESTDIR modules_install && 1.182 + make INSTALL_HDR_PATH=$DESTDIR/usr headers_install && 1.183 + if [ -x /usr/bin/cook ]; then 1.184 + [ -s arch/x86/boot/bzImage ] || return 1 1.185 + elif [ -x /usr/bin/tazwok ]; then 1.186 + [ -s arch/x86/boot/bzImage ] || { report close-bloc; return 1; } 1.187 + fi 1.188 + mkdir -p $DESTDIR/boot 2> /dev/null 1.189 + mv arch/x86/boot/bzImage $DESTDIR/boot/vmlinuz-$VERSION-slitaz 1.190 + 1.191 + [ ! -x /usr/bin/cook ] && report step "Make bzImage64 without modules first" 1.192 + 1.193 + # Build bzImage64 without modules first 1.194 + cp -f $stuff/$PACKAGE-$VERSION-slitaz.config64 .config 1.195 + sed -i 's/CONFIG_MODULES=y/# CONFIG_MODULES is not set/' .config 1.196 + 1.197 + # We can't keep every driver in staging 1.198 + sed -i -e 's/^CONFIG_RTL8192/#&/' \ 1.199 + -e 's/^CONFIG_R8187SE/#&/' \ 1.200 + -e 's/^CONFIG_RT2870/#&/' .config 1.201 + yes '' | make ARCH=x86_64 oldconfig 1.202 + if [ -x /usr/bin/cook ]; then 1.203 + make -j 4 ARCH=x86_64 CROSS_COMPILE=uclibc-x86_64- bzImage || exit 1 1.204 + elif [ -x /usr/bin/tazwok ]; then 1.205 + make -j 4 ARCH=x86_64 CROSS_COMPILE=uclibc-x86_64- bzImage || { report close-bloc; return 1; } 1.206 + fi 1.207 + [ -d $PWD/_pkg ] || mkdir -p $DESTDIR/linux64 1.208 + mv arch/x86/boot/bzImage $DESTDIR/linux64 1.209 + mv System.map System.map-without-modules64 1.210 + 1.211 + [ ! -x /usr/bin/cook ] && report step "Now build bzImage64 with modules" 1.212 + 1.213 + # Build bzImage64 with modules 1.214 + cp -f $stuff/$PACKAGE-$VERSION-slitaz.config64 .config 1.215 + #make ARCH=x86_64 oldconfig 1.216 + ln .config $WOK/$PACKAGE/slitaz/config64 1.217 + make -j 4 ARCH=x86_64 CROSS_COMPILE=uclibc-x86_64- bzImage && 1.218 + make -j 4 ARCH=x86_64 CROSS_COMPILE=uclibc-x86_64- modules && 1.219 + make ARCH=x86_64 INSTALL_MOD_PATH=$DESTDIR/linux64 modules_install && 1.220 + make ARCH=x86_64 INSTALL_HDR_PATH=$DESTDIR/linux64/usr headers_install && 1.221 + if [ -x /usr/bin/cook ]; then 1.222 + [ -s arch/x86/boot/bzImage ] || return 1 1.223 + elif [ -x /usr/bin/tazwok ]; then 1.224 + [ -s arch/x86/boot/bzImage ] || { report close-bloc; return 1; } 1.225 + fi 1.226 + mkdir -p $DESTDIR/linux64/boot 2> /dev/null 1.227 + mv arch/x86/boot/bzImage $DESTDIR/linux64/boot/vmlinuz-$VERSION-slitaz 1.228 + ln System.map System.map-modules64 1.229 + ln Module.symvers Module.symvers-modules64 1.230 1.231 [ ! -x /usr/bin/cook ] && report step "Compressing all modules" 1.232 1.233 # Compress all modules. 1.234 - $stuff/gztazmod.sh $PWD/_pkg/lib/modules/$VERSION-slitaz 1.235 + $stuff/gztazmod.sh $DESTDIR/lib/modules/$KBASEVER-slitaz 1.236 + $stuff/gztazmod.sh $DESTDIR/linux64/lib/modules/$KBASEVER-slitaz 1.237 ln System.map System.map-modules 1.238 ln Module.symvers Module.symvers-modules 1.239 1.240 @@ -131,28 +205,36 @@ 1.241 local path 1.242 cp -a $_pkg/boot $fs 1.243 # Compress all modules. 1.244 - #$stuff/gztazmod.sh $_pkg/lib/modules/$VERSION-slitaz 1.245 - path=$fs/lib/modules/$VERSION-slitaz/kernel 1.246 + #$stuff/gztazmod.sh $_pkg/lib/modules/$KBASEVER-slitaz 1.247 + path=$fs/lib/modules/$KBASEVER-slitaz/kernel 1.248 mkdir -p $path 1.249 - cp -a $_pkg/lib/modules/$VERSION-slitaz/mo* \ 1.250 - $fs/lib/modules/$VERSION-slitaz 1.251 + cp -a $_pkg/lib/modules/$KBASEVER-slitaz/mo* \ 1.252 + $fs/lib/modules/$KBASEVER-slitaz 1.253 # Get the base modules 1.254 export src 1.255 export _pkg 1.256 - mkdir $WOK/$PACKAGE/tmp 1.257 + mkdir -p $WOK/$PACKAGE/source/tmp 1.258 $stuff/list_modules.sh \ 1.259 - $(cat stuff/modules-$VERSION.list) > $WOK/$PACKAGE/tmp/modules.list 1.260 + $(cat $stuff/modules.list) > $WOK/$PACKAGE/source/tmp/modules.list 1.261 while read module; do 1.262 dir=$(dirname $module) 1.263 [ -d $path/$dir ] || mkdir -p $path/$dir 1.264 - cp -a $_pkg/lib/modules/$VERSION-slitaz/kernel/$module $path/$dir 1.265 - done < $WOK/$PACKAGE/tmp/modules.list 1.266 + cp -a $_pkg/lib/modules/$KBASEVER-slitaz/kernel/$module $path/$dir 1.267 + done < $WOK/$PACKAGE/source/tmp/modules.list 1.268 # Remove unresolved links 1.269 - rm -f $fs/lib/modules/$VERSION-slitaz/build 1.270 - rm -f $fs/lib/modules/$VERSION-slitaz/source 1.271 + rm -f $fs/lib/modules/$KBASEVER-slitaz/build 1.272 + rm -f $fs/lib/modules/$KBASEVER-slitaz/source 1.273 + # Cook all packages with a kernel module 1.274 + for i in $(cd $WOK; grep -l 'tazwok cook linux$' */receipt) 1.275 + do 1.276 + echo tazwok cook ${i%/receipt} 1.277 + done 1.278 + # Fixed modules.dep to use right path 1.279 + # saves 100kb of space too 1.280 + sed -i "s|$_pkg||g" $fs/lib/modules/$KBASEVER-slitaz/modules.dep 1.281 + sed -i "s|99.98.$KBASEVER-slitaz|$KBASEVER-slitaz|g" $fs/lib/modules/$KBASEVER-slitaz/modules.dep 1.282 # Check and echo any module in kernel .config that's not added to 1.283 # one of linux-* pkgs 1.284 - export PACKAGE 1.285 $stuff/check_modules.sh 1.286 } 1.287 1.288 @@ -160,7 +242,7 @@ 1.289 post_install() 1.290 { 1.291 echo "Processing post-install commands..." 1.292 - chroot "$1/" depmod -a $VERSION-slitaz 1.293 + chroot "$1/" depmod -a $KBASEVER-slitaz 1.294 # GRUB stuff. 1.295 if [ -f "$1/boot/grub/menu.lst" ]; then 1.296 root_dev=`cat $1/boot/grub/menu.lst | grep root= | sed 's/.*root=\([^ ]*\).*/\1/' | head -n 1`