wok annotate linux-libre/receipt @ rev 11396

Update linux-libre according to changes made to linux (since months)
author Antoine Bodin <gokhlayeh@slitaz.org>
date Sat Dec 10 06:11:04 2011 +0100 (2011-12-10)
parents cc1782ebaa81
children 6f385eb6c82d
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
gokhlayeh@11396 27
gokhlayeh@11396 28 [ ! -x /usr/bin/cook ] && report open-bloc
gokhlayeh@9257 29
slaxemulator@10638 30 # Check for Aufs and cook it if unbuilt.
slaxemulator@10638 31 echo "Checking for Aufs packages..."
gokhlayeh@9257 32 _AUFSVER=`grep ^VERSION= $WOK/aufs/receipt | cut -d "=" -f2 | sed -e 's/"//g'`
gokhlayeh@11396 33 if [ ! -d "$AUFSDIR" ] && [ -x /usr/bin/cook ]; then
slaxemulator@10638 34 # Give info an redirect to /dev/null since aufs got it own log.
slaxemulator@10638 35 AUFSDIR=$WOK/aufs/source/aufs-${_AUFSVER}
slaxemulator@10638 36 echo "Cook: aufs $_AUFSVER"
slaxemulator@10638 37 cook aufs > /dev/null
gokhlayeh@11396 38 elif [ ! -x /usr/bin/cook ]; then
gokhlayeh@11396 39 # We only need aufs source. Also cooking now is a bad idea since it
gokhlayeh@11396 40 # needs linux-module-headers.
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
gokhlayeh@11396 49
gokhlayeh@9257 50 # SliTaz db
gokhlayeh@11396 51 rm -rf $WOK/$PACKAGE/slitaz && mkdir $WOK/$PACKAGE/slitaz
slaxemulator@9337 52 echo "$WGET_URL" > $WOK/$PACKAGE/slitaz/url
gokhlayeh@9257 53 cp $stuff/gztazmod.sh $stuff/list_modules.sh $WOK/$PACKAGE/slitaz
gokhlayeh@9257 54 cp $stuff/bootloader.sh $WOK/$PACKAGE/slitaz
slaxemulator@10638 55
gokhlayeh@9257 56 # Apply patches
gokhlayeh@11396 57 echo "Applying patches..."
gokhlayeh@9257 58 while read patch_file; do
gokhlayeh@9257 59 echo "$patch_file" >> $WOK/$PACKAGE/slitaz/patches
gokhlayeh@9257 60 cp $stuff/$patch_file $WOK/$PACKAGE/slitaz
gokhlayeh@9257 61 if [ -f done.$patch_file ]; then
gokhlayeh@9257 62 echo "Skipping $patch_file"
gokhlayeh@9257 63 continue
gokhlayeh@9257 64 fi
gokhlayeh@9257 65 echo "Apply $patch_file"
gokhlayeh@11396 66 patch -p1 < $WOK/$PACKAGE/slitaz/$patch_file || { report close-bloc; return 1; }
gokhlayeh@9257 67 touch done.$patch_file
gokhlayeh@9257 68 done <<EOT
gokhlayeh@9257 69 $PACKAGE-diff-$VERSION.u
gokhlayeh@9257 70 $PACKAGE-unlzma-$VERSION.u
gokhlayeh@9257 71 $PACKAGE-header-$VERSION.u
gokhlayeh@9257 72 $PACKAGE-freeinitrd-$VERSION.u
gokhlayeh@9257 73 aufs2-base.patch
gokhlayeh@9257 74 aufs2-standalone.patch
gokhlayeh@9257 75 001-squashfs-decompressors-add-xz-decompressor-module.patch
gokhlayeh@9257 76 002-squashfs-decompressors-add-boot-time-xz-support.patch
gokhlayeh@9257 77 003-squashfs-x86-support-xz-compressed-kernel.patch
gokhlayeh@9257 78 004-squashfs-add-xz-compression-support.patch
gokhlayeh@9257 79 005-squashfs-add-xz-compression-configuration-option.patch
gokhlayeh@9257 80 EOT
gokhlayeh@11396 81
gokhlayeh@11396 82 [ ! -x /usr/bin/cook ] && report step "Make kernel proper and then build lguest"
slaxemulator@10638 83
gokhlayeh@9257 84 make mrproper
gokhlayeh@9257 85 cd Documentation/lguest
gokhlayeh@11396 86 make $MAKEFLAGS lguest || { report close-bloc; return 1; }
gokhlayeh@9257 87 cd $src
gokhlayeh@9257 88
gokhlayeh@11396 89 [ ! -x /usr/bin/cook ] && report step "Make bzImage without modules first"
gokhlayeh@11396 90
gokhlayeh@9257 91 # Build bzImage without modules first
gokhlayeh@9257 92 cp -f $stuff/$PACKAGE-$VERSION-slitaz.config .config
gokhlayeh@9257 93 sed -i 's/CONFIG_MODULES=y/# CONFIG_MODULES is not set/' .config
slaxemulator@10638 94
gokhlayeh@9257 95 # We can't keep every driver in staging
gokhlayeh@9257 96 sed -i -e 's/^CONFIG_RTL8192/#&/' \
gokhlayeh@9257 97 -e 's/^CONFIG_R8187SE/#&/' \
gokhlayeh@9257 98 -e 's/^CONFIG_RT2870/#&/' .config
gokhlayeh@9257 99 yes '' | make oldconfig
gokhlayeh@11396 100 make $MAKEFLAGS bzImage || { report close-bloc; return 1; }
gokhlayeh@11396 101 [ -d $PWD/_pkg ] || mkdir -p $PWD/_pkg
gokhlayeh@11396 102 mv arch/x86/boot/bzImage $PWD/_pkg
gokhlayeh@9257 103 mv System.map System.map-without-modules
gokhlayeh@9257 104
gokhlayeh@11396 105 [ -x /usr/bin/cook ] && report step "Now build bzImage with modules"
slaxemulator@10638 106
gokhlayeh@9257 107 # Build bzImage with modules
gokhlayeh@9257 108 cp -f $stuff/$PACKAGE-$VERSION-slitaz.config .config
gokhlayeh@9257 109 make oldconfig
gokhlayeh@9257 110 ln .config $WOK/$PACKAGE/slitaz/config
gokhlayeh@11396 111 make $MAKEFLAGS bzImage &&
gokhlayeh@11396 112 make $MAKEFLAGS modules &&
gokhlayeh@11396 113 make INSTALL_MOD_PATH=$PWD/_pkg modules_install &&
gokhlayeh@11396 114 make INSTALL_HDR_PATH=$PWD/_pkg/usr headers_install &&
gokhlayeh@11396 115 [ -s arch/x86/boot/bzImage ] || { report close-bloc; return 1; }
gokhlayeh@11396 116 mkdir -p $PWD/_pkg/boot 2> /dev/null
gokhlayeh@11396 117 mv arch/x86/boot/bzImage $PWD/_pkg/boot/vmlinuz-$VERSION-slitaz
gokhlayeh@11396 118
gokhlayeh@11396 119 [ ! -x /usr/bin/cook ] && report step "Compressing all modules"
gokhlayeh@11396 120
gokhlayeh@9257 121 # Compress all modules.
gokhlayeh@11396 122 $stuff/gztazmod.sh $PWD/_pkg/lib/modules/$VERSION-slitaz
gokhlayeh@9257 123 ln System.map System.map-modules
gokhlayeh@9257 124 ln Module.symvers Module.symvers-modules
gokhlayeh@11396 125
gokhlayeh@11396 126 if [ ! -x /usr/bin/cook ]; then
gokhlayeh@11396 127 report close-bloc
gokhlayeh@11396 128 fi
gokhlayeh@9257 129 }
gokhlayeh@9257 130
gokhlayeh@9257 131 # Rules to gen a SliTaz package suitable for Tazpkg.
gokhlayeh@9257 132 genpkg_rules()
gokhlayeh@9257 133 {
gokhlayeh@9257 134 local path
gokhlayeh@9257 135 cp -a $_pkg/boot $fs
gokhlayeh@9257 136 # Compress all modules.
gokhlayeh@11396 137 #$stuff/gztazmod.sh $_pkg/lib/modules/$VERSION-slitaz
gokhlayeh@9257 138 path=$fs/lib/modules/$VERSION-slitaz/kernel
gokhlayeh@9257 139 mkdir -p $path
gokhlayeh@9257 140 cp -a $_pkg/lib/modules/$VERSION-slitaz/mo* \
gokhlayeh@9257 141 $fs/lib/modules/$VERSION-slitaz
gokhlayeh@9257 142 # Get the base modules
gokhlayeh@9257 143 export src
gokhlayeh@9257 144 export _pkg
gokhlayeh@9257 145 mkdir $WOK/$PACKAGE/tmp
slaxemulator@10638 146 $stuff/list_modules.sh \
gokhlayeh@11396 147 $(cat stuff/modules-$VERSION.list) > $WOK/$PACKAGE/tmp/modules.list
gokhlayeh@9257 148 while read module; do
gokhlayeh@9257 149 dir=$(dirname $module)
gokhlayeh@9257 150 [ -d $path/$dir ] || mkdir -p $path/$dir
gokhlayeh@9257 151 cp -a $_pkg/lib/modules/$VERSION-slitaz/kernel/$module $path/$dir
gokhlayeh@9257 152 done < $WOK/$PACKAGE/tmp/modules.list
gokhlayeh@9257 153 # Remove unresolved links
gokhlayeh@9257 154 rm -f $fs/lib/modules/$VERSION-slitaz/build
gokhlayeh@9257 155 rm -f $fs/lib/modules/$VERSION-slitaz/source
gokhlayeh@9257 156 # Check and echo any module in kernel .config that's not added to
gokhlayeh@9257 157 # one of linux-* pkgs
pankso@10630 158 $stuff/check_modules.sh
gokhlayeh@9257 159 }
gokhlayeh@9257 160
gokhlayeh@9257 161 # Pre and post install commands for Tazpkg.
gokhlayeh@9257 162 post_install()
gokhlayeh@9257 163 {
gokhlayeh@9257 164 echo "Processing post-install commands..."
gokhlayeh@9257 165 chroot "$1/" depmod -a $VERSION-slitaz
gokhlayeh@9257 166 # GRUB stuff.
gokhlayeh@9257 167 if [ -f "$1/boot/grub/menu.lst" ]; then
gokhlayeh@9257 168 root_dev=`cat $1/boot/grub/menu.lst | grep root= | sed 's/.*root=\([^ ]*\).*/\1/' | head -n 1`
gokhlayeh@9257 169 grub_dev=`cat $1/boot/grub/menu.lst | grep "root (" | head -n 1`
gokhlayeh@9257 170 # Add new kernel entry in case of upgrade for installed system.
gokhlayeh@9257 171 if ! grep -q $PACKAGE-$VERSION-slitaz $1/boot/grub/menu.lst; then
gokhlayeh@9257 172 cat >> $1/boot/grub/menu.lst << EOT
gokhlayeh@9257 173
gokhlayeh@9257 174 title SliTaz GNU/Linux (Kernel $VERSION-slitaz)
gokhlayeh@9257 175 $grub_dev
gokhlayeh@9257 176 kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev
gokhlayeh@9257 177 EOT
gokhlayeh@9257 178 fi
gokhlayeh@9257 179 # Display information message.
gokhlayeh@9257 180 cat <<EOT
gokhlayeh@9257 181 ----
gokhlayeh@9257 182 GRUB is installed, these tree lines must be in your /boot/grub/menu.lst:
gokhlayeh@9257 183
gokhlayeh@9257 184 title SliTaz GNU/Linux (Kernel $VERSION-slitaz)
gokhlayeh@9257 185 $grub_dev
gokhlayeh@9257 186 kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev
gokhlayeh@9257 187 ----
gokhlayeh@9257 188 EOT
gokhlayeh@9257 189 fi
gokhlayeh@9257 190 }