# HG changeset patch # User Pascal Bellard # Date 1348481838 -7200 # Node ID 7d3f6d7f25281faaf631633b27084971669f310f # Parent 99598329e19b8173c3f9d8a3beb2a48bad74650a Add linux-zram, it replaces compcache diff -r 99598329e19b -r 7d3f6d7f2528 compcache/receipt --- a/compcache/receipt Mon Sep 24 11:39:21 2012 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,77 +0,0 @@ -# SliTaz package receipt. - -PACKAGE="linux-zram" -VERSION="3.2.14" -BASEVER="${VERSION:0:3}" -CATEGORY="base-system" -SHORT_DESC="Compressed caching" -MAINTAINER="devel@slitaz.org" -WEB_SITE="http://www.kernel.org/" -WANTED="linux" -PROVIDE="compcache" - -DEPENDS="linux" - -# Rules to gen a SliTaz package suitable for Tazpkg. -genpkg_rules() -{ - KERNEL_VERSION=$(grep ^VERSION= $WOK/linux/receipt | \ - cut -d "=" -f2 | sed -e 's/"//g') - EXTRAVERSION=_$KERNEL_VERSION - - mkdir -p $fs/lib/modules/$KERNEL_VERSION-slitaz/kernel/misc \ - $fs/etc/init.d \ - $fs/usr/bin - - install -o root -m 644 $src/ramzswap.ko \ - $fs/lib/modules/$KERNEL_VERSION-slitaz/kernel/misc - cp -a $src/sub-projects/rzscontrol/rzscontrol $fs/usr/bin - - for i in $fs/lib/modules/$KERNEL_VERSION-slitaz/kernel/misc/*.ko ; do - lzma e $i $i.gz && rm -f $i - done - install -o root -m 755 $stuff/compcache $fs/etc/init.d/ - install -o root -m 644 $stuff/compcache.conf $fs/etc/ -} - -post_install() -{ - echo "Processing post-install commands..." - chroot "$1/" depmod -a ${EXTRAVERSION#_}-slitaz -} - -post_remove() -{ - echo "Processing post-remove commands..." - chroot "$1/" depmod -a ${EXTRAVERSION#_}-slitaz -} -# Rules to gen a SliTaz package suitable for Tazpkg. -genpkg_rules() -{ - local path - path=lib/modules/$BASEVER-slitaz/kernel - mkdir -p $fs/$path $fs/etc - export src - export _pkg - $wanted_stuff/list_modules.sh fs/${PACKAGE#*-} | while read module; do - dir=$path/$(dirname $module) - [ -d $fs/$dir ] || mkdir -p $fs/$dir - cp -a $_pkg/$path/$module $fs/$dir - done - touch $fs/etc/filesystems -} - -# Post install/remove commands for Tazpkg. -post_install() -{ - grep -qs ^${PACKAGE#*-}$ $1/etc/filesystems || \ - echo "${PACKAGE#*-}" >> $1/etc/filesystems - chroot "$1/" depmod -a $BASEVER-slitaz -} - -post_remove() -{ - sed -i "/^${PACKAGE#*-}\$/d" $1/etc/filesystems - chroot "$1/" depmod -a $BASEVER-slitaz -} - diff -r 99598329e19b -r 7d3f6d7f2528 compcache/stuff/compcache --- a/compcache/stuff/compcache Mon Sep 24 11:39:21 2012 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,47 +0,0 @@ -#!/bin/sh -# /etc/init.d/compcache: Start, stop and restart COMPCACHE daemon on SliTaz, -# at boot time or with the command line. Daemons options are configured -# with /etc/daemons.conf -# -. /etc/init.d/rc.functions -source /etc/compcache.conf - -NAME="compcache" -EXIST=`cat /proc/swaps | grep ramzswap0` - -case "$1" in - start) - if [ ! "$EXIST" = "" ] ; then - echo "$NAME already running." - exit 1 - fi - echo -n "Loading module" - modprobe ramzswap disksize_kb=$SIZE_KB - status - echo -n "Starting $NAME..." - rzscontrol /dev/ramzswap0 --init - swapon /dev/ramzswap0 -p 100 - status - ;; - stop) - if [ "$EXIST" = "" ] ; then - echo "$NAME is not running." - exit 1 - fi - echo -n "Stopping $NAME... " - swapoff /dev/ramzswap0 - rzscontrol /dev/ramzswap0 --reset - status - echo -n "Unloding modules" - rmmod ramzswap - status - ;; - *) - echo "" - echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop]" - echo "" - exit 1 - ;; -esac - -exit 0 diff -r 99598329e19b -r 7d3f6d7f2528 compcache/stuff/compcache-0.6.2-linux-2.6.34.u --- a/compcache/stuff/compcache-0.6.2-linux-2.6.34.u Mon Sep 24 11:39:21 2012 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ ---- compcache-0.6.2-ori/ramzswap_drv.c -+++ compcache-0.6.2/ramzswap_drv.c -@@ -29,6 +29,7 @@ - #include - #include - #include -+#include - - #include "compat.h" - #include "ramzswap_drv.h" diff -r 99598329e19b -r 7d3f6d7f2528 compcache/stuff/compcache.conf --- a/compcache/stuff/compcache.conf Mon Sep 24 11:39:21 2012 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -SIZE_KB=20480 diff -r 99598329e19b -r 7d3f6d7f2528 linux-zram/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-zram/receipt Mon Sep 24 12:17:18 2012 +0200 @@ -0,0 +1,43 @@ +# SliTaz package receipt. + +PACKAGE="linux-zram" +VERSION="3.2.14" +BASEVER="${VERSION:0:3}" +CATEGORY="base-system" +SHORT_DESC="Compressed caching" +MAINTAINER="devel@slitaz.org" +WEB_SITE="http://www.kernel.org/" +WANTED="linux" +PROVIDE="compcache" + +DEPENDS="linux" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + local path + path=lib/modules/$BASEVER-slitaz/kernel + mkdir -p $fs/$path $fs/etc/init.d + export src + export _pkg + $wanted_stuff/list_modules.sh drivers/staging/zram | \ + while read module; do + dir=$path/$(dirname $module) + [ -d $fs/$dir ] || mkdir -p $fs/$dir + cp -a $_pkg/$path/$module $fs/$dir + done + install -o root -m 755 $stuff/compcache $fs/etc/init.d/ + install -o root -m 644 $stuff/compcache.conf $fs/etc/ +} + +# Post install/remove commands for Tazpkg. +post_install() +{ + chroot "$1/" depmod -a $BASEVER-slitaz +} + +post_remove() +{ + chroot "$1/" depmod -a $BASEVER-slitaz +} + diff -r 99598329e19b -r 7d3f6d7f2528 linux-zram/stuff/compcache --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-zram/stuff/compcache Mon Sep 24 12:17:18 2012 +0200 @@ -0,0 +1,47 @@ +#!/bin/sh +# /etc/init.d/compcache: Start, stop and restart COMPCACHE daemon on SliTaz, +# at boot time or with the command line. Daemons options are configured +# with /etc/daemons.conf +# +. /etc/init.d/rc.functions +source /etc/compcache.conf + +NAME="compcache" +EXIST=`cat /proc/swaps | grep zram0` + +case "$1" in + start) + if [ ! "$EXIST" = "" ] ; then + echo "$NAME already running." + exit 1 + fi + echo -n "Loading module" + modprobe zram num_devices=1 && + [ -n "$SIZE_KB" ] && echo $(($SIZE_KB * 1024)) > /sys/block/zram0/disksize + status + + echo -n "Starting $NAME..." + mkswap /dev/zram0 && swapon /dev/zram0 -p 100 + status + ;; + stop) + if [ "$EXIST" = "" ] ; then + echo "$NAME is not running." + exit 1 + fi + echo -n "Stopping $NAME... " + swapoff /dev/zram0 && echo 1 > /sys/block/zram0/reset + status + echo -n "Unloding modules" + rmmod zram + status + ;; + *) + echo "" + echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop]" + echo "" + exit 1 + ;; +esac + +exit 0 diff -r 99598329e19b -r 7d3f6d7f2528 linux-zram/stuff/compcache.conf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-zram/stuff/compcache.conf Mon Sep 24 12:17:18 2012 +0200 @@ -0,0 +1,1 @@ +SIZE_KB=20480 diff -r 99598329e19b -r 7d3f6d7f2528 linux64-zram/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux64-zram/receipt Mon Sep 24 12:17:18 2012 +0200 @@ -0,0 +1,44 @@ +# SliTaz package receipt. + +PACKAGE="linux64-zram" +VERSION="3.2.14" +BASEVER="${VERSION:0:3}" +CATEGORY="base-system" +SHORT_DESC="Compressed caching" +MAINTAINER="devel@slitaz.org" +WEB_SITE="http://www.kernel.org/" +WANTED="linux64" +PROVIDE="compcache linux-zram" + +DEPENDS="linux" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + local path + _pkg=$_pkg/linux64 + path=lib/modules/$BASEVER-slitaz/kernel + mkdir -p $fs/$path $fs/etc/init.d + export src + export _pkg + $wanted_stuff/list_modules.sh drivers/staging/zram | \ + while read module; do + dir=$path/$(dirname $module) + [ -d $fs/$dir ] || mkdir -p $fs/$dir + cp -a $_pkg/$path/$module $fs/$dir + done + install -o root -m 755 $stuff/compcache $fs/etc/init.d/ + install -o root -m 644 $stuff/compcache.conf $fs/etc/ +} + +# Post install/remove commands for Tazpkg. +post_install() +{ + chroot "$1/" depmod -a $BASEVER-slitaz +} + +post_remove() +{ + chroot "$1/" depmod -a $BASEVER-slitaz +} + diff -r 99598329e19b -r 7d3f6d7f2528 linux64-zram/stuff/compcache --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux64-zram/stuff/compcache Mon Sep 24 12:17:18 2012 +0200 @@ -0,0 +1,47 @@ +#!/bin/sh +# /etc/init.d/compcache: Start, stop and restart COMPCACHE daemon on SliTaz, +# at boot time or with the command line. Daemons options are configured +# with /etc/daemons.conf +# +. /etc/init.d/rc.functions +source /etc/compcache.conf + +NAME="compcache" +EXIST=`cat /proc/swaps | grep zram0` + +case "$1" in + start) + if [ ! "$EXIST" = "" ] ; then + echo "$NAME already running." + exit 1 + fi + echo -n "Loading module" + modprobe zram num_devices=1 && + [ -n "$SIZE_KB" ] && echo $(($SIZE_KB * 1024)) > /sys/block/zram0/disksize + status + + echo -n "Starting $NAME..." + mkswap /dev/zram0 && swapon /dev/zram0 -p 100 + status + ;; + stop) + if [ "$EXIST" = "" ] ; then + echo "$NAME is not running." + exit 1 + fi + echo -n "Stopping $NAME... " + swapoff /dev/zram0 && echo 1 > /sys/block/zram0/reset + status + echo -n "Unloding modules" + rmmod zram + status + ;; + *) + echo "" + echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop]" + echo "" + exit 1 + ;; +esac + +exit 0 diff -r 99598329e19b -r 7d3f6d7f2528 linux64-zram/stuff/compcache.conf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux64-zram/stuff/compcache.conf Mon Sep 24 12:17:18 2012 +0200 @@ -0,0 +1,1 @@ +SIZE_KB=20480