wok rev 23440

linux-zram: autostart
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Apr 02 12:22:43 2020 +0200 (2020-04-02)
parents 2f82f2467b46
children fda8ee7004a1
files cyrus-sasl-dev/receipt cyrus-sasl-pam/receipt cyrus-sasl/receipt libsasl-modules/receipt libsasl-without-ldap/receipt libsasl/receipt 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/cyrus-sasl-dev/receipt	Thu Apr 02 09:19:42 2020 +0100
     1.2 +++ b/cyrus-sasl-dev/receipt	Thu Apr 02 12:22:43 2020 +0200
     1.3 @@ -6,7 +6,7 @@
     1.4  SHORT_DESC="SASL authentication server - development files"
     1.5  MAINTAINER="pascal.bellard@slitaz.org"
     1.6  LICENSE="BSD"
     1.7 -WEB_SITE="https://cyrusimap.org/sasl/"
     1.8 +WEB_SITE="https://www.cyrusimap.org/sasl/"
     1.9  
    1.10  WANTED="cyrus-sasl"
    1.11  DEPENDS="cyrus-sasl"
     2.1 --- a/cyrus-sasl-pam/receipt	Thu Apr 02 09:19:42 2020 +0100
     2.2 +++ b/cyrus-sasl-pam/receipt	Thu Apr 02 12:22:43 2020 +0200
     2.3 @@ -6,11 +6,11 @@
     2.4  SHORT_DESC="SASL authentication server using PAM."
     2.5  MAINTAINER="pascal.bellard@slitaz.org"
     2.6  LICENSE="BSD"
     2.7 -WEB_SITE="https://cyrusimap.org/sasl"
     2.8 +WEB_SITE="https://www.cyrusimap.org/sasl"
     2.9  
    2.10  SOURCE="cyrus-sasl"
    2.11  TARBALL="$SOURCE-$VERSION.tar.gz"
    2.12 -WGET_URL="http://cyrusimap.org/releases/$SOURCE-$VERSION.tar.gz"
    2.13 +WGET_URL="https://www.cyrusimap.org/releases/$SOURCE-$VERSION.tar.gz"
    2.14  
    2.15  PROVIDE="cyrus-sasl:pam"
    2.16  DEPENDS="libcomerr3 libdb libkrb5 libldap openssl pam"
     3.1 --- a/cyrus-sasl/receipt	Thu Apr 02 09:19:42 2020 +0100
     3.2 +++ b/cyrus-sasl/receipt	Thu Apr 02 12:22:43 2020 +0200
     3.3 @@ -7,10 +7,10 @@
     3.4  MAINTAINER="pascal.bellard@slitaz.org"
     3.5  LICENSE="BSD"
     3.6  
     3.7 -WEB_SITE="https://cyrusimap.org/sasl"
     3.8 +WEB_SITE="https://www.cyrusimap.org/sasl"
     3.9  
    3.10  TARBALL="$PACKAGE-$VERSION.tar.gz"
    3.11 -WGET_URL="http://cyrusimap.org/releases/$PACKAGE-$VERSION.tar.gz"
    3.12 +WGET_URL="https://www.cyrusimap.org/releases/$PACKAGE-$VERSION.tar.gz"
    3.13  
    3.14  DEPENDS="libcomerr3 libdb libldap libsasl libsasl-modules openssl"
    3.15  BUILD_DEPENDS="db-dev openldap-dev openssl-dev"
     4.1 --- a/libsasl-modules/receipt	Thu Apr 02 09:19:42 2020 +0100
     4.2 +++ b/libsasl-modules/receipt	Thu Apr 02 12:22:43 2020 +0200
     4.3 @@ -6,7 +6,7 @@
     4.4  SHORT_DESC="SASL library modules."
     4.5  MAINTAINER="pascal.bellard@slitaz.org"
     4.6  LICENSE="BSD"
     4.7 -WEB_SITE="https://cyrusimap.org/sasl/"
     4.8 +WEB_SITE="https://www.cyrusimap.org/sasl/"
     4.9  
    4.10  PROVIDE="libsasl-without-ldap"
    4.11  WANTED="cyrus-sasl"
     5.1 --- a/libsasl-without-ldap/receipt	Thu Apr 02 09:19:42 2020 +0100
     5.2 +++ b/libsasl-without-ldap/receipt	Thu Apr 02 12:22:43 2020 +0200
     5.3 @@ -6,11 +6,11 @@
     5.4  SHORT_DESC="Cyrus Simple Authentication Service Layer (SASL) library."
     5.5  MAINTAINER="pascal.bellard@slitaz.org"
     5.6  LICENSE="BSD"
     5.7 -WEB_SITE="https://cyrusimap.org/sasl/"
     5.8 +WEB_SITE="https://www.cyrusimap.org/sasl/"
     5.9  
    5.10  SOURCE="cyrus-sasl"
    5.11  TARBALL="$SOURCE-$VERSION.tar.gz"
    5.12 -WGET_URL="http://cyrusimap.org/releases/$TARBALL"
    5.13 +WGET_URL="https://www.cyrusimap.org/releases/$TARBALL"
    5.14  
    5.15  DEPENDS="db openssl"
    5.16  BUILD_DEPENDS="db-dev openssl-dev"
     6.1 --- a/libsasl/receipt	Thu Apr 02 09:19:42 2020 +0100
     6.2 +++ b/libsasl/receipt	Thu Apr 02 12:22:43 2020 +0200
     6.3 @@ -6,7 +6,7 @@
     6.4  SHORT_DESC="SASL library."
     6.5  MAINTAINER="pascal.bellard@slitaz.org"
     6.6  LICENSE="BSD"
     6.7 -WEB_SITE="https://cyrusimap.org/sasl"
     6.8 +WEB_SITE="https://www.cyrusimap.org/sasl"
     6.9  
    6.10  WANTED="cyrus-sasl"
    6.11  
     7.1 --- a/linux-zram/receipt	Thu Apr 02 09:19:42 2020 +0100
     7.2 +++ b/linux-zram/receipt	Thu Apr 02 12:22:43 2020 +0200
     7.3 @@ -33,15 +33,10 @@
     7.4  # Post install/remove commands for Tazpkg.
     7.5  post_install()
     7.6  {
     7.7 -	chroot "$root/" depmod -a $VERSION-slitaz &&
     7.8 -	RAM=`cat /proc/meminfo | grep MemTotal | sed s/[^0-9]//g` &&
     7.9 -	echo "SIZE_KB="$(($RAM/2)) > /etc/compcache.conf
    7.10 -	cat <<EOT
    7.11 -
    7.12 -You can add compressed swap according /etc/compcache.conf configuration with:
    7.13 -# /etc/init.d/compcache start
    7.14 -Or add compcache in the RUN_DAEMONS list of /etc/rcS.conf.
    7.15 -EOT
    7.16 +	chroot "$root/" depmod -a $VERSION-slitaz
    7.17 +	grep ^RUN_DAEMONS "$1/etc/rcS.conf" | grep -q "compcache" || sed -i \
    7.18 +	  's/RUN_DAEMONS="/RUN_DAEMONS="compcache /' "$1/etc/rcS.conf"
    7.19 +	[ -z "$1" ] && /etc/init.d/compcache start
    7.20  }
    7.21  
    7.22  post_remove()
     8.1 --- a/linux-zram/stuff/compcache	Thu Apr 02 09:19:42 2020 +0100
     8.2 +++ b/linux-zram/stuff/compcache	Thu Apr 02 12:22:43 2020 +0200
     8.3 @@ -16,13 +16,17 @@
     8.4        _ '%s is already running.' $NAME
     8.5        exit 1
     8.6      fi
     8.7 +    if [ -z "$SIZE" -o "$SIZE" = "0%" ]; then
     8.8 +      _ '%s disabled in %s.' $NAME '/etc/compcache.conf'
     8.9 +      exit 1
    8.10 +    fi
    8.11      action 'Loading module...'
    8.12      devices=$(awk '/cpu cores/{c=$4} /processor/{p++}
    8.13  	END { if (c>0) p=c; if (p==0) p++; print p }' /proc/cpuinfo)
    8.14      modprobe zram num_devices=$devices &&
    8.15 -    [ -n "$SIZE_KB" ] && for i in $(seq 0 $(($devices-1))); do
    8.16 -	awk "END { print $SIZE_KB * 1024 / $devices }" < /dev/null \
    8.17 -		> /sys/block/zram$i/disksize
    8.18 +    for i in $(seq 0 $(($devices-1))); do
    8.19 +	awk "/MemTotal/ { print \$2 * 1024 * ${SIZE%\%} * / 100 / $devices }" \
    8.20 +		< /proc/meminfo > /sys/block/zram$i/disksize
    8.21      done
    8.22      status
    8.23  
     9.1 --- a/linux-zram/stuff/compcache.conf	Thu Apr 02 09:19:42 2020 +0100
     9.2 +++ b/linux-zram/stuff/compcache.conf	Thu Apr 02 12:22:43 2020 +0200
     9.3 @@ -1,1 +1,1 @@
     9.4 -SIZE_KB=20480
     9.5 +SIZE=50%
    10.1 --- a/linux64-zram/receipt	Thu Apr 02 09:19:42 2020 +0100
    10.2 +++ b/linux64-zram/receipt	Thu Apr 02 12:22:43 2020 +0200
    10.3 @@ -21,8 +21,7 @@
    10.4  	install=$install/linux64
    10.5  	path=lib/modules/$VERSION-slitaz64/kernel
    10.6  	mkdir -p $fs/$path $fs/etc/init.d
    10.7 -	export src
    10.8 -	export install
    10.9 +	export src install
   10.10  	$wanted_stuff/list_modules.sh drivers/block/zram | \
   10.11  	while read module; do
   10.12  		dir=$path/$(dirname $module)
   10.13 @@ -37,12 +36,9 @@
   10.14  post_install()
   10.15  {
   10.16  	chroot "$root/" depmod -a $VERSION-slitaz64
   10.17 -	cat <<EOT
   10.18 -
   10.19 -You can add compressed swap according /etc/compcache.conf configuration with:
   10.20 -# /etc/init.d/compcache start
   10.21 -Or add compcache in the RUN_DAEMONS list of /etc/rcS.conf.
   10.22 -EOT
   10.23 +	grep ^RUN_DAEMONS "$1/etc/rcS.conf" | grep -q "compcache" || sed -i \
   10.24 +	  's/RUN_DAEMONS="/RUN_DAEMONS="compcache /' "$1/etc/rcS.conf"
   10.25 +	[ -z "$1" ] && /etc/init.d/compcache start
   10.26  }
   10.27  
   10.28  post_remove()
    11.1 --- a/linux64-zram/stuff/compcache	Thu Apr 02 09:19:42 2020 +0100
    11.2 +++ b/linux64-zram/stuff/compcache	Thu Apr 02 12:22:43 2020 +0200
    11.3 @@ -16,13 +16,17 @@
    11.4        _ '%s is already running.' $NAME
    11.5        exit 1
    11.6      fi
    11.7 +    if [ -z "$SIZE" -o "$SIZE" = "0%" ]; then
    11.8 +      _ '%s disabled in %s.' $NAME '/etc/compcache.conf'
    11.9 +      exit 1
   11.10 +    fi
   11.11      action 'Loading module...'
   11.12      devices=$(awk '/cpu cores/{c=$4} /processor/{p++}
   11.13  	END { if (c>0) p=c; if (p==0) p++; print p }' /proc/cpuinfo)
   11.14      modprobe zram num_devices=$devices &&
   11.15 -    [ -n "$SIZE_KB" ] && for i in $(seq 0 $(($devices-1))); do
   11.16 -	awk "END { print $SIZE_KB * 1024 / $devices }" < /dev/null \
   11.17 -		> /sys/block/zram$i/disksize
   11.18 +    for i in $(seq 0 $(($devices-1))); do
   11.19 +	awk "/MemTotal/ { print \$2 * 1024 * ${SIZE%\%} * / 100 / $devices }" \
   11.20 +		< /proc/meminfo > /sys/block/zram$i/disksize
   11.21      done
   11.22      status
   11.23  
    12.1 --- a/linux64-zram/stuff/compcache.conf	Thu Apr 02 09:19:42 2020 +0100
    12.2 +++ b/linux64-zram/stuff/compcache.conf	Thu Apr 02 12:22:43 2020 +0200
    12.3 @@ -1,1 +1,1 @@
    12.4 -SIZE_KB=20480
    12.5 +SIZE=50%