diff options
Diffstat (limited to 'meta-oe')
-rw-r--r-- | meta-oe/recipes-extended/zram/zram/zram.service | 12 | ||||
-rw-r--r-- | meta-oe/recipes-extended/zram/zram_0.1.bb | 13 |
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 000000000..4a19367d9 --- /dev/null +++ b/meta-oe/recipes-extended/zram/zram/zram.service | |||
@@ -0,0 +1,12 @@ | |||
1 | [Unit] | ||
2 | Description=Enable zram compressed in-memory swap. | ||
3 | After=multi-user.target | ||
4 | |||
5 | [Service] | ||
6 | RemainAfterExit=yes | ||
7 | ExecStart=/usr/bin/zram-load.sh --load | ||
8 | ExecStop=/usr/bin/zram-load.sh --unload | ||
9 | Type=oneshot | ||
10 | |||
11 | [Install] | ||
12 | 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 85262647c..115e6437f 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" | |||
2 | LICENSE = "MIT" | 2 | LICENSE = "MIT" |
3 | LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58" | 3 | LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58" |
4 | 4 | ||
5 | inherit allarch update-rc.d | 5 | inherit allarch update-rc.d systemd |
6 | 6 | ||
7 | RDEPENDS_${PN} = "util-linux-swaponoff kmod kernel-module-zram" | 7 | RDEPENDS_${PN} = "util-linux-swaponoff kmod kernel-module-zram" |
8 | 8 | ||
9 | PR = "r0" | 9 | PR = "r3" |
10 | 10 | ||
11 | SRC_URI = " \ | 11 | SRC_URI = " \ |
12 | file://init \ | 12 | file://init \ |
13 | file://zram.service \ | ||
13 | " | 14 | " |
14 | 15 | ||
15 | do_install () { | 16 | do_install () { |
16 | # Sysvinit | 17 | # Sysvinit |
17 | install -d ${D}${sysconfdir}/init.d | 18 | install -d ${D}${sysconfdir}/init.d |
18 | install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/zram | 19 | install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/zram |
20 | |||
21 | install -d ${D}${systemd_unitdir}/system | ||
22 | install -m 0644 ${WORKDIR}/zram.service ${D}${systemd_unitdir}/system | ||
19 | } | 23 | } |
20 | 24 | ||
21 | FILES_${PN} = "${sysconfdir}/init.d" | 25 | FILES_${PN} = "${sysconfdir}/init.d" |
22 | INITSCRIPT_NAME = "zram" | 26 | INITSCRIPT_NAME = "zram" |
23 | INITSCRIPT_PARAMS = "start 05 2 3 4 5 . stop 22 0 1 6 ." | 27 | INITSCRIPT_PARAMS = "start 05 2 3 4 5 . stop 22 0 1 6 ." |
28 | |||
29 | RPROVIDES_${PN} += "${PN}-systemd" | ||
30 | RREPLACES_${PN} += "${PN}-systemd" | ||
31 | RCONFLICTS_${PN} += "${PN}-systemd" | ||
32 | SYSTEMD_SERVICE_${PN} = "zram.service" | ||