diff options
Diffstat (limited to 'sys-block')
-rw-r--r-- | sys-block/zram-init/ChangeLog | 17 | ||||
-rw-r--r-- | sys-block/zram-init/Manifest | 7 | ||||
-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/zram-init-1.ebuild | 28 | ||||
-rw-r--r-- | sys-block/zram-init/zram-init-2.ebuild | 32 |
6 files changed, 37 insertions, 176 deletions
diff --git a/sys-block/zram-init/ChangeLog b/sys-block/zram-init/ChangeLog index 86387279..6aac1d68 100644 --- a/sys-block/zram-init/ChangeLog +++ b/sys-block/zram-init/ChangeLog @@ -2,18 +2,5 @@ # 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. - - 21 Nov 2010; Martin Väth <martin@mvath.de> - Modify init.d files for kernel 2.6.36. Bump revision to force upgrade. - - 10 Oct 2010; Martin Väth <martin@mvath.de> - Bump to 0.6.2. Add init.d/conf.d files. - - 04 Jan 2010; Russell Harmon (eatnumber1) <russ@eatnumber1.com> - New ebuild for bug 299664. Thanks to Russell Harmon + 08 Feb 2010; Martin Väth <martin@mvath.de> + Complete rewrite. Remove old ChangeLog. diff --git a/sys-block/zram-init/Manifest b/sys-block/zram-init/Manifest index e759061e..3076e0a7 100644 --- a/sys-block/zram-init/Manifest +++ b/sys-block/zram-init/Manifest @@ -1,5 +1,4 @@ -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 +DIST zram-init-2.tar.gz 2264 RMD160 eb03b71aebaec8c251cab6fb79ebd771cae57a81 SHA1 396527e0278d344a0171e34b745edafeca51bd10 SHA256 d3d42cf0de1b01898aea480545b5612f1bc4ab6ab89bb8737fa45983c17a634c +EBUILD zram-init-2.ebuild 798 RMD160 21682903c80c950162ab79e76519df26600d4c4a SHA1 0e058ac84715cfe280ae0ec1d8e0a966002fc01c SHA256 1a8620aced51bde489e8625210d21781f0b65de3f74645937a99a66fb3028a52 +MISC ChangeLog 225 RMD160 2ef07bf518587c10036fcd3e40c033d27a36eeaf SHA1 473917ec9c4f2db3fb6b7a4d8f0552b7af0800a9 SHA256 e6c957ef69cf3f4fe2ebd0c5558c6822f1f53d5ba5b9eb236108da896cdd5f13 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 deleted file mode 100644 index 022a0d86..00000000 --- a/sys-block/zram-init/files/zram.confd +++ /dev/null @@ -1,36 +0,0 @@ -# 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 deleted file mode 100755 index c8ced12b..00000000 --- a/sys-block/zram-init/files/zram.initd +++ /dev/null @@ -1,93 +0,0 @@ -#!/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/zram-init/zram-init-1.ebuild b/sys-block/zram-init/zram-init-1.ebuild deleted file mode 100644 index f4e3982b..00000000 --- a/sys-block/zram-init/zram-init-1.ebuild +++ /dev/null @@ -1,28 +0,0 @@ -# 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 -} diff --git a/sys-block/zram-init/zram-init-2.ebuild b/sys-block/zram-init/zram-init-2.ebuild new file mode 100644 index 00000000..0441950e --- /dev/null +++ b/sys-block/zram-init/zram-init-2.ebuild @@ -0,0 +1,32 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header $ + +EAPI="4" +RESTRICT="mirror" + +DESCRIPTION="Scripts to support compressed swap devices or ramdisks with zram" +HOMEPAGE="http://www.mathematik.uni-wuerzburg.de/~vaeth/download/index.html" +SRC_URI="http://www.mathematik.uni-wuerzburg.de/~vaeth/download/${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="zsh-completion" + +src_install() { + dosbin zram-init + newinitd zram-init.initd zram-init + newconfd zram-init.confd zram-init + if use zsh-completion + then insinto /usr/share/zsh/site-functions + doins _zram-init + fi +} + +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 +} |