Patchwork [meta-oe,meta-systemd] zram: Add systemd service for zram

login
register
mail settings
Submitter Andrei Gherzan
Date Sept. 18, 2012, 7:35 p.m.
Message ID <1347996924-23109-1-git-send-email-andrei@gherzan.ro>
Download mbox | patch
Permalink /patch/36847/
State Accepted
Commit 72e6ed1469222f88c4cbd0dd378193e46d9fd26e
Headers show

Comments

Andrei Gherzan - Sept. 18, 2012, 7:35 p.m.
Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
---
 .../recipes-extended/zram/zram/zram.service        |   12 ++++++++++++
 .../recipes-extended/zram/zram_0.1.bbappend        |   12 ++++++++++++
 2 files changed, 24 insertions(+)
 create mode 100644 meta-systemd/meta-oe/recipes-extended/zram/zram/zram.service
 create mode 100644 meta-systemd/meta-oe/recipes-extended/zram/zram_0.1.bbappend

Patch

diff --git a/meta-systemd/meta-oe/recipes-extended/zram/zram/zram.service b/meta-systemd/meta-oe/recipes-extended/zram/zram/zram.service
new file mode 100644
index 0000000..4a19367
--- /dev/null
+++ b/meta-systemd/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-systemd/meta-oe/recipes-extended/zram/zram_0.1.bbappend b/meta-systemd/meta-oe/recipes-extended/zram/zram_0.1.bbappend
new file mode 100644
index 0000000..cc98fe1
--- /dev/null
+++ b/meta-systemd/meta-oe/recipes-extended/zram/zram_0.1.bbappend
@@ -0,0 +1,12 @@ 
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+PRINC := "${@int(PRINC) + 1}"
+
+inherit systemd
+
+SRC_URI += " \
+        file://zram.service \
+"
+
+SYSTEMD_PACKAGES = "${PN}-systemd"
+SYSTEMD_SERVICE_${PN}-systemd = "zram.service"