diff options
author | Martin Väth <martin@mvath.de> | 2011-02-07 21:07:49 +0100 |
---|---|---|
committer | Martin Väth <martin@mvath.de> | 2015-10-11 10:46:28 +0200 |
commit | 06afbefa6880bb1b32cbb7b6301ed276e726cc46 (patch) | |
tree | 3e90bd53d4aa3c2d275d800d2e0241a590373a11 /sys-block | |
parent | Bump stylish. Fix some ChangeLogs (diff) | |
download | mv-06afbefa6880bb1b32cbb7b6301ed276e726cc46.tar.gz mv-06afbefa6880bb1b32cbb7b6301ed276e726cc46.tar.bz2 mv-06afbefa6880bb1b32cbb7b6301ed276e726cc46.zip |
compcache-tools -> zram-init
Diffstat (limited to 'sys-block')
-rw-r--r-- | sys-block/compcache-tools/Manifest | 7 | ||||
-rw-r--r-- | sys-block/compcache-tools/compcache-tools-0.6.2-r1.ebuild | 42 | ||||
-rw-r--r-- | sys-block/compcache-tools/files/compcache-tools-cc.patch | 9 | ||||
-rw-r--r-- | sys-block/compcache-tools/files/compcache.confd | 26 | ||||
-rw-r--r-- | sys-block/compcache-tools/files/compcache.initd | 105 | ||||
-rw-r--r-- | sys-block/zram-init/ChangeLog (renamed from sys-block/compcache-tools/ChangeLog) | 6 | ||||
-rw-r--r-- | sys-block/zram-init/Manifest | 5 | ||||
-rw-r--r-- | sys-block/zram-init/files/zram.confd | 36 | ||||
-rwxr-xr-x | sys-block/zram-init/files/zram.initd | 93 | ||||
-rw-r--r-- | sys-block/zram-init/metadata.xml (renamed from sys-block/compcache-tools/metadata.xml) | 0 | ||||
-rw-r--r-- | sys-block/zram-init/zram-init-1.ebuild | 28 |
11 files changed, 167 insertions, 190 deletions
diff --git a/sys-block/compcache-tools/Manifest b/sys-block/compcache-tools/Manifest deleted file mode 100644 index 343c8645..00000000 --- a/sys-block/compcache-tools/Manifest +++ /dev/null @@ -1,7 +0,0 @@ -AUX compcache-tools-cc.patch 327 RMD160 c802f33b2baa54e7428c9ace8f103c23e4d7b0eb SHA1 01e05e6b25b6f79d2b413f3988f0ac2d3c0a1f55 SHA256 fb9b768d386b5b2fed3ad0efa92542f6bb717de9cfcb08e53a847ecba05a8887 -AUX compcache.confd 806 RMD160 62cda7d7922a3bce9d16e71c9d4de46470ce7da8 SHA1 5f8684b242e80e75255869d6caae1cfb3e9dfe65 SHA256 cedb1a7ed1a5c58f149746cd8b80b2800795b1d304a0b4088d561e5a52072abb -AUX compcache.initd 1764 RMD160 4094bd21c4f5bafdcb226ae007bdacf134547e9d SHA1 f58c45179e31914def94951311bdbb4eb84aa806 SHA256 67c3bc840d04556a59effd9e58c8a8ebd9015f3d6e4e72a34bf60dc312c45ebf -DIST compcache-0.6.2.tar.gz 26618 RMD160 495f1fcd76f9585192327d33ab2f6f667b611c6c SHA1 d2844aff60517c93477031df0705553f1ee7e743 SHA256 969e39aa08c3c65fe104777156caef3e9c58fc87720d45801a6dce04745abac3 -EBUILD compcache-tools-0.6.2-r1.ebuild 928 RMD160 5173af832012743218d7aef0c22728c52e25d58a SHA1 ff8579e88eebe5e89dafa35e2a55f7a875135ace SHA256 7f3495c4f1703b40e299784cdc35951c671bacc14dfa4864a80c57214502f7b0 -MISC ChangeLog 572 RMD160 c96e82bb659c86c791849f364863b4886565e19c SHA1 aa46223ab61a90d0c2fec8e7a070a3de7535b43a SHA256 eb667c418435c5ceb0ded602d01bb3847bae4b9af9cf8b0a6bdd57a3889cdb8f -MISC metadata.xml 170 RMD160 645927a396fdc21cdeb089fe42c5397332420ea6 SHA1 ac7f48a14fec325926f9ce1be8fbf1f311b4f2e4 SHA256 d797a2ec6f9dc516c9f9c1a758ee87ad3e8c43101b5dc76c2f872d5bd4639b42 diff --git a/sys-block/compcache-tools/compcache-tools-0.6.2-r1.ebuild b/sys-block/compcache-tools/compcache-tools-0.6.2-r1.ebuild deleted file mode 100644 index 3ced0480..00000000 --- a/sys-block/compcache-tools/compcache-tools-0.6.2-r1.ebuild +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright 1999-2011 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header $ - -EAPI="4" -RESTRICT="mirror" -inherit eutils toolchain-funcs - -MY_P="${P/-tools/}" -DESCRIPTION="Compressed in-memory swap device for Linux" -HOMEPAGE="http://code.google.com/p/compcache/" -SRC_URI="http://compcache.googlecode.com/files/${MY_P}.tar.gz" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~amd64 ~x86" -IUSE="" - -S="${WORKDIR}/${MY_P}/sub-projects/rzscontrol" - -src_prepare() { - epatch "${FILESDIR}/${PN}-cc.patch" -} - -src_compile() { - tc-export CC - default -} - -src_install() { - dobin rzscontrol || die - doman man/rzscontrol.1 || die - newinitd "${FILESDIR}/compcache.initd" compcache - newconfd "${FILESDIR}/compcache.confd" compcache -} - -pkg_postinst() { - elog - elog "To use compcache, add ramzswap support to your kernel and add compcache" - elog "to your default runlevel (\"rc-config add compcache default\")." - elog -} diff --git a/sys-block/compcache-tools/files/compcache-tools-cc.patch b/sys-block/compcache-tools/files/compcache-tools-cc.patch deleted file mode 100644 index a79a1bde..00000000 --- a/sys-block/compcache-tools/files/compcache-tools-cc.patch +++ /dev/null @@ -1,9 +0,0 @@ ---- sub-projects/rzscontrol/Makefile -+++ sub-projects/rzscontrol/Makefile -@@ -1,5 +1,5 @@ - all: -- @gcc -g -Wall -D_GNU_SOURCE rzscontrol.c -o rzscontrol -I ../include -I../.. -+ $(CC) $(CFLAGS) -Wall -D_GNU_SOURCE rzscontrol.c -o rzscontrol -I ../include -I../.. $(LDFLAGS) - - doc: - @xmllint --noout --valid man/rzscontrol.xml diff --git a/sys-block/compcache-tools/files/compcache.confd b/sys-block/compcache-tools/files/compcache.confd deleted file mode 100644 index 5ab6ebd8..00000000 --- a/sys-block/compcache-tools/files/compcache.confd +++ /dev/null @@ -1,26 +0,0 @@ -# compcache/ramzswap settings... - -# load ramzswap kernel module on start? -LOAD_ON_START="yes" - -# unload ramzswap kernel module on stop? -UNLOAD_ON_STOP="yes" - -# number of devices -NUM_DEVICES="1" - -# for each /dev/ramzswapN, specify these arguments for rszcontrol -# `man rzscontrol` for more informations. -# The variable is eval'ed; you can use \${FSTAB_SWAP_0} ... \${FSTAB_SWAP_n} -# to get the device names of the swap devices of fstab (mount point = "swap"). -#RAMZSWAP_OPTS_0="--backing_swap=/path/to/swap.dev --memlimit_kb=10240" -#RAMZSWAP_OPTS_1="--disksize_kb=20480" -RAMZSWAP_OPTS_0="" -RAMZSWAP_OPTS_1="--backing_swap=\"\${FSTAB_SWAP_0}\"" - -# Options passed to swapon (this is eval'ed) -SWAPON_OPTS_0="-p 1" -SWAPON_OPTS_1="-p 0" - -# Disable fstab swaps while compcache is running? -DISABLE_FSTAB_SWAP="no" diff --git a/sys-block/compcache-tools/files/compcache.initd b/sys-block/compcache-tools/files/compcache.initd deleted file mode 100644 index 0a77b2cc..00000000 --- a/sys-block/compcache-tools/files/compcache.initd +++ /dev/null @@ -1,105 +0,0 @@ -#!/sbin/runscript - -opts="start stop info reload" - -depend() { - need localmount swap - after bootmisc modules -} - -RamzswapDefaults() { - : ${NUM_DEVICES:=1} -} - -RamzswapEnableOpts() { - einfo "Enabling swap ${1}..." - eval "rzscontrol \"\${1}\" ${2} --init && swapon ${3} -- \"${1}\"" - eend ${?} -} - -RamzswapEnable() { - eval 'RamzswapEnableOpts "/dev/zram${1}" \ -"${RAMZSWAP_OPTS_'${1}'}" "${SWAPON_OPTS_'${1}'}"' -} - -RamzswapDisable() { - einfo "Disabling swap /dev/zram${1}..." - swapoff "/dev/zram${1}" && rzscontrol "/dev/zram${1}" --reset - eend ${?} -} - -RamzswapParseFstab() { - i=0 - for a in `sed -ne \ - 's/^\(\/[^[:space:]]*\)[[:space:]]*swap[[:space:]].*/\1/p' /etc/fstab` - do eval 'FSTAB_SWAP_'${i}'="${a}"' - i=$(( ${i} + 1 )) - done -} - -start() { - RamzswapDefaults - if [ "${LOAD_ON_START}" = "yes" ] - then einfo "Loading zram module..." - modprobe zram num_devices=${NUM_DEVICES} - eend ${?} - fi - - if [ "${DISABLE_FSTAB_SWAP}" = "yes" ] - then einfo "Disabling fstab swap" - swapoff -a - eend ${?} - fi - - RamzswapParseFstab - i=0 - while [ ${i} -lt "${NUM_DEVICES}" ] - do RamzswapEnable ${i} - i=$(( ${i} + 1 )) - done - : -} - -stop() { - RamzswapDefaults - i=0 - while [ ${i} -lt "${NUM_DEVICES}" ] - do RamzswapDisable ${i} - i=$(( ${i} + 1 )) - done - - if [ "${UNLOAD_ON_STOP}" = "yes" ] - then einfo "Unloading zram module..." - modprobe -r zram - eend ${?} - fi - - if [ "${DISABLE_FSTAB_SWAP}" = "yes" ] - then einfo "Enabling fstab swap" - swapon -a - eend ${?} - fi - : -} - -info() { - RamzswapDefaults - i=0 - while [ ${i} -lt "${NUM_DEVICES}" ] - do rzscontrol "/dev/zram${i}" --stats - i=$(( ${i} + 1 )) - done - : -} - -reload() { - RamzswapDefaults - RamzswapParseFstab - i=0 - while [ ${i} -lt "${NUM_DEVICES}" ] - do RamzswapDisable ${i} - RamzswapEnable ${i} - i=$(( ${i} + 1 )) - done - : -} diff --git a/sys-block/compcache-tools/ChangeLog b/sys-block/zram-init/ChangeLog index 7998cabd..86387279 100644 --- a/sys-block/compcache-tools/ChangeLog +++ b/sys-block/zram-init/ChangeLog @@ -1,7 +1,11 @@ -# ChangeLog for sys-block/compcache-tools +# ChangeLog for sys-block/zram-init # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 # $Header $ + 07 Feb 2010; Martin Väth <martin@mvath.de> + Only install init-files which work with kernels >=2.6.37 + Since compcache-tools is no longer installed, the package is renamed + 03 Jan 2011; Martin Väth <martin@mvath.de> Bump to EAPI=4. diff --git a/sys-block/zram-init/Manifest b/sys-block/zram-init/Manifest new file mode 100644 index 00000000..e759061e --- /dev/null +++ b/sys-block/zram-init/Manifest @@ -0,0 +1,5 @@ +AUX zram.confd 1014 RMD160 671f7e84e2dbb1bf0c1d49aff882fbfc8505da48 SHA1 f4105bfa3c8b6fb22fe79851fb2479ca280e1e45 SHA256 600623b9786dc6b90c60f6af5cded7f930578a5165b7ecb64306317835bf2230 +AUX zram.initd 1821 RMD160 90cbca277c24dd205028321d567d165adaa4feaa SHA1 db8b3b4b16e17a20185c5dfdb89bc4eb2a3bf07c SHA256 3c07f43381cf3071544a2322185f3d03a6610ba88f486e82f7ba3c388aa194b8 +EBUILD zram-init-1.ebuild 656 RMD160 16854f5bc4eac639c95ce5d0d508bb40f88ce6f3 SHA1 3b70bd24c51e203b40cd74a4dc9c7fab588059f5 SHA256 48ba913ed5325b343ed15293ec501135d628c899c9c904777a40af0f83ec4295 +MISC ChangeLog 761 RMD160 41e0716d112541954c7c562b77e8c924ec611cb3 SHA1 8fa6d890c972867b809076a8a13695c3f3f8a5d0 SHA256 5886c38b08edad52c2bcd4f44b1621ac29eca872c812be89bf8cc2b740699d8b +MISC metadata.xml 170 RMD160 645927a396fdc21cdeb089fe42c5397332420ea6 SHA1 ac7f48a14fec325926f9ce1be8fbf1f311b4f2e4 SHA256 d797a2ec6f9dc516c9f9c1a758ee87ad3e8c43101b5dc76c2f872d5bd4639b42 diff --git a/sys-block/zram-init/files/zram.confd b/sys-block/zram-init/files/zram.confd new file mode 100644 index 00000000..022a0d86 --- /dev/null +++ b/sys-block/zram-init/files/zram.confd @@ -0,0 +1,36 @@ +# zram settings... + +# load zram kernel module on start? +load_on_start="yes" + +# unload zram kernel module on stop? +unload_on_stop="yes" + +# Number of devices. +# It is also passed to the kernel module on modprobe. +num_devices="1" + +# For each device, specify size, type, and flags: +# size0, size1, ... are the variables for the sizes. +# type0, type1, ... are the variables for the types. +# flag0, flag1, ... are the variables for the flags. +# +# The size is in megabytes. +# If the size is 0 (or empty) the device is ignored by the script. +# +# Available types: +# "swap" The device is initialized as a swap device. +# The flags variable specifies the priority (default is 16383) +# "/..." The device is mounted on /... +# The flags variable specifies the type (ext2 or ext4, default is ext4) +# Devices with other types are ignored by the the script +# +# Only variables with numbers 0 ... num_devices-1 are used by the script. + +type0="swap" +flag0="16383" +size0="150" + +type1="/tmp" +flag1="ext4" +size1="500" diff --git a/sys-block/zram-init/files/zram.initd b/sys-block/zram-init/files/zram.initd new file mode 100755 index 00000000..c8ced12b --- /dev/null +++ b/sys-block/zram-init/files/zram.initd @@ -0,0 +1,93 @@ +#!/sbin/runscript + +depend() { + need localmount swap + after bootmisc modules +} + +ZramInit() { + echo "$(( $size * 1024 * 1024 ))" >/sys/block/zram${i}/disksize + if [ "${type}" = swap ] + then einfo "Swap->zram${i}" + mkswap /dev/zram${i} >/dev/null \ + && swapon -p "${flag:-16383}" /dev/zram${i} + else einfo "Mount zram${i} ${type}" + case "${flag:-ext4}" in + ext2) mkfs.ext2 -m0 \ + '-O^huge_file,sparse_super' \ + /dev/zram${i} >/dev/null \ + && tune2fs -c0 -i0 -m0 /dev/zram${i} >/dev/null \ + && mount -t ext2 -- /dev/zram${i} "${type}" + ;; + *) mkfs.ext4 -m0 \ + '-O^huge_file,sparse_super,extent,^uninit_bg,dir_nlink,extra_isize,sparse_super,^has_journal' \ + /dev/zram${i} >/dev/null \ + && tune2fs -c0 -i0 -m0 /dev/zram${i} >/dev/null \ + && mount -t ext4 -- /dev/zram${i} "${type}" + ;; + esac + fi + eend ${?} +} + +ZramStop() { + if [ "${type}" = swap ] + then einfo "Remove zram${i} swap" + swapoff /dev/zram${i} + else einfo "Umount zram${i} ${type}" + umount /dev/zram${i} + fi && echo 1 >/sys/block/zram${i}/reset + eend ${?} +} + +ZramSanityCheck() { + : ${num_devices:=0} + [ "${num_devices}" -gt 0 ] +} + +ZramIgnore() { + eval "type=\"\${type${i}}\" + size=\"\${size${i}:-0}\" + flag=\"\${flag${i}}\"" + case "${type}" in + swap|/*) ! [ "${size}" -gt 0 ];; + esac +} + +start() { + ZramSanityCheck || return 0 + + case "${load_on_start}" in + y*|Y*|t*|T*|1) + einfo "Loading zram module..." + modprobe zram "num_devices=${num_devices}" + eend ${?} + ;; + esac + + i=0 + while [ ${i} -lt "${num_devices}" ] + do ZramIgnore || ZramInit + i=$(( ${i} + 1 )) + done + : +} + +stop() { + ZramSanityCheck || return 0 + + i=0 + while [ ${i} -lt "${num_devices}" ] + do ZramIgnore || ZramStop + i=$(( ${i} + 1 )) + done + + case "${load_on_start}" in + y*|Y*|t*|T*|1) + einfo "Unloading zram module..." + modprobe -r zram + eend ${?} + ;; + esac + : +} diff --git a/sys-block/compcache-tools/metadata.xml b/sys-block/zram-init/metadata.xml index 7e328698..7e328698 100644 --- a/sys-block/compcache-tools/metadata.xml +++ b/sys-block/zram-init/metadata.xml diff --git a/sys-block/zram-init/zram-init-1.ebuild b/sys-block/zram-init/zram-init-1.ebuild new file mode 100644 index 00000000..f4e3982b --- /dev/null +++ b/sys-block/zram-init/zram-init-1.ebuild @@ -0,0 +1,28 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header $ + +EAPI="4" + +DESCRIPTION="Initscript support for compressed ramdisks or swap devices" +HOMEPAGE="http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=drivers/staging/zram/zram.txt;hb=HEAD" +SRC_URI="" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="" + +S="${WORKDIR}" + +src_install() { + newinitd "${FILESDIR}/zram.initd" zram + newconfd "${FILESDIR}/zram.confd" zram +} + +pkg_postinst() { + elog + elog "To use zram, activate it in your kernel and add it to default runlevel:" + elog "rc-config add zram default" + elog +} |