wok annotate linux-libre/receipt @ rev 10637
linux-libre: remove all report (last try to build failed)
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Fri May 27 00:23:00 2011 +0200 (2011-05-27) |
parents | f30610a3393f |
children | cc1782ebaa81 |
rev | line source |
---|---|
gokhlayeh@9257 | 1 # SliTaz package receipt. |
gokhlayeh@9257 | 2 |
gokhlayeh@9257 | 3 PACKAGE="linux-libre" |
gokhlayeh@9257 | 4 VERSION="2.6.37-libre" |
gokhlayeh@9257 | 5 CATEGORY="base-system" |
gokhlayeh@9257 | 6 SHORT_DESC="The Linux Libre kernel and modules." |
gokhlayeh@9257 | 7 DEPENDS="depmod" |
gokhlayeh@9257 | 8 BUILD_DEPENDS="slitaz-toolchain perl git lzma patch" |
gokhlayeh@9257 | 9 MAINTAINER="gokhlayeh@slitaz.org" |
gokhlayeh@9257 | 10 PROVIDE="linux" |
gokhlayeh@9259 | 11 SOURCE="linux" |
gokhlayeh@9259 | 12 TARBALL="$SOURCE-$VERSION.tar.bz2" |
gokhlayeh@9257 | 13 WEB_SITE="http://www.fsfla.org/svnwiki/selibre/linux-libre/" |
gokhlayeh@9257 | 14 WGET_URL="http://www.fsfla.org/svnwiki/selibre/linux-libre/download/releases/$VERSION/$TARBALL" |
gokhlayeh@9257 | 15 CONFIG_FILES="/lib/modules/$VERSION-slitaz/modules.dep" |
gokhlayeh@9257 | 16 |
gokhlayeh@9257 | 17 # Rules to configure and make the package. |
gokhlayeh@9257 | 18 compile_rules() |
gokhlayeh@9257 | 19 { |
gokhlayeh@9257 | 20 |
gokhlayeh@9257 | 21 # this is code to help update the kernel version faster |
gokhlayeh@9257 | 22 #for i in $(grep -l 'WANTED="linux"' $WOK/*/receipt) |
gokhlayeh@9257 | 23 #do |
gokhlayeh@9257 | 24 # sed -i 's|VERSION="OLDVERSION"|VERSION="NEWVERSION"|g' $i |
gokhlayeh@9257 | 25 #done |
gokhlayeh@9257 | 26 |
gokhlayeh@9257 | 27 _AUFSVER=`grep ^VERSION= $WOK/aufs/receipt | cut -d "=" -f2 | sed -e 's/"//g'` |
gokhlayeh@9257 | 28 AUFSDIR=$WOK/$PACKAGE/aufs-${_AUFSVER} |
pankso@10630 | 29 if [ -x /usr/bin/tazwok ]; then |
pankso@10630 | 30 tazwok get-src aufs --target=$AUFSDIR || { report close-bloc; return 1; } |
pankso@10630 | 31 fi |
gokhlayeh@9257 | 32 cp -a $AUFSDIR/Documentation $AUFSDIR/fs $AUFSDIR/include $src |
slaxemulator@9700 | 33 cp -a $AUFSDIR/*.patch $WOK/$PACKA$stuff |
gokhlayeh@9257 | 34 cd $src |
gokhlayeh@9257 | 35 # SliTaz db |
gokhlayeh@9257 | 36 [ -d $WOK/$PACKAGE/slitaz ] && rm -rf $WOK/$PACKAGE/slitaz 2> /dev/null |
gokhlayeh@9257 | 37 mkdir $WOK/$PACKAGE/slitaz |
slaxemulator@9337 | 38 echo "$WGET_URL" > $WOK/$PACKAGE/slitaz/url |
gokhlayeh@9257 | 39 cp $stuff/gztazmod.sh $stuff/list_modules.sh $WOK/$PACKAGE/slitaz |
gokhlayeh@9257 | 40 cp $stuff/bootloader.sh $WOK/$PACKAGE/slitaz |
gokhlayeh@9257 | 41 # Apply patches |
pankso@10630 | 42 echo "Applying patches" |
gokhlayeh@9257 | 43 while read patch_file; do |
gokhlayeh@9257 | 44 echo "$patch_file" >> $WOK/$PACKAGE/slitaz/patches |
gokhlayeh@9257 | 45 cp $stuff/$patch_file $WOK/$PACKAGE/slitaz |
gokhlayeh@9257 | 46 if [ -f done.$patch_file ]; then |
gokhlayeh@9257 | 47 echo "Skipping $patch_file" |
gokhlayeh@9257 | 48 continue |
gokhlayeh@9257 | 49 fi |
gokhlayeh@9257 | 50 echo "Apply $patch_file" |
pankso@10637 | 51 patch -p1 < $WOK/$PACKAGE/slitaz/$patch_file || exit 1 |
gokhlayeh@9257 | 52 touch done.$patch_file |
gokhlayeh@9257 | 53 done <<EOT |
gokhlayeh@9257 | 54 $PACKAGE-diff-$VERSION.u |
gokhlayeh@9257 | 55 $PACKAGE-unlzma-$VERSION.u |
gokhlayeh@9257 | 56 $PACKAGE-header-$VERSION.u |
gokhlayeh@9257 | 57 $PACKAGE-freeinitrd-$VERSION.u |
gokhlayeh@9257 | 58 aufs2-base.patch |
gokhlayeh@9257 | 59 aufs2-standalone.patch |
gokhlayeh@9257 | 60 001-squashfs-decompressors-add-xz-decompressor-module.patch |
gokhlayeh@9257 | 61 002-squashfs-decompressors-add-boot-time-xz-support.patch |
gokhlayeh@9257 | 62 003-squashfs-x86-support-xz-compressed-kernel.patch |
gokhlayeh@9257 | 63 004-squashfs-add-xz-compression-support.patch |
gokhlayeh@9257 | 64 005-squashfs-add-xz-compression-configuration-option.patch |
gokhlayeh@9257 | 65 EOT |
pankso@10630 | 66 echo "Make kernel proper and then build lguest" |
gokhlayeh@9257 | 67 make mrproper |
gokhlayeh@9257 | 68 cd Documentation/lguest |
pankso@10637 | 69 make lguest || exit 1 |
gokhlayeh@9257 | 70 cd $src |
gokhlayeh@9257 | 71 |
pankso@10630 | 72 echo "Make bzImage without modules first" |
gokhlayeh@9257 | 73 # Build bzImage without modules first |
gokhlayeh@9257 | 74 cp -f $stuff/$PACKAGE-$VERSION-slitaz.config .config |
gokhlayeh@9257 | 75 sed -i 's/CONFIG_MODULES=y/# CONFIG_MODULES is not set/' .config |
gokhlayeh@9257 | 76 # We can't keep every driver in staging |
gokhlayeh@9257 | 77 sed -i -e 's/^CONFIG_RTL8192/#&/' \ |
gokhlayeh@9257 | 78 -e 's/^CONFIG_R8187SE/#&/' \ |
gokhlayeh@9257 | 79 -e 's/^CONFIG_RT2870/#&/' .config |
gokhlayeh@9257 | 80 yes '' | make oldconfig |
pankso@10637 | 81 make -j 4 bzImage ||exit 1 |
gokhlayeh@9257 | 82 [ -d $PWD/_pkg ] || mkdir -p $PWD/_pkg |
gokhlayeh@9257 | 83 mv arch/x86/boot/bzImage $PWD/_pkg |
gokhlayeh@9257 | 84 mv System.map System.map-without-modules |
gokhlayeh@9257 | 85 |
pankso@10630 | 86 echo "Now build bzImage with modules" |
gokhlayeh@9257 | 87 # Build bzImage with modules |
gokhlayeh@9257 | 88 cp -f $stuff/$PACKAGE-$VERSION-slitaz.config .config |
gokhlayeh@9257 | 89 make oldconfig |
gokhlayeh@9257 | 90 ln .config $WOK/$PACKAGE/slitaz/config |
gokhlayeh@9257 | 91 make -j 4 bzImage && |
gokhlayeh@9257 | 92 make -j 4 modules && |
gokhlayeh@9257 | 93 make INSTALL_MOD_PATH=$PWD/_pkg modules_install && |
gokhlayeh@9257 | 94 make INSTALL_HDR_PATH=$PWD/_pkg/usr headers_install && |
pankso@10637 | 95 |
gokhlayeh@9257 | 96 mkdir -p $PWD/_pkg/boot 2> /dev/null |
gokhlayeh@9257 | 97 mv arch/x86/boot/bzImage $PWD/_pkg/boot/vmlinuz-$VERSION-slitaz |
gokhlayeh@9257 | 98 # Compress all modules. |
pankso@10630 | 99 echo "Compressing all modules" |
gokhlayeh@9257 | 100 $stuff/gztazmod.sh $PWD/_pkg/lib/modules/$VERSION-slitaz |
gokhlayeh@9257 | 101 ln System.map System.map-modules |
gokhlayeh@9257 | 102 ln Module.symvers Module.symvers-modules |
gokhlayeh@9257 | 103 } |
gokhlayeh@9257 | 104 |
gokhlayeh@9257 | 105 # Rules to gen a SliTaz package suitable for Tazpkg. |
gokhlayeh@9257 | 106 genpkg_rules() |
gokhlayeh@9257 | 107 { |
gokhlayeh@9257 | 108 local path |
gokhlayeh@9257 | 109 cp -a $_pkg/boot $fs |
gokhlayeh@9257 | 110 # Compress all modules. |
slaxemulator@9700 | 111 $stuff/gztazmod.sh $_pkg/lib/modules/$VERSION-slitaz |
gokhlayeh@9257 | 112 path=$fs/lib/modules/$VERSION-slitaz/kernel |
gokhlayeh@9257 | 113 mkdir -p $path |
gokhlayeh@9257 | 114 cp -a $_pkg/lib/modules/$VERSION-slitaz/mo* \ |
gokhlayeh@9257 | 115 $fs/lib/modules/$VERSION-slitaz |
gokhlayeh@9257 | 116 # Get the base modules |
gokhlayeh@9257 | 117 export src |
gokhlayeh@9257 | 118 export _pkg |
gokhlayeh@9257 | 119 mkdir $WOK/$PACKAGE/tmp |
slaxemulator@9700 | 120 $WOK/$PACKA$stuff/list_modules.sh \ |
gokhlayeh@9257 | 121 $(cat stuff/modules-$VERSION.list) > $WOK/$PACKAGE/tmp/modules.list |
gokhlayeh@9257 | 122 while read module; do |
gokhlayeh@9257 | 123 dir=$(dirname $module) |
gokhlayeh@9257 | 124 [ -d $path/$dir ] || mkdir -p $path/$dir |
gokhlayeh@9257 | 125 cp -a $_pkg/lib/modules/$VERSION-slitaz/kernel/$module $path/$dir |
gokhlayeh@9257 | 126 done < $WOK/$PACKAGE/tmp/modules.list |
gokhlayeh@9257 | 127 # Remove unresolved links |
gokhlayeh@9257 | 128 rm -f $fs/lib/modules/$VERSION-slitaz/build |
gokhlayeh@9257 | 129 rm -f $fs/lib/modules/$VERSION-slitaz/source |
pankso@10630 | 130 |
gokhlayeh@9257 | 131 # Check and echo any module in kernel .config that's not added to |
gokhlayeh@9257 | 132 # one of linux-* pkgs |
pankso@10630 | 133 $stuff/check_modules.sh |
gokhlayeh@9257 | 134 } |
gokhlayeh@9257 | 135 |
gokhlayeh@9257 | 136 # Pre and post install commands for Tazpkg. |
gokhlayeh@9257 | 137 post_install() |
gokhlayeh@9257 | 138 { |
gokhlayeh@9257 | 139 echo "Processing post-install commands..." |
gokhlayeh@9257 | 140 chroot "$1/" depmod -a $VERSION-slitaz |
gokhlayeh@9257 | 141 # GRUB stuff. |
gokhlayeh@9257 | 142 if [ -f "$1/boot/grub/menu.lst" ]; then |
gokhlayeh@9257 | 143 root_dev=`cat $1/boot/grub/menu.lst | grep root= | sed 's/.*root=\([^ ]*\).*/\1/' | head -n 1` |
gokhlayeh@9257 | 144 grub_dev=`cat $1/boot/grub/menu.lst | grep "root (" | head -n 1` |
gokhlayeh@9257 | 145 # Add new kernel entry in case of upgrade for installed system. |
gokhlayeh@9257 | 146 if ! grep -q $PACKAGE-$VERSION-slitaz $1/boot/grub/menu.lst; then |
gokhlayeh@9257 | 147 cat >> $1/boot/grub/menu.lst << EOT |
gokhlayeh@9257 | 148 |
gokhlayeh@9257 | 149 title SliTaz GNU/Linux (Kernel $VERSION-slitaz) |
gokhlayeh@9257 | 150 $grub_dev |
gokhlayeh@9257 | 151 kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev |
gokhlayeh@9257 | 152 EOT |
gokhlayeh@9257 | 153 fi |
gokhlayeh@9257 | 154 # Display information message. |
gokhlayeh@9257 | 155 cat <<EOT |
gokhlayeh@9257 | 156 ---- |
gokhlayeh@9257 | 157 GRUB is installed, these tree lines must be in your /boot/grub/menu.lst: |
gokhlayeh@9257 | 158 |
gokhlayeh@9257 | 159 title SliTaz GNU/Linux (Kernel $VERSION-slitaz) |
gokhlayeh@9257 | 160 $grub_dev |
gokhlayeh@9257 | 161 kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev |
gokhlayeh@9257 | 162 ---- |
gokhlayeh@9257 | 163 EOT |
gokhlayeh@9257 | 164 fi |
gokhlayeh@9257 | 165 } |