diff options
author | Fyodor Doletov | 2021-11-15 20:10:50 +0300 |
---|---|---|
committer | Fyodor Doletov | 2021-11-15 20:11:48 +0300 |
commit | 0b182787a5f0b71fc0163c161fea31933e758f77 (patch) | |
tree | 78441f925ff0b3ae0316294cd960a1b1fe1f3927 | |
download | aur-0b182787a5f0b71fc0163c161fea31933e758f77.tar.gz |
init
-rw-r--r-- | .SRCINFO | 23 | ||||
-rw-r--r-- | PKGBUILD | 28 | ||||
-rw-r--r-- | dependencies | 2 | ||||
-rwxr-xr-x | down | 5 | ||||
-rw-r--r-- | type | 1 | ||||
-rwxr-xr-x | up | 13 | ||||
-rw-r--r-- | zram.conf | 2 |
7 files changed, 74 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..fdd715768931 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,23 @@ +pkgbase = zram-s6 + pkgdesc = Activate zram using openrc + pkgver = 1.0 + pkgrel = 1 + url = https://aur.archlinux.org/zram-s6 + arch = any + groups = s6-galaxy + license = GPL2 + depends = s6-base + provides = init-zram + conflicts = init-zram + source = up + source = down + source = type + source = zram.conf + source = dependencies + md5sums = 68efba65bf6726047ce6387e3a20d863 + md5sums = 99b762d9f10dba97223c614698c7a362 + md5sums = 85bceea1fb94d4166f24496dc40a35e6 + md5sums = 89743c52e3b1960cba82d822d742dfcd + md5sums = 061880f66eb1b0e2fda2bb6788385640 + +pkgname = zram-s6 diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..159234971d02 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,28 @@ +# Maintainer: Senderman <doletov.fyodor@yandex.ru> + +pkgname=zram-s6 +pkgdesc="Activate zram using openrc" +pkgver=1.0 +pkgrel=1 +arch=('any') +groups=('s6-galaxy') +provides=('init-zram') +conflicts=('init-zram') +url="https://aur.archlinux.org/$pkgname" +depends=('s6-base') +license=('GPL2') +source=('up' 'down' 'type' 'zram.conf' 'dependencies') +md5sums=('68efba65bf6726047ce6387e3a20d863' + '99b762d9f10dba97223c614698c7a362' + '85bceea1fb94d4166f24496dc40a35e6' + '89743c52e3b1960cba82d822d742dfcd' + '061880f66eb1b0e2fda2bb6788385640') + + +package() { + install -Dm0755 $srcdir/up $pkgdir/etc/s6/sv/zram/up + install -Dm0755 $srcdir/down $pkgdir/etc/s6/sv/zram/down + install -Dm0644 $srcdir/dependencies $pkgdir/etc/s6/sv/zram/dependencies + install -Dm0644 $srcdir/type $pkgdir/etc/s6/sv/zram/type + install -Dm0644 $srcdir/zram.conf $pkgdir/etc/s6/config/zram.conf +} diff --git a/dependencies b/dependencies new file mode 100644 index 000000000000..5e1b6b3a9b0f --- /dev/null +++ b/dependencies @@ -0,0 +1,2 @@ +mount-sysfs +mount-devfs @@ -0,0 +1,5 @@ +#!/usr/bin/execlineb -P + +fdmove -c 2 1 +foreground { swapoff /dev/zram0 } +rmmod zram @@ -0,0 +1 @@ +oneshot @@ -0,0 +1,13 @@ +#!/usr/bin/execlineb -P +# Copyright 2021 Doletov Fyodor + +fdmove -c 2 1 +envfile /etc/s6/config/zram.conf +importas comp_algorithm COMP_ALGORITHM +importas zram_size ZRAM_SIZE + +foreground { modprobe zram } +foreground { redirfd -w 1 /sys/block/zram0/comp_algorithm echo $comp_algorithm } +foreground { redirfd -w 1 /sys/block/zram0/disksize echo $zram_size } +foreground { mkswap --label zram0 /dev/zram0 } +swapon --priority 100 /dev/zram0 diff --git a/zram.conf b/zram.conf new file mode 100644 index 000000000000..5005b6ff464d --- /dev/null +++ b/zram.conf @@ -0,0 +1,2 @@ +ZRAM_SIZE="4G" +COMP_ALGORITHM="lzo-rle" |