Hello community,
here is the log from the commit of package compcache for openSUSE:Factory
checked in at Sat Jan 15 01:41:07 CET 2011.
--------
--- compcache/compcache.changes 2010-05-12 16:23:52.000000000 +0200
+++ compcache/compcache.changes 2011-01-13 20:43:46.000000000 +0100
@@ -1,0 +2,15 @@
+Thu Jan 13 20:43:28 CET 2011 - tiwai@suse.de
+
+- fix some typos in init script
+
+-------------------------------------------------------------------
+Tue Jan 11 15:17:39 CET 2011 - tiwai@suse.de
+
+- updated to compcache-0.6.2: see ChangeLog for details;
+ this fixes the incompatible statics ioctl for oS 11.3
+ (bnc#647345)
+- improved / fixed init and sysconfig files (bnc#661993)
+- adapted init script for 11.4 ramz driver; rzscontrol is no
+ longer used for zram driver; package contains only scripts
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
Old:
----
compcache-0.6.tar.bz2
compcache-kernel-build-fixes.diff
New:
----
compcache-0.6.2.tar.bz2
ramzswap-kernel-build-fix.diff
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ compcache.spec ++++++
--- /var/tmp/diff_new_pack.PpoOK5/_old 2011-01-15 01:36:31.000000000 +0100
+++ /var/tmp/diff_new_pack.PpoOK5/_new 2011-01-15 01:36:31.000000000 +0100
@@ -1,7 +1,7 @@
#
-# spec file for package compcache (Version 0.6)
+# spec file for package compcache
#
-# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -24,26 +24,36 @@
%define need_kmp 0
%endif
+%if %suse_version <= 1130
+%define need_rzsctl 1
+%else
+%define need_rzsctl 0
+%endif
+
Name: compcache
%if %need_kmp
BuildRequires: kernel-source kernel-syms module-init-tools
%endif
License: GPLv2
Group: System/Kernel
-Version: 0.6
-Release: 5
+Version: 0.6.2
+Release: 1
Summary: Compressed RAM based swap device
Source0: compcache-%{version}.tar.bz2
Source1: sysconfig.compcache
Source2: boot.compcache
Patch: compcache-rzscontrol-cflags.diff
-Patch1: compcache-kernel-build-fixes.diff
+Patch1: ramzswap-kernel-build-fix.diff
Url: http://code.google.com/p/compcache/
BuildRoot: %{_tmppath}/%{name}-%{version}-build
PreReq: %fillup_prereq
%if %need_kmp
Requires: compcache-kmp
%suse_kernel_module_package -n %{name} kdump um
+%else
+%if !%need_rzsctl
+BuildArch: noarch
+%endif
%endif
%description
@@ -73,8 +83,6 @@
%setup -q
%patch -p1
%patch1 -p1
-# 64bit binary
-rm ./sub-projects/rzscontrol/rzscontrol
%build
%if %need_kmp
@@ -86,7 +94,9 @@
make -C ${KERNEL_OBJ} M=$PWD/obj/$flavor modules
done
%endif
+%if %need_rzsctl
make -C sub-projects/rzscontrol
+%endif
%install
%if %need_kmp
@@ -97,10 +107,12 @@
make -C ${KERNEL_OBJ} M=$PWD/obj/$flavor modules_install
done
%endif
+%if %need_rzsctl
mkdir -p $RPM_BUILD_ROOT/usr/sbin
install -c -m 0755 sub-projects/rzscontrol/rzscontrol $RPM_BUILD_ROOT/usr/sbin
mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1
install -c -m 0644 sub-projects/rzscontrol/man/*.1 $RPM_BUILD_ROOT/%{_mandir}/man1
+%endif
mkdir -p $RPM_BUILD_ROOT/var/adm/fillup-templates
install -c -m 0644 %{SOURCE1} $RPM_BUILD_ROOT/var/adm/fillup-templates
mkdir -p $RPM_BUILD_ROOT/etc/init.d
@@ -120,8 +132,10 @@
%files
%defattr(-,root,root)
+%if %need_rzsctl
/usr/sbin/*
%{_mandir}/man?/*
+%endif
/etc/init.d/boot.compcache
/var/adm/fillup-templates/sysconfig.compcache
%doc README Changelog
++++++ boot.compcache ++++++
--- /var/tmp/diff_new_pack.PpoOK5/_old 2011-01-15 01:36:31.000000000 +0100
+++ /var/tmp/diff_new_pack.PpoOK5/_new 2011-01-15 01:36:31.000000000 +0100
@@ -3,17 +3,18 @@
# System startup script loading compcache kernel module
# Copyright (C) 2008 Takashi Iwai
# Added SMP support by Erdem U. Altinyurt
+#
# /etc/init.d/compcache
#
### BEGIN INIT INFO
-# Provides: compcache
-# Required-Start: boot.swap
-# Required-Stop: boot.swap
-# Should-Start:
+# Provides: boot.compcache
+# Required-Start: boot.swap
+# Required-Stop: boot.swap
+# Should-Start:
# Should-Stop:
-# Default-Start: B
-# Default-Stop: B
-# Description: Loads compcache - compressed RAM based swap device
+# Default-Start: B
+# Default-Stop: B
+# Description: Loads compcache - compressed RAM based swap device
### END INIT INFO
. /etc/rc.status
@@ -24,9 +25,20 @@
UDEVADM_BIN=/sbin/udevadm
MODPROBE_BIN=/sbin/modprobe
RZSCTL_BIN=/usr/sbin/rzscontrol
-SWAPDEVNM=/dev/ramzswap
-COMPCACHE_NUM_DEVICES=$(cat /proc/cpuinfo | grep processor | wc -l)
-COMPCACHE_SIZE_KB=$(expr $(grep MemTotal /proc/meminfo | sed 's/^.* //;s/ .*$//g') / 4) #%25 of ram
+test -z "$COMPCACHE_NUM_DEVICES" -o "$COMPCACHE_NUM_DEVICES" -le 0 && COMPCACHE_NUM_DEVICES=$(cat /proc/cpuinfo | grep processor | wc -l)
+test -z "$COMPCACHE_SIZE_KB" && COMPCACHE_SIZE_KB="0"
+
+kver=$(uname -r)
+kver=${kver%%-*}
+krel=${kver#2.6.}
+krel=${krel%%.*}
+if [ "$krel" -ge 36 ]; then
+ ZRAM=zram
+ SWAPDEVNM=/dev/zram
+else
+ ZRAM=ramzswap
+ SWAPDEVNM=/dev/ramzswap
+fi
is_comp_swap_on () {
grep -q $1 /proc/swaps
@@ -37,64 +49,97 @@
case "$1" in
start)
- test -z "$COMPCACHE_NUM_DEVICES" && COMPCACHE_NUM_DEVICES="1"
- param="NUM_DEVICES=$COMPCACHE_NUM_DEVICES"
- echo -n "Loading ramzswap driver with $COMPCACHE_NUM_DEVICES devices and $(expr $COMPCACHE_SIZE_KB / 1024 )MB memory"
- $MODPROBE_BIN -q ramzswap num_devices=$COMPCACHE_NUM_DEVICES &>/dev/null
- rc_status -v
- # /dev/ramzswap0 is not available immediately after insmod returns
- # So, let udev complete its work before we do swapon
- for i in $(seq 0 $(expr $COMPCACHE_NUM_DEVICES - 1) ); do
+ #echo "Activating compressed RAM swap-devices..."
+ if [ "$COMPCACHE_SIZE_KB" -lt 0 ]; then
+ echo -n "Loading $ZRAM driver with $COMPCACHE_NUM_DEVICES devices "
+ rc_status -u
+ else
+ if [ "$COMPCACHE_SIZE_KB" -eq 0 ]; then
+ # 25% of RAM
+ COMPCACHE_SIZE_STR="$(expr $(grep MemTotal /proc/meminfo | sed 's/^.* //;s/ .*$//g') / 4096) MB"
+ elif [ "$COMPCACHE_SIZE_KB" -lt 1024 ]; then
+ COMPCACHE_SIZE_STR="$COMPCACHE_SIZE_KB kB"
+ else
+ COMPCACHE_SIZE_STR="$(expr $COMPCACHE_SIZE_KB / 1024) MB"
+ fi
+ echo -n "Loading $ZRAM driver with $COMPCACHE_NUM_DEVICES devices and $COMPCACHE_SIZE_STR memory "
+ $MODPROBE_BIN -q $ZRAM num_devices=$COMPCACHE_NUM_DEVICES &> /dev/null
+ rc_status -v
+ # /dev/ramzswap0 is not available immediately after insmod returns
+ # So, let udev complete its work before we do swapon
+ if [ ! -f ${SWAPDEVNM}0 ]; then
+ if [ -x "$UDEVADM_BIN" ]; then
+ $UDEVADM_BIN settle
+ else
+ sleep 2
+ fi
+ fi
+
+ COMPCACHE_DEV_SIZE_KB=$(expr $COMPCACHE_SIZE_KB / $COMPCACHE_NUM_DEVICES)
+ for i in $(seq 0 $(expr $COMPCACHE_NUM_DEVICES - 1) ); do
SWAPDEV=$SWAPDEVNM$i
- if [ ! -f $SWAPDEV ]; then
- if [ -f "$UDEVADM_BIN" ]; then
- $UDEVADM_BIN settle
+ SIZEBLK=/sys/block/$ZRAM$i/disksize
+ if [ -f $SIZEBLK ]; then
+ echo $(( $COMPCACHE_DEV_SIZE_KB * 1024 )) > $SIZEBLK
+ else
+ if [ "$COMPCACHE_SIZE_KB" -gt 0 ]; then
+ $RZSCTL_BIN $SWAPDEV -d $COMPCACHE_DEV_SIZE_KB -i
else
- sleep 2
+ $RZSCTL_BIN $SWAPDEV -i
fi
fi
- test -z "$COMPCACHE_SIZE_KB" && COMPCACHE_SIZE_KB="0"
- if [ "$COMPCACHE_SIZE_KB" -gt 0 ]; then
- $RZSCTL_BIN $SWAPDEV -d $(expr $COMPCACHE_SIZE_KB / $COMPCACHE_NUM_DEVICES) -i
- else
- $RZSCTL_BIN $SWAPDEV -i
- fi
-
if ! is_comp_swap_on $SWAPDEV; then
- echo -n "Setting up ramzswap swap device $i"
- $SWAPON_BIN $SWAPDEV -p 10
- rc_status -v
+ echo -n "Setting up $ZRAM swap device $i "
+ test "$ZRAM" = "zram" && /sbin/mkswap $SWAPDEV
+ $SWAPON_BIN $SWAPDEV -p 10
+ rc_status -v
fi
- done
- ;;
- stop)
- for i in $(seq 0 $(expr $COMPCACHE_NUM_DEVICES - 1) ); do
- SWAPDEV=$SWAPDEVNM$i
- if is_comp_swap_on $SWAPDEV; then
- echo -n "Turning off ramzswap swap device $i"
- $SWAPOFF_BIN $SWAPDEV
- rc_status -v
+ done
+ fi
+ ;;
+ stop)
+ #echo "Turning off compressed RAM swap-devices"
+ # We can't use COMPCACHE_NUM_DEVICES to enumerate, because the user can
+ # start compcache, lower COMPCACHE_NUM_DEVICES and restart compcache.
+ for SWAPDEV in ${SWAPDEVNM}* ; do
+ if is_comp_swap_on $SWAPDEV; then
+ nm=${SWAPDEV#$SWAPDEVNM}
+ RESETBLK=/sys/block/$ZRAM$nm/reset
+ echo -n "Turning off $ZRAM swap device $nm "
+ $SWAPOFF_BIN $SWAPDEV
+ rc_check
+ if [ -f $RESETBLK ]; then
+ echo 1 > $RESETBLK
+ else
+ $RZSCTL_BIN $SWAPDEV --reset &> /dev/null
fi
- done
- echo -n "Unloading ramzswap module"
- $MODPROBE_BIN -qr ramzswap &>/dev/null
+ rc_status -v
+ fi
+ done
+ # Let udev complete its work before we unload the ramzswap module
+ if [ -f "$UDEVADM_BIN" ]; then
+ $UDEVADM_BIN settle
+ else
+ sleep 2
+ fi
+ echo -n "Unloading $ZRAM module "
+ $MODPROBE_BIN -qr $ZRAM &> /dev/null
rc_status -v
-
;;
- restart)
+ restart)
$0 stop
$0 start
;;
- status)
+ status)
echo -n "Checking for compcache "
if is_comp_swap_on $SWAPDEVNM; then
- rc_failed 0
+ rc_failed 0
else
- rc_failed 3
+ rc_failed 3
fi
rc_status -v
;;
- *)
+ *)
echo "Usage: $0 {start|stop|status|restart}"
exit 1
;;
++++++ compcache-0.6.tar.bz2 -> compcache-0.6.2.tar.bz2 ++++++
++++ 4566 lines of diff (skipped)
++++++ ramzswap-kernel-build-fix.diff ++++++
---
ramzswap_drv.c | 10 ++++++++++
1 file changed, 10 insertions(+)
--- a/ramzswap_drv.c
+++ b/ramzswap_drv.c
@@ -1178,6 +1178,7 @@
set_capacity(rzs->disk, rzs->disksize >> SECTOR_SHIFT);
+#ifdef blk_queue_nonrot
/*
* We have ident mapping of sectors for ramzswap and
* and the backing swap device. So, this queue flag
@@ -1186,6 +1187,7 @@
if (!rzs->backing_swap ||
blk_queue_nonrot(rzs->backing_swap->bd_disk->queue))
queue_flag_set_unlocked(QUEUE_FLAG_NONROT, rzs->disk->queue);
+#endif
rzs->mem_pool = xv_create_pool();
if (!rzs->mem_pool) {
@@ -1233,9 +1235,17 @@
return 0;
}
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,28)
static int ramzswap_ioctl(struct block_device *bdev, fmode_t mode,
unsigned int cmd, unsigned long arg)
+#else
+static int ramzswap_ioctl(struct inode *inode, struct file *file,
+ unsigned int cmd, unsigned long arg)
+#endif
{
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28)
+ struct block_device *bdev = I_BDEV(inode);
+#endif
int ret = 0;
size_t disksize_kb, memlimit_kb;
++++++ sysconfig.compcache ++++++
--- /var/tmp/diff_new_pack.PpoOK5/_old 2011-01-15 01:36:31.000000000 +0100
+++ /var/tmp/diff_new_pack.PpoOK5/_new 2011-01-15 01:36:31.000000000 +0100
@@ -1,18 +1,21 @@
-## Path: System/Kernel
-## Description: Compcache settings
+## Path: System/Kernel
+## Description: Compcache settings
## Type: integer
## Default: 0
#
-# Size to be used by compcache (compressed RAM swap device) in kB.
-# 0 means to the default value (25% of system RAM).
+# Total size to be used by compcache in kB
+# for all compressed RAM swap (ramzswap) devices.
+# 0 means to use the default size (25% of system RAM).
# a negative value means to disable compcache.
#
COMPCACHE_SIZE_KB="0"
-## Type: integer
-## Default: 1
+## Type: integer
+## Default: 1
#
-# Number of devices to create by ramzswap (compcache).
-# The device are named as /dev/ramzswapX where X starts from 0.
+# Number of compressed RAM swap (ramzswap) devices to create by compcache.
+# The devices are named as /dev/ramzswapX where X starts from 0.
+# 0 means to use the default number (number of processor cores).
#
COMPCACHE_NUM_DEVICES="1"
+
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org