wok-undigest diff ovzkernel-i686/receipt @ rev 208

Add: ovzkernel-i686 patched kernel for OpenVZ
author Eric Joseph-Alexandre <erjo@slitaz.org>
date Sun Jan 02 23:15:54 2011 +0100 (2011-01-02)
parents
children 6969430bceea
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/ovzkernel-i686/receipt	Sun Jan 02 23:15:54 2011 +0100
     1.3 @@ -0,0 +1,132 @@
     1.4 +# SliTaz package receipt.
     1.5 +
     1.6 +PACKAGE="ovzkernel-i686"
     1.7 +VERSION="2.6.32"
     1.8 +CATEGORY="system"
     1.9 +SHORT_DESC="Vanilla Linux Kernel for OpenVZ"
    1.10 +MAINTAINER="erjo@slitaz.org"
    1.11 +DEPENDS="depmod"
    1.12 +BUILD_DEPENDS="slitaz-toolchain perl"
    1.13 +SOURCE="linux"
    1.14 +TARBALL="$SOURCE-$VERSION.tar.bz2"
    1.15 +WEB_SITE="http://www.kernel.org/"
    1.16 +WGET_URL="http://www.eu.kernel.org/pub/linux/kernel/v${VERSION:0:3}/$TARBALL"
    1.17 +PROVIDE="linux"
    1.18 +
    1.19 +# Rules to configure and make the package.
    1.20 +compile_rules()
    1.21 +{
    1.22 +	LOCALVERSION="-ovz" ; export LOCALVERSION
    1.23 +	
    1.24 +	cd $src
    1.25 +	
    1.26 +	[ -d OpenVZ ] && rm -rf openvz || mkdir OpenVZ	
    1.27 +	
    1.28 +	zcat ../stuff/patch-dzhanibekov.1-combined.gz > OpenVZ/patch-dzhanibekov.1-combined.u
    1.29 +	cp ../stuff/*.ovz OpenVZ
    1.30 +	
    1.31 +	# Apply patches
    1.32 +	while read patch_file; do
    1.33 +		echo "$patch_file" >> OpenVZ/patches
    1.34 +		#~ cp ../stuff/$patch_file OpenVZ
    1.35 +		if [ -f done.$patch_file ]; then
    1.36 +			echo "Skipping $patch_file"
    1.37 +			continue
    1.38 +		fi
    1.39 +		echo "Apply $patch_file"
    1.40 +		patch -p1 < OpenVZ/$patch_file || exit 1
    1.41 +		touch done.$patch_file
    1.42 +	done <<EOT
    1.43 +patch-dzhanibekov.1-combined.u
    1.44 +EOT
    1.45 +
    1.46 +	make mrproper 
    1.47 +	
    1.48 +	#cp OpenVZ/kernel-2.6.32-i686-ovz.config .config 
    1.49 +	cp OpenVZ/linux-2.6.32-i686.config.ovz .config 
    1.50 +	
    1.51 +	# Add LOCALVERSION support
    1.52 +	sed -i s/CONFIG_LOCALVERSION_AUTO.*/CONFIG_LOCALVERSION_AUTO=y/ .config 
    1.53 +	
    1.54 +	make  oldconfig && \
    1.55 +		make LOCALVERSION=${LOCALVERSION} prepare 
    1.56 +		
    1.57 +	make bzImage && \
    1.58 +	make modules
    1.59 +
    1.60 +	make INSTALL_MOD_PATH=$PWD/_pkg modules_install
    1.61 +	make  INSTALL_HDR_PATH=$PWD/_pkg/usr headers_install 
    1.62 +	
    1.63 +	KERNELRELEASE=$( cat include/config/kernel.release 2> /dev/null) ; export KERNELRELEASE
    1.64 +
    1.65 +	[ -s arch/x86/boot/bzImage ] || return 1
    1.66 +	mkdir -p $PWD/_pkg/boot 2> /dev/null
    1.67 +	cp -a  arch/x86/boot/bzImage $PWD/_pkg/boot/vmlinuz-${KERNELRELEASE}
    1.68 +	
    1.69 +	# Compress all modules.
    1.70 +	#$WOK/$PACKAGE/stuff/gztazmod.sh $PWD/_pkg/lib/modules/$VERSION-slitaz
    1.71 +	ln System.map System.map-modules
    1.72 +	ln Module.symvers Module.symvers-modules
    1.73 +}
    1.74 +
    1.75 +# Rules to gen a SliTaz package suitable for Tazpkg.
    1.76 +genpkg_rules()
    1.77 +{
    1.78 +    mkdir -p $fs/lib \
    1.79 +		$fs/boot
    1.80 + 
    1.81 +    cp -a $_pkg/lib/modules $fs/lib
    1.82 +    cp -a $_pkg/lib/firmware $fs/lib
    1.83 +    cp -a $_pkg/boot $fs/
    1.84 +    		
    1.85 +    #~ # Get the base modules
    1.86 +    #~ export src
    1.87 +    #~ export _pkg
    1.88 +	#~ 
    1.89 +    #~ $src/slitaz/list_modules.sh \
    1.90 +	#~ $(cat stuff/modules-$VERSION.list) > $src/modules.list
    1.91 +    #~ while read module; do
    1.92 +    	#~ dir=$(dirname $module)
    1.93 +    	#~ [ -d $path/$dir ] || mkdir -p $path/$dir
    1.94 +        #~ cp -a $_pkg/lib/modules/$VERSION-slitaz/kernel/$module $path/$dir
    1.95 +    #~ done < $src/modules.list
    1.96 +	
    1.97 +    # Remove unresolved links
    1.98 +    rm -f $fs/lib/modules/${KERNELRELEASE}/build
    1.99 +    rm -f $fs/lib/modules/${KERNELRELEASE}/source
   1.100 +    
   1.101 +}
   1.102 +
   1.103 +# Pre and post install commands for Tazpkg.
   1.104 +post_install()
   1.105 +{
   1.106 +    echo "Processing post-install commands..."
   1.107 +    KERNELRELEASE=2.6.32.25-ovz
   1.108 +    
   1.109 +    chroot "$1/" depmod -a $KERNELRELEASE
   1.110 +    
   1.111 +    # GRUB stuff.
   1.112 +    if [ -f "$1/boot/grub/menu.lst" ]; then
   1.113 +    	root_dev=`cat $1/boot/grub/menu.lst | grep root= | sed 's/.*root=\([^ ]*\).*/\1/' | head -n 1`
   1.114 +		grub_dev=`cat $1/boot/grub/menu.lst | grep "root (" | head -n 1`
   1.115 +		# Add new kernel entry in case of upgrade for installed system.
   1.116 +		if ! grep -q $KERNELRELEASE $1/boot/grub/menu.lst; then
   1.117 +    		cat >> $1/boot/grub/menu.lst << EOT
   1.118 +
   1.119 +title SliTaz GNU/Linux (Kernel $KERNELRELEASE)
   1.120 +$grub_dev
   1.121 +kernel /boot/vmlinuz-$KERNELRELEASE root=$root_dev
   1.122 +EOT
   1.123 +		fi
   1.124 +		# Display information message.
   1.125 +    	cat <<EOT
   1.126 +----
   1.127 +GRUB is installed, these tree lines must be in your /boot/grub/menu.lst:
   1.128 +
   1.129 +title  SliTaz GNU/Linux (Kernel $KERNELRELEASE)
   1.130 +$grub_dev
   1.131 +kernel /boot/vmlinuz-$KERNELRELEASE root=$root_dev
   1.132 +----
   1.133 +EOT
   1.134 +	fi
   1.135 +}