zram_0.2.bb 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. SUMMARY = "Linux zram compressed in-memory swap"
  2. LICENSE = "MIT"
  3. LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
  4. inherit update-rc.d systemd
  5. RDEPENDS:${PN} = "kmod \
  6. ${@bb.utils.contains('DISTRO_FEATURES','systemd','util-linux','util-linux-swaponoff',d)}"
  7. RRECOMMENDS:${PN} = "kernel-module-zram"
  8. SRC_URI = " \
  9. file://init \
  10. file://zram-swap-init \
  11. file://zram-swap-deinit \
  12. file://zram-swap.service \
  13. file://dev-zram0.swap \
  14. "
  15. S = "${WORKDIR}/sources"
  16. UNPACKDIR = "${S}"
  17. do_install () {
  18. # Install systemd related configuration file
  19. if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
  20. install -d ${D}${sysconfdir}/init.d
  21. install -m 0755 ${UNPACKDIR}/init ${D}${sysconfdir}/init.d/zram
  22. fi
  23. if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
  24. install -d ${D}${libexecdir}
  25. install -m 0755 ${UNPACKDIR}/zram-swap-init ${D}${libexecdir}
  26. install -m 0755 ${UNPACKDIR}/zram-swap-deinit ${D}${libexecdir}
  27. install -d ${D}${systemd_unitdir}/system
  28. install -m 0644 ${UNPACKDIR}/zram-swap.service ${D}${systemd_unitdir}/system/zram-swap.service
  29. sed -i -e "s,@LIBEXECDIR@,${libexecdir},g" ${D}${systemd_unitdir}/system/zram-swap.service
  30. install -m 0644 ${UNPACKDIR}/dev-zram0.swap ${D}${systemd_unitdir}/system/dev-zram0.swap
  31. fi
  32. }
  33. FILES:${PN} = " \
  34. ${sysconfdir} \
  35. ${systemd_unitdir} \
  36. ${libexecdir} \
  37. "
  38. INITSCRIPT_NAME = "zram"
  39. INITSCRIPT_PARAMS = "start 05 2 3 4 5 . stop 22 0 1 6 ."
  40. RPROVIDES:${PN} += "${PN}-systemd"
  41. RREPLACES:${PN} += "${PN}-systemd"
  42. RCONFLICTS:${PN} += "${PN}-systemd"
  43. SYSTEMD_SERVICE:${PN} = "dev-zram0.swap"