wok annotate linux/receipt @ rev 9737

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