wok-6.x annotate linux/receipt @ rev 12625
linux: uclibc-cross-compiler is not compatible with aufs
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sun Apr 29 12:35:19 2012 +0200 (2012-04-29) |
parents | c4884f4da7e8 |
children | 2b28b3fc0a64 |
rev | line source |
---|---|
pankso@3 | 1 # SliTaz package receipt. |
pankso@3 | 2 |
pankso@3 | 3 PACKAGE="linux" |
pankso@12285 | 4 VERSION="3.2.14" |
pankso@12285 | 5 KBASEVER="${VERSION:0:3}" |
pankso@3 | 6 CATEGORY="base-system" |
pankso@3 | 7 SHORT_DESC="The Linux kernel and modules." |
pankso@3864 | 8 MAINTAINER="devel@slitaz.org" |
pankso@12285 | 9 TARBALL="$PACKAGE-$KBASEVER.tar.xz" |
pankso@3 | 10 WEB_SITE="http://www.kernel.org/" |
pankso@12285 | 11 WGET_URL="http://www.kernel.org/pub/linux/kernel/v3.0/$TARBALL" |
pascal@12625 | 12 AUFS_NOT_SUPPORTED="uclibc-cross-compiler-x86_64 is not compatible with aufs 8(" |
pankso@12285 | 13 CONFIG_FILES="/lib/modules/$KBASEVER-slitaz/modules.dep" |
pankso@3 | 14 |
pankso@9731 | 15 DEPENDS="depmod" |
pascal@12558 | 16 BUILD_DEPENDS="slitaz-toolchain perl git xz lzma patch uclibc-cross-compiler-x86_64" |
pankso@12285 | 17 [ "$KBASEVER" != "$VERSION" ] && PATCH="http://www.kernel.org/pub/linux/kernel/v3.0/patch-$VERSION.xz" |
pankso@9731 | 18 |
pankso@3 | 19 # Rules to configure and make the package. |
pankso@3 | 20 compile_rules() |
pankso@3 | 21 { |
pankso@9731 | 22 cd $src |
slaxemulator@7131 | 23 # this is code to help update the kernel version faster |
slaxemulator@7131 | 24 #for i in $(grep -l 'WANTED="linux"' $WOK/*/receipt) |
slaxemulator@7131 | 25 #do |
slaxemulator@7131 | 26 # sed -i 's|VERSION="OLDVERSION"|VERSION="NEWVERSION"|g' $i |
slaxemulator@7131 | 27 #done |
slaxemulator@8616 | 28 |
gokhlayeh@11395 | 29 [ ! -x /usr/bin/cook ] && report open-bloc |
pankso@9731 | 30 |
pankso@9731 | 31 # Check for Aufs and cook it if unbuilt. |
pankso@9731 | 32 echo "Checking for Aufs packages..." |
pankso@12285 | 33 _AUFSVER=`grep ^VERSION= $WOK/aufs/receipt | cut -d "=" -f2 | sed -e 's/"//g'` |
pankso@12285 | 34 if [ -x /usr/bin/cook ]; then |
gokhlayeh@11395 | 35 # Give info an redirect to /dev/null since aufs got it own log. |
gokhlayeh@11395 | 36 AUFSDIR=$WOK/aufs/source/aufs-${_AUFSVER} |
pankso@12285 | 37 [ -d "$AUFSDIR" ] && rm -rf $AUFSDIR |
pankso@12285 | 38 #echo "Cook: aufs $_AUFSVER" |
pankso@12288 | 39 cook aufs --getsrc |
pankso@12288 | 40 mkdir -p $WOK/aufs/source/ |
pankso@12289 | 41 tar xjf $SRC/aufs-${_AUFSVER}.tar.bz2 -C $WOK/aufs/source/ |
pankso@12285 | 42 elif [ -x /usr/bin/tazwok ]; then |
pankso@12285 | 43 # we just need aufs source. Also cooking now is a bad idea since it |
pankso@12285 | 44 # needs linux-module-headers. The one your cooking not the one from the web. |
gokhlayeh@11395 | 45 AUFSDIR=$WOK/aufs/aufs-${_AUFSVER} |
gokhlayeh@11395 | 46 [ -d "$AUFSDIR" ] && rm -rf $AUFSDIR |
gokhlayeh@11395 | 47 tazwok get-src aufs --target=$AUFSDIR || { report close-bloc; return 1; } |
pankso@9731 | 48 fi |
pankso@12285 | 49 echo "cook:linux" > $command |
pankso@12285 | 50 |
pankso@9731 | 51 echo "Copying Aufs files and patches..." |
slaxemulator@7297 | 52 cp -a $AUFSDIR/Documentation $AUFSDIR/fs $AUFSDIR/include $src |
pankso@12285 | 53 cp -a $AUFSDIR/aufs3-*.patch $stuff |
pankso@12285 | 54 |
pankso@4251 | 55 # SliTaz db |
pankso@12285 | 56 [ -d $WOK/$PACKAGE/source/slitaz ] && rm -rf $WOK/$PACKAGE/source/slitaz 2> /dev/null |
pankso@12285 | 57 mkdir -p $WOK/$PACKAGE/source/slitaz |
pankso@12290 | 58 echo "$WGET_URL" > $WOK/$PACKAGE/source/slitaz/url |
pankso@12285 | 59 cp $stuff/gztazmod.sh $stuff/list_modules.sh $WOK/$PACKAGE/source/slitaz |
pankso@12285 | 60 cp $stuff/bootloader.sh $WOK/$PACKAGE/source/slitaz |
pankso@9731 | 61 |
pankso@5640 | 62 # Apply patches |
pankso@9731 | 63 echo "Applying patches..." |
pascal@521 | 64 while read patch_file; do |
pankso@12285 | 65 echo "$patch_file" >> $WOK/$PACKAGE/source/slitaz/patches |
pankso@12285 | 66 cp $stuff/$patch_file $WOK/$PACKAGE/source/slitaz |
pascal@1442 | 67 if [ -f done.$patch_file ]; then |
pascal@1442 | 68 echo "Skipping $patch_file" |
pascal@1442 | 69 continue |
pascal@1442 | 70 fi |
pascal@521 | 71 echo "Apply $patch_file" |
pankso@12285 | 72 if [ -x /usr/bin/cook ]; then |
pankso@12285 | 73 patch -p1 < $WOK/$PACKAGE/source/slitaz/$patch_file || return 1 |
pankso@12285 | 74 elif [ -x /usr/bin/tazwok ]; then |
pankso@12285 | 75 patch -p1 < $WOK/$PACKAGE/source/slitaz/$patch_file || { report close-bloc; return 1; } |
pankso@12285 | 76 fi |
pascal@1442 | 77 touch done.$patch_file |
pascal@521 | 78 done <<EOT |
pankso@12285 | 79 $PACKAGE-diff.u |
pankso@12285 | 80 $PACKAGE-header.u |
pankso@12285 | 81 $PACKAGE-freeinitrd.u |
pankso@12285 | 82 aufs3-base.patch |
pankso@12285 | 83 aufs3-standalone.patch |
pankso@12285 | 84 aufs3-loopback.patch |
pankso@12285 | 85 aufs3-proc_map.patch |
pankso@12285 | 86 channel-negative-one-maxim.patch |
pankso@12285 | 87 mac80211.compat08082009.wl_frag+ack_v1.patch |
pascal@521 | 88 EOT |
pankso@9731 | 89 |
pankso@12285 | 90 if [ "$KBASEVER" != "$VERSION" ]; then |
pankso@12285 | 91 if [ -f $SOURCES_REPOSITORY/$(basename $PATCH) ]; then |
pankso@12285 | 92 xzcat $SOURCES_REPOSITORY/$(basename $PATCH) | patch -Np1 |
pankso@12285 | 93 touch done.patch-$VERSION |
pankso@12285 | 94 else |
pankso@12285 | 95 wget $PATCH -O $SRC/$(basename $PATCH) |
pankso@12285 | 96 xzcat $SRC/$(basename $PATCH) | patch -Np1 |
pankso@12285 | 97 touch done.patch-$VERSION |
pankso@12285 | 98 fi |
pankso@12285 | 99 fi |
pankso@12285 | 100 |
pankso@12285 | 101 sed -i 's|SUBLEVEL =.*|SUBLEVEL =|g' Makefile |
pankso@12285 | 102 |
gokhlayeh@11395 | 103 [ ! -x /usr/bin/cook ] && report step "Make kernel proper and then build lguest" |
pankso@12294 | 104 [ -x /usr/bin/cook ] && echo "Make kernel proper and then build lguest" |
pankso@3864 | 105 make mrproper |
pankso@12285 | 106 cd Documentation/virtual/lguest |
pankso@12285 | 107 if [ -x /usr/bin/cook ]; then |
pankso@12285 | 108 make lguest || return 1 |
pankso@12285 | 109 elif [ -x /usr/bin/tazwok ]; then |
pankso@12285 | 110 make lguest || { report close-bloc; return 1; } |
pankso@12285 | 111 fi |
slaxemulator@8681 | 112 cd $src |
pankso@9731 | 113 |
pascal@12570 | 114 case "$opt" in |
pascal@12570 | 115 *--no64*);; |
pascal@12570 | 116 *) |
pankso@12294 | 117 # |
pankso@12294 | 118 # Arch x86_64 |
pankso@12294 | 119 # |
pankso@12294 | 120 [ ! -x /usr/bin/cook ] && report step "Make bzImage64 without modules first" |
pankso@12294 | 121 [ -x /usr/bin/cook ] && echo "Building x86_64 Kernel" |
pankso@9731 | 122 |
pankso@12285 | 123 # Build bzImage64 without modules first |
pascal@12293 | 124 cp -f $stuff/$PACKAGE-slitaz.config64 .config |
pankso@12285 | 125 sed -i 's/CONFIG_MODULES=y/# CONFIG_MODULES is not set/' .config |
pankso@12285 | 126 |
pankso@12285 | 127 # We can't keep every driver in staging |
pankso@12285 | 128 sed -i -e 's/^CONFIG_RTL8192/#&/' \ |
pankso@12285 | 129 -e 's/^CONFIG_R8187SE/#&/' \ |
pankso@12285 | 130 -e 's/^CONFIG_RT2870/#&/' .config |
pankso@12285 | 131 yes '' | make ARCH=x86_64 oldconfig |
pankso@12285 | 132 if [ -x /usr/bin/cook ]; then |
pankso@12285 | 133 make -j 4 ARCH=x86_64 CROSS_COMPILE=uclibc-x86_64- bzImage || exit 1 |
pankso@12285 | 134 elif [ -x /usr/bin/tazwok ]; then |
pankso@12285 | 135 make -j 4 ARCH=x86_64 CROSS_COMPILE=uclibc-x86_64- bzImage || { report close-bloc; return 1; } |
pankso@12285 | 136 fi |
pankso@12285 | 137 [ -d $PWD/_pkg ] || mkdir -p $DESTDIR/linux64 |
pankso@12285 | 138 mv arch/x86/boot/bzImage $DESTDIR/linux64 |
pankso@12285 | 139 mv System.map System.map-without-modules64 |
pankso@12285 | 140 |
pankso@12285 | 141 [ ! -x /usr/bin/cook ] && report step "Now build bzImage64 with modules" |
pankso@12285 | 142 |
pankso@12285 | 143 # Build bzImage64 with modules |
pascal@12293 | 144 cp -f $stuff/$PACKAGE-slitaz.config64 .config |
pankso@12285 | 145 #make ARCH=x86_64 oldconfig |
pankso@12285 | 146 ln .config $WOK/$PACKAGE/slitaz/config64 |
pankso@12285 | 147 make -j 4 ARCH=x86_64 CROSS_COMPILE=uclibc-x86_64- bzImage && |
pankso@12285 | 148 make -j 4 ARCH=x86_64 CROSS_COMPILE=uclibc-x86_64- modules && |
pankso@12285 | 149 make ARCH=x86_64 INSTALL_MOD_PATH=$DESTDIR/linux64 modules_install && |
pankso@12285 | 150 make ARCH=x86_64 INSTALL_HDR_PATH=$DESTDIR/linux64/usr headers_install && |
pankso@12285 | 151 if [ -x /usr/bin/cook ]; then |
pankso@12285 | 152 [ -s arch/x86/boot/bzImage ] || return 1 |
pankso@12285 | 153 elif [ -x /usr/bin/tazwok ]; then |
pankso@12285 | 154 [ -s arch/x86/boot/bzImage ] || { report close-bloc; return 1; } |
pankso@12285 | 155 fi |
pankso@12285 | 156 mkdir -p $DESTDIR/linux64/boot 2> /dev/null |
pankso@12285 | 157 mv arch/x86/boot/bzImage $DESTDIR/linux64/boot/vmlinuz-$VERSION-slitaz |
pankso@12285 | 158 ln System.map System.map-modules64 |
pankso@12285 | 159 ln Module.symvers Module.symvers-modules64 |
pascal@12570 | 160 esac |
pankso@9731 | 161 |
pankso@12294 | 162 # |
pankso@12294 | 163 # Standard kernel |
pankso@12294 | 164 # |
pankso@12294 | 165 [ ! -x /usr/bin/cook ] && report step "Make bzImage without modules first" |
pankso@12294 | 166 [ -x /usr/bin/cook ] && echo "Building standard kernel..." |
pankso@12294 | 167 |
pankso@12294 | 168 # Build bzImage without modules first |
pankso@12294 | 169 cp -f $stuff/$PACKAGE-slitaz.config .config |
pankso@12294 | 170 sed -i 's/CONFIG_MODULES=y/# CONFIG_MODULES is not set/' .config |
pankso@12294 | 171 |
pankso@12294 | 172 # We can't keep every driver in staging |
pankso@12294 | 173 sed -i -e 's/^CONFIG_RTL8192/#&/' \ |
pankso@12294 | 174 -e 's/^CONFIG_R8187SE/#&/' \ |
pankso@12294 | 175 -e 's/^CONFIG_RT2870/#&/' .config |
pankso@12294 | 176 yes '' | make oldconfig |
pankso@12294 | 177 if [ -x /usr/bin/cook ]; then |
pankso@12294 | 178 make -j 4 bzImage || exit 1 |
pankso@12294 | 179 elif [ -x /usr/bin/tazwok ]; then |
pankso@12294 | 180 make -j 4 bzImage || { report close-bloc; return 1; } |
pankso@12294 | 181 fi |
pankso@12294 | 182 [ -d $DESTDIR ] || mkdir -p $DESTDIR |
pankso@12294 | 183 mv arch/x86/boot/bzImage $DESTDIR |
pankso@12294 | 184 mv System.map System.map-without-modules |
pankso@12294 | 185 |
pankso@12294 | 186 [ ! -x /usr/bin/cook ] && report step "Now build bzImage with modules" |
pankso@12294 | 187 |
pankso@12294 | 188 # Build bzImage with modules |
pankso@12294 | 189 cp -f $stuff/$PACKAGE-slitaz.config .config |
pankso@12294 | 190 #make oldconfig |
pankso@12294 | 191 ln .config $WOK/$PACKAGE/source/slitaz/config |
pankso@12294 | 192 make -j 4 bzImage && |
pankso@12294 | 193 make -j 4 modules && |
pankso@12294 | 194 make INSTALL_MOD_PATH=$DESTDIR modules_install && |
pankso@12294 | 195 make INSTALL_HDR_PATH=$DESTDIR/usr headers_install && |
pankso@12294 | 196 if [ -x /usr/bin/cook ]; then |
pankso@12294 | 197 [ -s arch/x86/boot/bzImage ] || return 1 |
pankso@12294 | 198 elif [ -x /usr/bin/tazwok ]; then |
pankso@12294 | 199 [ -s arch/x86/boot/bzImage ] || { report close-bloc; return 1; } |
pankso@12294 | 200 fi |
pankso@12294 | 201 mkdir -p $DESTDIR/boot 2> /dev/null |
pankso@12294 | 202 mv arch/x86/boot/bzImage $DESTDIR/boot/vmlinuz-$VERSION-slitaz |
pankso@12294 | 203 |
gokhlayeh@11395 | 204 [ ! -x /usr/bin/cook ] && report step "Compressing all modules" |
pankso@9731 | 205 |
slaxemulator@6719 | 206 # Compress all modules. |
pankso@12285 | 207 $stuff/gztazmod.sh $DESTDIR/lib/modules/$KBASEVER-slitaz |
pankso@12285 | 208 $stuff/gztazmod.sh $DESTDIR/linux64/lib/modules/$KBASEVER-slitaz |
pascal@7667 | 209 ln System.map System.map-modules |
pascal@7667 | 210 ln Module.symvers Module.symvers-modules |
pankso@9731 | 211 |
gokhlayeh@11395 | 212 if [ ! -x /usr/bin/cook ]; then |
gokhlayeh@11395 | 213 report close-bloc |
gokhlayeh@11395 | 214 fi |
pankso@3864 | 215 } |
erjo@253 | 216 |
pankso@3 | 217 # Rules to gen a SliTaz package suitable for Tazpkg. |
pankso@3 | 218 genpkg_rules() |
pankso@3 | 219 { |
pascal@12300 | 220 export PACKAGE VERSION |
pascal@521 | 221 local path |
pascal@7656 | 222 cp -a $_pkg/boot $fs |
pankso@3 | 223 # Compress all modules. |
pascal@12558 | 224 $stuff/gztazmod.sh $_pkg/lib/modules/$KBASEVER-slitaz |
pankso@12285 | 225 path=$fs/lib/modules/$KBASEVER-slitaz/kernel |
pascal@521 | 226 mkdir -p $path |
pankso@12285 | 227 cp -a $_pkg/lib/modules/$KBASEVER-slitaz/mo* \ |
pankso@12285 | 228 $fs/lib/modules/$KBASEVER-slitaz |
pankso@5640 | 229 # Get the base modules |
pascal@886 | 230 export src |
pascal@886 | 231 export _pkg |
pankso@12285 | 232 mkdir -p $WOK/$PACKAGE/source/tmp |
slaxemulator@9701 | 233 $stuff/list_modules.sh \ |
pankso@12285 | 234 $(cat $stuff/modules.list) > $WOK/$PACKAGE/source/tmp/modules.list |
pankso@3864 | 235 while read module; do |
pascal@521 | 236 dir=$(dirname $module) |
pankso@535 | 237 [ -d $path/$dir ] || mkdir -p $path/$dir |
pankso@12285 | 238 cp -a $_pkg/lib/modules/$KBASEVER-slitaz/kernel/$module $path/$dir |
pankso@12285 | 239 done < $WOK/$PACKAGE/source/tmp/modules.list |
pascal@397 | 240 # Remove unresolved links |
pankso@12285 | 241 rm -f $fs/lib/modules/$KBASEVER-slitaz/build |
pankso@12285 | 242 rm -f $fs/lib/modules/$KBASEVER-slitaz/source |
pankso@12285 | 243 # Cook all packages with a kernel module |
pankso@12285 | 244 for i in $(cd $WOK; grep -l 'tazwok cook linux$' */receipt) |
pankso@12285 | 245 do |
pankso@12285 | 246 echo tazwok cook ${i%/receipt} |
pankso@12285 | 247 done |
pankso@12285 | 248 # Fixed modules.dep to use right path |
pankso@12285 | 249 # saves 100kb of space too |
pankso@12285 | 250 sed -i "s|$_pkg||g" $fs/lib/modules/$KBASEVER-slitaz/modules.dep |
pankso@12285 | 251 sed -i "s|99.98.$KBASEVER-slitaz|$KBASEVER-slitaz|g" $fs/lib/modules/$KBASEVER-slitaz/modules.dep |
pankso@5640 | 252 # Check and echo any module in kernel .config that's not added to |
pankso@5640 | 253 # one of linux-* pkgs |
pascal@12300 | 254 $stuff/check_modules.sh |
pankso@3 | 255 } |
pankso@3 | 256 |
pankso@3 | 257 # Pre and post install commands for Tazpkg. |
pankso@3 | 258 post_install() |
pankso@3 | 259 { |
pascal@521 | 260 echo "Processing post-install commands..." |
pankso@12285 | 261 chroot "$1/" depmod -a $KBASEVER-slitaz |
pankso@5640 | 262 # GRUB stuff. |
pankso@1154 | 263 if [ -f "$1/boot/grub/menu.lst" ]; then |
pankso@4056 | 264 root_dev=`cat $1/boot/grub/menu.lst | grep root= | sed 's/.*root=\([^ ]*\).*/\1/' | head -n 1` |
pankso@4056 | 265 grub_dev=`cat $1/boot/grub/menu.lst | grep "root (" | head -n 1` |
pankso@3864 | 266 # Add new kernel entry in case of upgrade for installed system. |
pankso@12291 | 267 if ! grep -q vmlinuz-$VERSION-slitaz $1/boot/grub/menu.lst; then |
pankso@4056 | 268 cat >> $1/boot/grub/menu.lst << EOT |
pankso@4056 | 269 |
pankso@4056 | 270 title SliTaz GNU/Linux (Kernel $VERSION-slitaz) |
pankso@4056 | 271 $grub_dev |
pankso@4056 | 272 kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev |
pankso@4056 | 273 EOT |
pankso@4056 | 274 fi |
pankso@4056 | 275 # Display information message. |
pankso@4056 | 276 cat <<EOT |
pankso@4056 | 277 ---- |
pankso@4056 | 278 GRUB is installed, these tree lines must be in your /boot/grub/menu.lst: |
pankso@1154 | 279 |
pankso@1154 | 280 title SliTaz GNU/Linux (Kernel $VERSION-slitaz) |
pankso@1154 | 281 $grub_dev |
pankso@4056 | 282 kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev |
pascal@886 | 283 ---- |
pascal@886 | 284 EOT |
pankso@1154 | 285 fi |
pankso@3 | 286 } |