aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-extended/zram
diff options
context:
space:
mode:
authorMartin Jansa <Martin.Jansa@gmail.com>2013-04-13 14:50:30 +0200
committerMartin Jansa <Martin.Jansa@gmail.com>2013-04-15 16:22:05 +0200
commita61c15efe444c8917da50264817b44cdcb775fc9 (patch)
tree816aef1c3c69b17f7e6740f20c6cf5195236e0b4 /meta-oe/recipes-extended/zram
parentfe76f1ab77c118e077d2c98f405b6b78ad35a124 (diff)
downloadmeta-openembedded-contrib-a61c15efe444c8917da50264817b44cdcb775fc9.tar.gz
zram: move systemd support from meta-systemd back to meta-oe
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'meta-oe/recipes-extended/zram')
-rw-r--r--meta-oe/recipes-extended/zram/zram/zram.service12
-rw-r--r--meta-oe/recipes-extended/zram/zram_0.1.bb13
2 files changed, 23 insertions, 2 deletions
diff --git a/meta-oe/recipes-extended/zram/zram/zram.service b/meta-oe/recipes-extended/zram/zram/zram.service
new file mode 100644
index 0000000000..4a19367d93
--- /dev/null
+++ b/meta-oe/recipes-extended/zram/zram/zram.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Enable zram compressed in-memory swap.
+After=multi-user.target
+
+[Service]
+RemainAfterExit=yes
+ExecStart=/usr/bin/zram-load.sh --load
+ExecStop=/usr/bin/zram-load.sh --unload
+Type=oneshot
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-oe/recipes-extended/zram/zram_0.1.bb b/meta-oe/recipes-extended/zram/zram_0.1.bb
index 85262647c0..115e6437fd 100644
--- a/meta-oe/recipes-extended/zram/zram_0.1.bb
+++ b/meta-oe/recipes-extended/zram/zram_0.1.bb
@@ -2,22 +2,31 @@ DESCRIPTION = "Linux zram compressed in-memory swap"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58"
-inherit allarch update-rc.d
+inherit allarch update-rc.d systemd
RDEPENDS_${PN} = "util-linux-swaponoff kmod kernel-module-zram"
-PR = "r0"
+PR = "r3"
SRC_URI = " \
file://init \
+ file://zram.service \
"
do_install () {
# Sysvinit
install -d ${D}${sysconfdir}/init.d
install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/zram
+
+ install -d ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/zram.service ${D}${systemd_unitdir}/system
}
FILES_${PN} = "${sysconfdir}/init.d"
INITSCRIPT_NAME = "zram"
INITSCRIPT_PARAMS = "start 05 2 3 4 5 . stop 22 0 1 6 ."
+
+RPROVIDES_${PN} += "${PN}-systemd"
+RREPLACES_${PN} += "${PN}-systemd"
+RCONFLICTS_${PN} += "${PN}-systemd"
+SYSTEMD_SERVICE_${PN} = "zram.service"