wok rev 13390

Add linux-zram, it replaces compcache
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon Sep 24 12:17:18 2012 +0200 (2012-09-24)
parents 99598329e19b
children 749397e2c4a7
files compcache/receipt compcache/stuff/compcache compcache/stuff/compcache-0.6.2-linux-2.6.34.u compcache/stuff/compcache.conf linux-zram/receipt linux-zram/stuff/compcache linux-zram/stuff/compcache.conf linux64-zram/receipt linux64-zram/stuff/compcache linux64-zram/stuff/compcache.conf
line diff
     1.1 --- a/compcache/receipt	Mon Sep 24 11:39:21 2012 +0200
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,77 +0,0 @@
     1.4 -# SliTaz package receipt.
     1.5 -
     1.6 -PACKAGE="linux-zram"
     1.7 -VERSION="3.2.14"
     1.8 -BASEVER="${VERSION:0:3}"
     1.9 -CATEGORY="base-system"
    1.10 -SHORT_DESC="Compressed caching"
    1.11 -MAINTAINER="devel@slitaz.org"
    1.12 -WEB_SITE="http://www.kernel.org/"
    1.13 -WANTED="linux"
    1.14 -PROVIDE="compcache"
    1.15 -
    1.16 -DEPENDS="linux"
    1.17 -
    1.18 -# Rules to gen a SliTaz package suitable for Tazpkg.
    1.19 -genpkg_rules()
    1.20 -{
    1.21 -	KERNEL_VERSION=$(grep  ^VERSION= $WOK/linux/receipt | \
    1.22 -		cut -d "=" -f2 | sed -e 's/"//g')
    1.23 -	EXTRAVERSION=_$KERNEL_VERSION
    1.24 -	
    1.25 -	mkdir -p $fs/lib/modules/$KERNEL_VERSION-slitaz/kernel/misc \
    1.26 -			$fs/etc/init.d \
    1.27 -			$fs/usr/bin
    1.28 -	
    1.29 -	install -o root -m 644 $src/ramzswap.ko \
    1.30 -		$fs/lib/modules/$KERNEL_VERSION-slitaz/kernel/misc
    1.31 -	cp -a $src/sub-projects/rzscontrol/rzscontrol $fs/usr/bin
    1.32 -	
    1.33 -	for i in $fs/lib/modules/$KERNEL_VERSION-slitaz/kernel/misc/*.ko ; do
    1.34 -		lzma e $i $i.gz && rm -f $i
    1.35 -	done
    1.36 -	install -o root -m 755 $stuff/compcache $fs/etc/init.d/
    1.37 -	install -o root -m 644 $stuff/compcache.conf $fs/etc/
    1.38 -}
    1.39 -
    1.40 -post_install()
    1.41 -{
    1.42 -	echo "Processing post-install commands..."
    1.43 -	chroot "$1/" depmod -a ${EXTRAVERSION#_}-slitaz
    1.44 -}
    1.45 -
    1.46 -post_remove()
    1.47 -{
    1.48 -	echo "Processing post-remove commands..."
    1.49 -	chroot "$1/" depmod -a ${EXTRAVERSION#_}-slitaz
    1.50 -}
    1.51 -# Rules to gen a SliTaz package suitable for Tazpkg.
    1.52 -genpkg_rules()
    1.53 -{
    1.54 -    local path
    1.55 -    path=lib/modules/$BASEVER-slitaz/kernel
    1.56 -    mkdir -p $fs/$path $fs/etc
    1.57 -    export src
    1.58 -    export _pkg
    1.59 -    $wanted_stuff/list_modules.sh fs/${PACKAGE#*-} | while read module; do
    1.60 -    	dir=$path/$(dirname $module)
    1.61 -    	[ -d $fs/$dir ] || mkdir -p $fs/$dir
    1.62 -        cp -a $_pkg/$path/$module $fs/$dir
    1.63 -    done
    1.64 -    touch $fs/etc/filesystems
    1.65 -}
    1.66 -
    1.67 -# Post install/remove commands for Tazpkg.
    1.68 -post_install()
    1.69 -{
    1.70 -	grep -qs ^${PACKAGE#*-}$ $1/etc/filesystems || \
    1.71 -		echo "${PACKAGE#*-}" >> $1/etc/filesystems
    1.72 -	chroot "$1/" depmod -a $BASEVER-slitaz
    1.73 -}
    1.74 -
    1.75 -post_remove()
    1.76 -{
    1.77 -	sed -i "/^${PACKAGE#*-}\$/d" $1/etc/filesystems
    1.78 -	chroot "$1/" depmod -a $BASEVER-slitaz
    1.79 -}
    1.80 -
     2.1 --- a/compcache/stuff/compcache	Mon Sep 24 11:39:21 2012 +0200
     2.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.3 @@ -1,47 +0,0 @@
     2.4 -#!/bin/sh
     2.5 -# /etc/init.d/compcache: Start, stop and restart COMPCACHE daemon on SliTaz,
     2.6 -# at boot time or with the command line. Daemons options are configured
     2.7 -# with /etc/daemons.conf
     2.8 -#
     2.9 -. /etc/init.d/rc.functions
    2.10 -source /etc/compcache.conf
    2.11 -
    2.12 -NAME="compcache"
    2.13 -EXIST=`cat /proc/swaps | grep ramzswap0`
    2.14 -
    2.15 -case "$1" in
    2.16 -  start)
    2.17 -    if [ ! "$EXIST" = "" ] ; then
    2.18 -      echo "$NAME already running."
    2.19 -      exit 1
    2.20 -    fi
    2.21 -    echo -n "Loading module"
    2.22 -    modprobe ramzswap disksize_kb=$SIZE_KB
    2.23 -    status
    2.24 -    echo -n "Starting $NAME..."
    2.25 -    rzscontrol /dev/ramzswap0 --init
    2.26 -    swapon /dev/ramzswap0 -p 100
    2.27 -    status
    2.28 -    ;;
    2.29 -  stop)
    2.30 -    if [ "$EXIST" = "" ] ; then
    2.31 -      echo "$NAME is not running."
    2.32 -      exit 1
    2.33 -    fi
    2.34 -    echo -n "Stopping $NAME... "
    2.35 -    swapoff /dev/ramzswap0    
    2.36 -    rzscontrol /dev/ramzswap0 --reset
    2.37 -    status
    2.38 -    echo -n "Unloding modules"
    2.39 -    rmmod ramzswap 
    2.40 -    status
    2.41 -    ;;
    2.42 -  *)
    2.43 -    echo ""
    2.44 -    echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop]"
    2.45 -    echo ""
    2.46 -    exit 1
    2.47 -    ;;
    2.48 -esac
    2.49 -
    2.50 -exit 0
     3.1 --- a/compcache/stuff/compcache-0.6.2-linux-2.6.34.u	Mon Sep 24 11:39:21 2012 +0200
     3.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.3 @@ -1,10 +0,0 @@
     3.4 ---- compcache-0.6.2-ori/ramzswap_drv.c
     3.5 -+++ compcache-0.6.2/ramzswap_drv.c
     3.6 -@@ -29,6 +29,7 @@
     3.7 - #include <linux/swapops.h>
     3.8 - #include <linux/vmalloc.h>
     3.9 - #include <linux/version.h>
    3.10 -+#include <linux/slab.h>
    3.11 - 
    3.12 - #include "compat.h"
    3.13 - #include "ramzswap_drv.h"
     4.1 --- a/compcache/stuff/compcache.conf	Mon Sep 24 11:39:21 2012 +0200
     4.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.3 @@ -1,1 +0,0 @@
     4.4 -SIZE_KB=20480
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/linux-zram/receipt	Mon Sep 24 12:17:18 2012 +0200
     5.3 @@ -0,0 +1,43 @@
     5.4 +# SliTaz package receipt.
     5.5 +
     5.6 +PACKAGE="linux-zram"
     5.7 +VERSION="3.2.14"
     5.8 +BASEVER="${VERSION:0:3}"
     5.9 +CATEGORY="base-system"
    5.10 +SHORT_DESC="Compressed caching"
    5.11 +MAINTAINER="devel@slitaz.org"
    5.12 +WEB_SITE="http://www.kernel.org/"
    5.13 +WANTED="linux"
    5.14 +PROVIDE="compcache"
    5.15 +
    5.16 +DEPENDS="linux"
    5.17 +
    5.18 +# Rules to gen a SliTaz package suitable for Tazpkg.
    5.19 +genpkg_rules()
    5.20 +{
    5.21 +	local path
    5.22 +	path=lib/modules/$BASEVER-slitaz/kernel
    5.23 +	mkdir -p $fs/$path $fs/etc/init.d
    5.24 +	export src
    5.25 +	export _pkg
    5.26 +	$wanted_stuff/list_modules.sh drivers/staging/zram | \
    5.27 +	while read module; do
    5.28 +		dir=$path/$(dirname $module)
    5.29 +		[ -d $fs/$dir ] || mkdir -p $fs/$dir
    5.30 +		cp -a $_pkg/$path/$module $fs/$dir
    5.31 +	done
    5.32 +	install -o root -m 755 $stuff/compcache $fs/etc/init.d/
    5.33 +	install -o root -m 644 $stuff/compcache.conf $fs/etc/
    5.34 +}
    5.35 +
    5.36 +# Post install/remove commands for Tazpkg.
    5.37 +post_install()
    5.38 +{
    5.39 +	chroot "$1/" depmod -a $BASEVER-slitaz
    5.40 +}
    5.41 +
    5.42 +post_remove()
    5.43 +{
    5.44 +	chroot "$1/" depmod -a $BASEVER-slitaz
    5.45 +}
    5.46 +
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/linux-zram/stuff/compcache	Mon Sep 24 12:17:18 2012 +0200
     6.3 @@ -0,0 +1,47 @@
     6.4 +#!/bin/sh
     6.5 +# /etc/init.d/compcache: Start, stop and restart COMPCACHE daemon on SliTaz,
     6.6 +# at boot time or with the command line. Daemons options are configured
     6.7 +# with /etc/daemons.conf
     6.8 +#
     6.9 +. /etc/init.d/rc.functions
    6.10 +source /etc/compcache.conf
    6.11 +
    6.12 +NAME="compcache"
    6.13 +EXIST=`cat /proc/swaps | grep zram0`
    6.14 +
    6.15 +case "$1" in
    6.16 +  start)
    6.17 +    if [ ! "$EXIST" = "" ] ; then
    6.18 +      echo "$NAME already running."
    6.19 +      exit 1
    6.20 +    fi
    6.21 +    echo -n "Loading module"
    6.22 +    modprobe zram num_devices=1 &&
    6.23 +    [ -n "$SIZE_KB" ] && echo $(($SIZE_KB * 1024)) > /sys/block/zram0/disksize
    6.24 +    status
    6.25 +
    6.26 +    echo -n "Starting $NAME..."
    6.27 +    mkswap /dev/zram0 && swapon /dev/zram0 -p 100
    6.28 +    status
    6.29 +    ;;
    6.30 +  stop)
    6.31 +    if [ "$EXIST" = "" ] ; then
    6.32 +      echo "$NAME is not running."
    6.33 +      exit 1
    6.34 +    fi
    6.35 +    echo -n "Stopping $NAME... "
    6.36 +    swapoff /dev/zram0 && echo 1 > /sys/block/zram0/reset
    6.37 +    status
    6.38 +    echo -n "Unloding modules"
    6.39 +    rmmod zram
    6.40 +    status
    6.41 +    ;;
    6.42 +  *)
    6.43 +    echo ""
    6.44 +    echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop]"
    6.45 +    echo ""
    6.46 +    exit 1
    6.47 +    ;;
    6.48 +esac
    6.49 +
    6.50 +exit 0
     7.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2 +++ b/linux-zram/stuff/compcache.conf	Mon Sep 24 12:17:18 2012 +0200
     7.3 @@ -0,0 +1,1 @@
     7.4 +SIZE_KB=20480
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/linux64-zram/receipt	Mon Sep 24 12:17:18 2012 +0200
     8.3 @@ -0,0 +1,44 @@
     8.4 +# SliTaz package receipt.
     8.5 +
     8.6 +PACKAGE="linux64-zram"
     8.7 +VERSION="3.2.14"
     8.8 +BASEVER="${VERSION:0:3}"
     8.9 +CATEGORY="base-system"
    8.10 +SHORT_DESC="Compressed caching"
    8.11 +MAINTAINER="devel@slitaz.org"
    8.12 +WEB_SITE="http://www.kernel.org/"
    8.13 +WANTED="linux64"
    8.14 +PROVIDE="compcache linux-zram"
    8.15 +
    8.16 +DEPENDS="linux"
    8.17 +
    8.18 +# Rules to gen a SliTaz package suitable for Tazpkg.
    8.19 +genpkg_rules()
    8.20 +{
    8.21 +	local path
    8.22 +	_pkg=$_pkg/linux64
    8.23 +	path=lib/modules/$BASEVER-slitaz/kernel
    8.24 +	mkdir -p $fs/$path $fs/etc/init.d
    8.25 +	export src
    8.26 +	export _pkg
    8.27 +	$wanted_stuff/list_modules.sh drivers/staging/zram | \
    8.28 +	while read module; do
    8.29 +		dir=$path/$(dirname $module)
    8.30 +		[ -d $fs/$dir ] || mkdir -p $fs/$dir
    8.31 +		cp -a $_pkg/$path/$module $fs/$dir
    8.32 +	done
    8.33 +	install -o root -m 755 $stuff/compcache $fs/etc/init.d/
    8.34 +	install -o root -m 644 $stuff/compcache.conf $fs/etc/
    8.35 +}
    8.36 +
    8.37 +# Post install/remove commands for Tazpkg.
    8.38 +post_install()
    8.39 +{
    8.40 +	chroot "$1/" depmod -a $BASEVER-slitaz
    8.41 +}
    8.42 +
    8.43 +post_remove()
    8.44 +{
    8.45 +	chroot "$1/" depmod -a $BASEVER-slitaz
    8.46 +}
    8.47 +
     9.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.2 +++ b/linux64-zram/stuff/compcache	Mon Sep 24 12:17:18 2012 +0200
     9.3 @@ -0,0 +1,47 @@
     9.4 +#!/bin/sh
     9.5 +# /etc/init.d/compcache: Start, stop and restart COMPCACHE daemon on SliTaz,
     9.6 +# at boot time or with the command line. Daemons options are configured
     9.7 +# with /etc/daemons.conf
     9.8 +#
     9.9 +. /etc/init.d/rc.functions
    9.10 +source /etc/compcache.conf
    9.11 +
    9.12 +NAME="compcache"
    9.13 +EXIST=`cat /proc/swaps | grep zram0`
    9.14 +
    9.15 +case "$1" in
    9.16 +  start)
    9.17 +    if [ ! "$EXIST" = "" ] ; then
    9.18 +      echo "$NAME already running."
    9.19 +      exit 1
    9.20 +    fi
    9.21 +    echo -n "Loading module"
    9.22 +    modprobe zram num_devices=1 &&
    9.23 +    [ -n "$SIZE_KB" ] && echo $(($SIZE_KB * 1024)) > /sys/block/zram0/disksize
    9.24 +    status
    9.25 +
    9.26 +    echo -n "Starting $NAME..."
    9.27 +    mkswap /dev/zram0 && swapon /dev/zram0 -p 100
    9.28 +    status
    9.29 +    ;;
    9.30 +  stop)
    9.31 +    if [ "$EXIST" = "" ] ; then
    9.32 +      echo "$NAME is not running."
    9.33 +      exit 1
    9.34 +    fi
    9.35 +    echo -n "Stopping $NAME... "
    9.36 +    swapoff /dev/zram0 && echo 1 > /sys/block/zram0/reset
    9.37 +    status
    9.38 +    echo -n "Unloding modules"
    9.39 +    rmmod zram
    9.40 +    status
    9.41 +    ;;
    9.42 +  *)
    9.43 +    echo ""
    9.44 +    echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop]"
    9.45 +    echo ""
    9.46 +    exit 1
    9.47 +    ;;
    9.48 +esac
    9.49 +
    9.50 +exit 0
    10.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.2 +++ b/linux64-zram/stuff/compcache.conf	Mon Sep 24 12:17:18 2012 +0200
    10.3 @@ -0,0 +1,1 @@
    10.4 +SIZE_KB=20480