summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/opkg
diff options
context:
space:
mode:
authorStefan Agner <stefan.agner@toradex.com>2018-05-16 11:13:50 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-06-18 11:07:58 +0100
commitdcef944e334663570ce2d13fc22f96d86a2b9a72 (patch)
tree2f6f0bcbc1d0764486bc95f04f8668f5029b8555 /meta/recipes-devtools/opkg
parent917282c41b666bcfd3aeb95a0ec8973131719ce1 (diff)
downloadpoky-dcef944e334663570ce2d13fc22f96d86a2b9a72.tar.gz
opkg: avoid running postinst scripts twice when using systemd
OpenEmbedded has a built-in mechanism to run postinst scripts offline at build time or, if necessary, on first boot (delayed execution). If the latter is the case and systemd is in use, two services end up doing the same thing: - opkg-configure.service starts "opkg configure" directly. - run-postinsts.service starts "/usr/sbin/run-postinsts" which runs postinst scripts stored in /etc/ipk-postinsts/ or "opkg configure" if package management is installed. Since the run-postinsts.service is also used in cases where no package management is in use, it is the primary means of handling postinsts. Get rid of the opkg-configure.service to avoid duplicate opkg configure execution. (From OE-Core rev: 23dcf7ea3af84721fac126a2b2f0f100f7266368) Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/opkg')
-rw-r--r--meta/recipes-devtools/opkg/opkg/opkg-configure.service17
-rw-r--r--meta/recipes-devtools/opkg/opkg_0.3.6.bb14
2 files changed, 0 insertions, 31 deletions
diff --git a/meta/recipes-devtools/opkg/opkg/opkg-configure.service b/meta/recipes-devtools/opkg/opkg/opkg-configure.service
deleted file mode 100644
index 432c3ddc28..0000000000
--- a/meta/recipes-devtools/opkg/opkg/opkg-configure.service
+++ /dev/null
@@ -1,17 +0,0 @@
1[Unit]
2Description=Opkg first boot configure
3DefaultDependencies=no
4After=systemd-remount-fs.service systemd-tmpfiles-setup.service tmp.mount
5Before=sysinit.target
6
7[Service]
8Type=oneshot
9EnvironmentFile=-@SYSCONFDIR@/default/postinst
10ExecStart=-@BASE_BINDIR@/sh -c " if [ $POSTINST_LOGGING = '1' ]; then @BINDIR@/opkg configure > $LOGFILE 2>&1; else @BINDIR@/opkg configure; fi"
11ExecStartPost=@BASE_BINDIR@/systemctl --no-reload disable opkg-configure.service
12StandardOutput=syslog
13RemainAfterExit=No
14
15[Install]
16WantedBy=basic.target
17WantedBy=sysinit.target
diff --git a/meta/recipes-devtools/opkg/opkg_0.3.6.bb b/meta/recipes-devtools/opkg/opkg_0.3.6.bb
index 70f20af739..579b51166c 100644
--- a/meta/recipes-devtools/opkg/opkg_0.3.6.bb
+++ b/meta/recipes-devtools/opkg/opkg_0.3.6.bb
@@ -12,7 +12,6 @@ DEPENDS = "libarchive"
12PE = "1" 12PE = "1"
13 13
14SRC_URI = "http://downloads.yoctoproject.org/releases/${BPN}/${BPN}-${PV}.tar.gz \ 14SRC_URI = "http://downloads.yoctoproject.org/releases/${BPN}/${BPN}-${PV}.tar.gz \
15 file://opkg-configure.service \
16 file://opkg.conf \ 15 file://opkg.conf \
17 file://0001-opkg_conf-create-opkg.lock-in-run-instead-of-var-run.patch \ 16 file://0001-opkg_conf-create-opkg.lock-in-run-instead-of-var-run.patch \
18" 17"
@@ -22,8 +21,6 @@ SRC_URI[sha256sum] = "f607f0e61be8cf8a3bbd0d2dccd9ec9e9b6c21dd4307b671c600d6eeaf
22 21
23inherit autotools pkgconfig systemd 22inherit autotools pkgconfig systemd
24 23
25SYSTEMD_SERVICE_${PN} = "opkg-configure.service"
26
27target_localstatedir := "${localstatedir}" 24target_localstatedir := "${localstatedir}"
28OPKGLIBDIR = "${target_localstatedir}/lib" 25OPKGLIBDIR = "${target_localstatedir}/lib"
29 26
@@ -46,16 +43,6 @@ do_install_append () {
46 43
47 # We need to create the lock directory 44 # We need to create the lock directory
48 install -d ${D}${OPKGLIBDIR}/opkg 45 install -d ${D}${OPKGLIBDIR}/opkg
49
50 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)};then
51 install -d ${D}${systemd_unitdir}/system
52 install -m 0644 ${WORKDIR}/opkg-configure.service ${D}${systemd_unitdir}/system/
53 sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \
54 -e 's,@SYSCONFDIR@,${sysconfdir},g' \
55 -e 's,@BINDIR@,${bindir},g' \
56 -e 's,@SYSTEMD_UNITDIR@,${systemd_unitdir},g' \
57 ${D}${systemd_unitdir}/system/opkg-configure.service
58 fi
59} 46}
60 47
61RDEPENDS_${PN} = "${VIRTUAL-RUNTIME_update-alternatives} opkg-arch-config libarchive" 48RDEPENDS_${PN} = "${VIRTUAL-RUNTIME_update-alternatives} opkg-arch-config libarchive"
@@ -68,7 +55,6 @@ RPROVIDES_${PN} = "opkg-collateral"
68PACKAGES =+ "libopkg" 55PACKAGES =+ "libopkg"
69 56
70FILES_libopkg = "${libdir}/*.so.* ${OPKGLIBDIR}/opkg/" 57FILES_libopkg = "${libdir}/*.so.* ${OPKGLIBDIR}/opkg/"
71FILES_${PN} += "${systemd_unitdir}/system/"
72 58
73BBCLASSEXTEND = "native nativesdk" 59BBCLASSEXTEND = "native nativesdk"
74 60