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