zram-init: Add recipe 03/20303/2
authorFabio Berton <fabio.berton@ossystems.com.br>
Fri, 22 Jun 2018 18:54:48 +0000 (15:54 -0300)
committerFabio Berton <fabio.berton@ossystems.com.br>
Fri, 22 Jun 2018 19:33:11 +0000 (19:33 +0000)
Change-Id: I5a5e477ee8ec456584cc81f55af0860ca3a60b70
Signed-off-by: Fabio Berton <fabio.berton@ossystems.com.br>
recipes-extended/zram-init/zram-init_git.bb [new file with mode: 0644]

diff --git a/recipes-extended/zram-init/zram-init_git.bb b/recipes-extended/zram-init/zram-init_git.bb
new file mode 100644 (file)
index 0000000..fa52247
--- /dev/null
@@ -0,0 +1,35 @@
+SUMMARY = "A wrapper script for the zram kernel module with interactive and init support"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://${S}/README.md;beginline=5;endline=7;md5=1c6f4971407e5a5b1aa502b9badcdf98"
+
+inherit update-rc.d systemd
+
+SRC_URI = "git://github.com/vaeth/zram-init;protocol=https"
+SRCREV = "7b0b68d889d9a6ddfc7861731fb1d62c6838dd5c"
+
+S = "${WORKDIR}/git"
+
+INITSCRIPT_NAME = "${PN}"
+INITSCRIPT_PARAMS = "defaults"
+
+SYSTEMD_SERVICE_${PN} = " \
+    zram_swap.service \
+    zram_tmp.service \
+"
+
+do_install () {
+    install -Dm 0755 ${S}/sbin/${PN}  ${D}${base_sbindir}/${PN}
+    install -Dm 0644 ${S}/modprobe.d/zram.conf ${D}${sysconfdir}/modprobe.d/zram.conf
+
+    if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
+        install -Dm 0644 ${S}/systemd/system/zram_swap.service ${D}${systemd_unitdir}/system/zram_swap.service
+        install -Dm 0644 ${S}/systemd/system/zram_tmp.service ${D}${systemd_unitdir}/system/zram_tmp.service
+    fi
+    if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then
+        install -Dm 0755 ${S}/openrc/init.d/${PN} ${D}/${sysconfdir}/init.d/${PN}
+        install -Dm 0644 ${S}/openrc/conf.d/${PN} ${D}${sysconfdir}/openrc/conf.d/${PN}
+    fi
+}
+
+RDEPENDS_${PN} = "e2fsprogs-tune2fs"
+RRECOMMENDS_${PN} = "kernel-module-zram"