wok-6.x rev 2382

Add linux-tickless
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Mar 08 15:41:12 2009 +0000 (2009-03-08)
parents 2f08b20301f0
children aecb1ba84c83
files linux-tickless/receipt
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/linux-tickless/receipt	Sun Mar 08 15:41:12 2009 +0000
     1.3 @@ -0,0 +1,107 @@
     1.4 +# SliTaz package receipt.
     1.5 +
     1.6 +PACKAGE="linux-tickless"
     1.7 +VERSION="2.6.25.5"
     1.8 +CATEGORY="base-system"
     1.9 +SHORT_DESC="The Linux kernel and modules."
    1.10 +BUILD_DEPENDS="slitaz-toolchain perl"
    1.11 +MAINTAINER="pascal.bellard@slitaz.org"
    1.12 +SOURCE="linux"
    1.13 +TARBALL="$SOURCE-$VERSION.tar.bz2"
    1.14 +WEB_SITE="http://www.kernel.org/"
    1.15 +WGET_URL="http://www.eu.kernel.org/pub/linux/kernel/v2.6/$TARBALL"
    1.16 +CONFIG_FILES="/lib/modules/$VERSION-slitaz/modules.dep"
    1.17 +PROVIDE="linux"
    1.18 +
    1.19 +# Rules to configure and make the package.
    1.20 +compile_rules()
    1.21 +{
    1.22 +	cd $src
    1.23 +	rm -rf slitaz 2> /dev/null
    1.24 +	mkdir slitaz
    1.25 +	echo "$WGET_URL" > slitaz/url
    1.26 +	cp $WOK/linux/stuff/gztazmod.sh $WOK/linux/stuff/list_modules.sh slitaz
    1.27 +	# lzma and misc patches from pascal
    1.28 +	while read patch_file; do
    1.29 +		if [ -f done.$patch_file ]; then
    1.30 +			echo "Skipping $patch_file"
    1.31 +			continue
    1.32 +		fi
    1.33 +		echo "Apply $patch_file"
    1.34 +		patch -p1 < $WOK/linux/stuff/$patch_file || return 1
    1.35 +		echo "$patch_file" >> slitaz/patches
    1.36 +		cp $WOK/linux/stuff/$patch_file slitaz/$patch_file
    1.37 +		touch done.$patch_file
    1.38 +	done <<EOT
    1.39 +$SOURCE-lzma-$VERSION.u
    1.40 +$SOURCE-utf8-$VERSION.u
    1.41 +$SOURCE-diff-$VERSION.u
    1.42 +$SOURCE-rootdev.u
    1.43 +EOT
    1.44 +	make mrproper	
    1.45 +	cp $WOK/linux/stuff/$SOURCE-$VERSION-slitaz.config .config
    1.46 +	sed -i  -e 's/# CONFIG_TICK_ONESHOT .*/CONFIG_TICK_ONESHOT=y/'
    1.47 +		-e 's/# CONFIG_NO_HZ .*/CONFIG_NO_HZ=y/' .config 
    1.48 +	make oldconfig
    1.49 +	ln .config slitaz/config
    1.50 +	make bzImage
    1.51 +	make modules
    1.52 +	make INSTALL_MOD_PATH=$PWD/_pkg modules_install
    1.53 +	make INSTALL_HDR_PATH=$PWD/_pkg/usr headers_install
    1.54 +} 
    1.55 +
    1.56 +# Rules to gen a SliTaz package suitable for Tazpkg.
    1.57 +genpkg_rules()
    1.58 +{
    1.59 +    local path
    1.60 +    mkdir $fs/boot
    1.61 +    cp -a $src/arch/x86/boot/bzImage $fs/boot/vmlinuz-$VERSION-slitaz
    1.62 +    # Compress all modules.
    1.63 +    # Package module-init-tools is compiled with zlib support.
    1.64 +    #
    1.65 +    $WOK/linux/stuff/gztazmod.sh $_pkg/lib/modules/$VERSION-slitaz
    1.66 +    path=$fs/lib/modules/$VERSION-slitaz/kernel
    1.67 +    mkdir -p $path
    1.68 +    cp -a $_pkg/lib/modules/$VERSION-slitaz/mo* $fs/lib/modules/$VERSION-slitaz
    1.69 +    cp $WOK/linux/stuff/list_modules.sh $src
    1.70 +    export src
    1.71 +    export _pkg
    1.72 +    $src/list_modules.sh $(cat $WOK/linux/stuff/modules-$VERSION.list) > $src/modules.list
    1.73 +    while read module; do
    1.74 +    	dir=$(dirname $module)
    1.75 +    	[ -d $path/$dir ] || mkdir -p $path/$dir
    1.76 +        cp -a $_pkg/lib/modules/$VERSION-slitaz/kernel/$module $path/$dir
    1.77 +    done < $src/modules.list
    1.78 +    # Remove unresolved links
    1.79 +    rm -f $fs/lib/modules/$VERSION-slitaz/build
    1.80 +    rm -f $fs/lib/modules/$VERSION-slitaz/source
    1.81 +}
    1.82 +
    1.83 +# Pre and post install commands for Tazpkg.
    1.84 +# GRUB stuf.
    1.85 +post_install()
    1.86 +{
    1.87 +    echo "Processing post-install commands..."
    1.88 +    depmod -a -b "$1/" $VERSION-slitaz
    1.89 +    if [ -f "$1/boot/grub/menu.lst" ]; then
    1.90 +    	root_dev=`cat $1/boot/grub/menu.lst | grep root= | sed 's/.*root=\([^ ]*\).*/\1/'`
    1.91 +		grub_dev=`cat $1/boot/grub/menu.lst | grep "root ("`
    1.92 +		# Add new kernel entry in case of upgrade for installed system.
    1.93 +    	cat >> $1/boot/grub/menu.lst << EOT
    1.94 +
    1.95 +title  SliTaz GNU/Linux (Kernel $VERSION-slitaz)
    1.96 +$grub_dev
    1.97 +       kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev
    1.98 +EOT
    1.99 +		# Display information message.
   1.100 +    	cat <<EOT
   1.101 +----
   1.102 +GRUB is installed, these tree lines has been added to the menu.lst:
   1.103 + 
   1.104 +title  SliTaz GNU/Linux (Kernel $VERSION-slitaz)
   1.105 +$grub_dev
   1.106 +       kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev
   1.107 +----
   1.108 +EOT
   1.109 +	fi
   1.110 +}