summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuca Fancellu <luca.fancellu@arm.com>2023-10-18 12:20:59 +0100
committerKhem Raj <raj.khem@gmail.com>2023-10-18 08:47:09 -0700
commitc66ec8776ec6f467937918a114bdefa28ac036a9 (patch)
treefe30a7d1679c9ea555be643f3207a1a40316d0b3
parentc8316b49ff4de3e4048cc9ec5dd467e593265b6b (diff)
downloadmeta-openembedded-c66ec8776ec6f467937918a114bdefa28ac036a9.tar.gz
linuxptp: Use templates for the systemd services
Use templates for the systemd services so that sbindir and sysconfdir can be written into them, improving portability. Pass sbindir with EXTRA_OEMAKE and remove 'prefix' which is redundant since we pass sbindir and mandir already. Signed-off-by: Luca Fancellu <luca.fancellu@arm.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r--meta-oe/recipes-connectivity/linuxptp/linuxptp/systemd/phc2sys@.service.in (renamed from meta-oe/recipes-connectivity/linuxptp/linuxptp/systemd/phc2sys@.service)2
-rw-r--r--meta-oe/recipes-connectivity/linuxptp/linuxptp/systemd/ptp4l@.service.in (renamed from meta-oe/recipes-connectivity/linuxptp/linuxptp/systemd/ptp4l@.service)2
-rw-r--r--meta-oe/recipes-connectivity/linuxptp/linuxptp_4.1.bb15
3 files changed, 12 insertions, 7 deletions
diff --git a/meta-oe/recipes-connectivity/linuxptp/linuxptp/systemd/phc2sys@.service b/meta-oe/recipes-connectivity/linuxptp/linuxptp/systemd/phc2sys@.service.in
index dd2512bdc..f66dd2d01 100644
--- a/meta-oe/recipes-connectivity/linuxptp/linuxptp/systemd/phc2sys@.service
+++ b/meta-oe/recipes-connectivity/linuxptp/linuxptp/systemd/phc2sys@.service.in
@@ -7,7 +7,7 @@ Before=time-sync.target
7 7
8[Service] 8[Service]
9Type=simple 9Type=simple
10ExecStart=/usr/sbin/phc2sys -w -s %I 10ExecStart=@SBINDIR@/phc2sys -w -s %I
11 11
12[Install] 12[Install]
13WantedBy=multi-user.target 13WantedBy=multi-user.target
diff --git a/meta-oe/recipes-connectivity/linuxptp/linuxptp/systemd/ptp4l@.service b/meta-oe/recipes-connectivity/linuxptp/linuxptp/systemd/ptp4l@.service.in
index 1bad2d72d..250218141 100644
--- a/meta-oe/recipes-connectivity/linuxptp/linuxptp/systemd/ptp4l@.service
+++ b/meta-oe/recipes-connectivity/linuxptp/linuxptp/systemd/ptp4l@.service.in
@@ -5,7 +5,7 @@ After=sys-subsystem-net-devices-%i.device
5 5
6[Service] 6[Service]
7Type=simple 7Type=simple
8ExecStart=/usr/sbin/ptp4l -f /etc/linuxptp/ptp4l.conf -i %I 8ExecStart=@SBINDIR@/ptp4l -f @SYSCONFDIR@/linuxptp/ptp4l.conf -i %I
9 9
10[Install] 10[Install]
11WantedBy=multi-user.target 11WantedBy=multi-user.target
diff --git a/meta-oe/recipes-connectivity/linuxptp/linuxptp_4.1.bb b/meta-oe/recipes-connectivity/linuxptp/linuxptp_4.1.bb
index a92434385..9a5c9b520 100644
--- a/meta-oe/recipes-connectivity/linuxptp/linuxptp_4.1.bb
+++ b/meta-oe/recipes-connectivity/linuxptp/linuxptp_4.1.bb
@@ -10,8 +10,8 @@ LINUXPTP_SRC_URI = "http://sourceforge.net/projects/linuxptp"
10SRC_URI = "${LINUXPTP_SRC_URI}/files/v4.1/linuxptp-${PV}.tgz \ 10SRC_URI = "${LINUXPTP_SRC_URI}/files/v4.1/linuxptp-${PV}.tgz \
11 file://0001-include-string.h-for-strncpy.patch \ 11 file://0001-include-string.h-for-strncpy.patch \
12 file://0002-linuxptp-Use-CC-in-incdefs.sh.patch \ 12 file://0002-linuxptp-Use-CC-in-incdefs.sh.patch \
13 file://systemd/phc2sys@.service \ 13 file://systemd/phc2sys@.service.in \
14 file://systemd/ptp4l@.service \ 14 file://systemd/ptp4l@.service.in \
15 " 15 "
16 16
17SRC_URI[md5sum] = "1db8699fc155965341759be5e5aad938" 17SRC_URI[md5sum] = "1db8699fc155965341759be5e5aad938"
@@ -22,14 +22,15 @@ inherit systemd
22UPSTREAM_CHECK_URI = "${LINUXPTP_SRC_URI}/files/" 22UPSTREAM_CHECK_URI = "${LINUXPTP_SRC_URI}/files/"
23UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)/" 23UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)/"
24 24
25EXTRA_OEMAKE = "CC='${CC}' EXTRA_CFLAGS='${CFLAGS}' mandir='${mandir}'" 25EXTRA_OEMAKE = "CC='${CC}' EXTRA_CFLAGS='${CFLAGS}' mandir='${mandir}' \
26 sbindir='${sbindir}'"
26 27
27export KBUILD_OUTPUT="${RECIPE_SYSROOT}" 28export KBUILD_OUTPUT="${RECIPE_SYSROOT}"
28 29
29LINUXPTP_SYSTEMD_SERVICES = "phc2sys@.service ptp4l@.service" 30LINUXPTP_SYSTEMD_SERVICES = "phc2sys@.service ptp4l@.service"
30 31
31do_install() { 32do_install() {
32 oe_runmake install DESTDIR=${D} prefix=${prefix} 33 oe_runmake install DESTDIR=${D}
33 34
34 # Install example configs from source tree 35 # Install example configs from source tree
35 install -d ${D}${docdir}/${PN} 36 install -d ${D}${docdir}/${PN}
@@ -44,7 +45,11 @@ do_install() {
44 # Install systemd services 45 # Install systemd services
45 install -d ${D}/${systemd_unitdir}/system/ 46 install -d ${D}/${systemd_unitdir}/system/
46 for service in ${LINUXPTP_SYSTEMD_SERVICES}; do 47 for service in ${LINUXPTP_SYSTEMD_SERVICES}; do
47 install -m 644 ${WORKDIR}/systemd/$service \ 48 sed -i -e 's,@SBINDIR@,${sbindir},g' \
49 ${WORKDIR}/systemd/$service.in
50 sed -i -e 's,@SYSCONFDIR@,${sysconfdir},g' \
51 ${WORKDIR}/systemd/$service.in
52 install -m 644 ${WORKDIR}/systemd/$service.in \
48 ${D}/${systemd_unitdir}/system/$service 53 ${D}/${systemd_unitdir}/system/$service
49 done 54 done
50} 55}