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