summaryrefslogtreecommitdiff
path: root/recipes-core/set-hostname/set-hostname_1.1.bb
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-core/set-hostname/set-hostname_1.1.bb')
-rw-r--r--recipes-core/set-hostname/set-hostname_1.1.bb6
1 files changed, 4 insertions, 2 deletions
diff --git a/recipes-core/set-hostname/set-hostname_1.1.bb b/recipes-core/set-hostname/set-hostname_1.1.bb
index e9c3878..ffd8abd 100644
--- a/recipes-core/set-hostname/set-hostname_1.1.bb
+++ b/recipes-core/set-hostname/set-hostname_1.1.bb
@@ -10,6 +10,8 @@ SRC_URI += " \
file://set-hostname.service \
"
+S = "${@d.getVar("UNPACKDIR") or '${WORKDIR}'}"
+
FILES:${PN} = " \
${bindir} \
${systemd_system_unitdir} \
@@ -21,12 +23,12 @@ SYSTEMD_SERVICE:${PN} = " \
do_install () {
install -d ${D}${bindir}
- install -m 0755 ${WORKDIR}/sethostname ${D}${bindir}
+ install -m 0755 ${S}/sethostname ${D}${bindir}
sed -i "s/@@MACHINE@@/${MACHINE}/g" ${D}${bindir}/sethostname
sed -i "s/@@HOSTNAMECTL_OPT@@/${@bb.utils.contains('IMAGE_FEATURES','read-only-rootfs','--transient','',d)}/g" \
${D}${bindir}/sethostname
if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
install -d ${D}${systemd_system_unitdir}
- install -m 0644 ${WORKDIR}/set-hostname.service ${D}${systemd_system_unitdir}
+ install -m 0644 ${S}/set-hostname.service ${D}${systemd_system_unitdir}
fi
}