Files
Alexander Kanavin fc78d37ff0 meta-openembedded/all: adapt to UNPACKDIR changes
Please see
https://git.yoctoproject.org/poky/commit/?id=4dd321f8b83afecd962393101b2a6861275b5265
for what changes are needed, and sed commands that can be used to make them en masse.

I've verified that bitbake -c patch world works with these, but did not run a world
build; the majority of recipes shouldn't need further fixups, but if there are
some that still fall out, they can be fixed in followups.

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2025-06-25 06:44:52 -07:00

52 lines
1.7 KiB
BlitzBasic

SUMMARY = "Linux zram compressed in-memory swap"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
inherit update-rc.d systemd
RDEPENDS:${PN} = "kmod util-linux-swaponoff \
${@bb.utils.contains('DISTRO_FEATURES','systemd','util-linux-zramctl','',d)}"
RRECOMMENDS:${PN} = "kernel-module-zram"
SRC_URI = " \
file://init \
file://zram-swap-init \
file://zram-swap-deinit \
file://zram-swap.service \
file://dev-zram0.swap \
"
S = "${UNPACKDIR}"
do_install () {
# Install systemd related configuration file
if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
install -d ${D}${sysconfdir}/init.d
install -m 0755 ${UNPACKDIR}/init ${D}${sysconfdir}/init.d/zram
fi
if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
install -d ${D}${libexecdir}
install -m 0755 ${UNPACKDIR}/zram-swap-init ${D}${libexecdir}
install -m 0755 ${UNPACKDIR}/zram-swap-deinit ${D}${libexecdir}
install -d ${D}${systemd_unitdir}/system
install -m 0644 ${UNPACKDIR}/zram-swap.service ${D}${systemd_unitdir}/system/zram-swap.service
sed -i -e "s,@LIBEXECDIR@,${libexecdir},g" ${D}${systemd_unitdir}/system/zram-swap.service
install -m 0644 ${UNPACKDIR}/dev-zram0.swap ${D}${systemd_unitdir}/system/dev-zram0.swap
fi
}
FILES:${PN} = " \
${sysconfdir} \
${systemd_unitdir} \
${libexecdir} \
"
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} = "dev-zram0.swap"