aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Arnold <stephen.arnold42@gmail.com>2016-07-15 16:19:44 -0700
committerSteve Arnold <stephen.arnold42@gmail.com>2016-07-15 16:20:01 -0700
commita3ba558d54ac60d993fe83815c96bea5cb13b74e (patch)
tree8329f453295b97e0e53fb364d0bd39d8f0277532 /sys-block
parentdrm-raspberrypi-sources: update to current default rpi-4.2.y branch (diff)
downloadarm-a3ba558d54ac60d993fe83815c96bea5cb13b74e.tar.gz
arm-a3ba558d54ac60d993fe83815c96bea5cb13b74e.tar.bz2
arm-a3ba558d54ac60d993fe83815c96bea5cb13b74e.zip
sys-block/zram-init: moved older version from dev overlay, useful for
older kernels
Diffstat (limited to 'sys-block')
-rw-r--r--sys-block/zram-init/Manifest1
-rw-r--r--sys-block/zram-init/files/zram-init-bin.patch36
-rw-r--r--sys-block/zram-init/zram-init-2.2.ebuild39
3 files changed, 76 insertions, 0 deletions
diff --git a/sys-block/zram-init/Manifest b/sys-block/zram-init/Manifest
new file mode 100644
index 0000000..b0b9150
--- /dev/null
+++ b/sys-block/zram-init/Manifest
@@ -0,0 +1 @@
+DIST zram-init-2.2.tar.gz 2866 SHA256 6d23f408939ec0a9db79254cce196d75f09c4b0cf0843c9eeb90deb153f13653 SHA512 f0eeaaaadde2481409db70fc91fd64155b3cc344a967ccdb4822d65989306599fe6afdea8ab2bd00d23b215a43d654c9d1bfda6b26491ad2d27b6c1093ca8e82 WHIRLPOOL 34e79e8d3f536e174689bc215a193757120880588d2751ab0c30495f7a614f0bd496e5110ce11c7be50bd19d950c242a95a478348cddcc446b879e754e75fd42
diff --git a/sys-block/zram-init/files/zram-init-bin.patch b/sys-block/zram-init/files/zram-init-bin.patch
new file mode 100644
index 0000000..c8fcb43
--- /dev/null
+++ b/sys-block/zram-init/files/zram-init-bin.patch
@@ -0,0 +1,36 @@
+--- /usr/sbin/zram-init.orig 2013-07-20 11:26:17.760879640 -0700
++++ /usr/sbin/zram-init 2013-07-20 13:36:34.275883367 -0700
+@@ -1,4 +1,4 @@
+-#! /bin/sh
++#! /bin/bash
+ # (C) Martin V\"ath <vaeth@mathematik.uni-wuerzburg.de>"
+
+ Echo() {
+@@ -69,8 +69,14 @@
+ if [ ${#} -eq 1 ]
+ then mkswap "${devnode}" >/dev/null || Fatal "mkswap ${devnode} failed"
+ if [ "${prio}" = '-' ]
+- then swapon -- "${devnode}"
+- else swapon -p "${prio}" -- "${devnode}"
++ then
++ sleep 1
++ echo "Running: swapon -- ${devnode} ..."
++ swapon -- "${devnode}"
++ else
++ sleep 1
++ echo "Running: swapon -p ${prio} -- ${devnode} ..."
++ swapon -p "${prio}" -- "${devnode}"
+ fi || Fatal "swapon failed"
+ exit 0
+ fi
+@@ -93,3 +99,10 @@
+ Fatal "unsupported filesystem ${fstype}"
+ ;;
+ esac
++
++TEMP=$(echo -n "${2}" | grep -z tmp)
++#echo $TEMP
++if [ -n "$TEMP" ] ; then
++ chmod 1777 ${2}
++fi
++
diff --git a/sys-block/zram-init/zram-init-2.2.ebuild b/sys-block/zram-init/zram-init-2.2.ebuild
new file mode 100644
index 0000000..ac1a3c8
--- /dev/null
+++ b/sys-block/zram-init/zram-init-2.2.ebuild
@@ -0,0 +1,39 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI=5
+RESTRICT="mirror"
+inherit eutils vcs-snapshot
+
+DESCRIPTION="Scripts to support compressed swap devices or ramdisks with zram"
+HOMEPAGE="https://github.com/vaeth/zram-init/"
+SRC_URI="http://github.com/vaeth/${PN}/tarball/release-${PV} -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~mips ~ppc ~ppc64 ~x86"
+IUSE="zsh-completion"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-bin.patch
+ epatch_user
+}
+
+src_install() {
+ dosbin sbin/*
+ doinitd openrc/init.d/*
+ doconfd openrc/conf.d/*
+ if use zsh-completion
+ then insinto /usr/share/zsh/site-functions
+ doins zsh/*
+ 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
+}
+