diff options
author | Stefan Agner <stefan.agner@toradex.com> | 2018-05-16 11:13:50 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-06-18 11:07:58 +0100 |
commit | dcef944e334663570ce2d13fc22f96d86a2b9a72 (patch) | |
tree | 2f6f0bcbc1d0764486bc95f04f8668f5029b8555 /meta | |
parent | 917282c41b666bcfd3aeb95a0ec8973131719ce1 (diff) | |
download | poky-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')
-rw-r--r-- | meta/recipes-devtools/opkg/opkg/opkg-configure.service | 17 | ||||
-rw-r--r-- | meta/recipes-devtools/opkg/opkg_0.3.6.bb | 14 |
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] | ||
2 | Description=Opkg first boot configure | ||
3 | DefaultDependencies=no | ||
4 | After=systemd-remount-fs.service systemd-tmpfiles-setup.service tmp.mount | ||
5 | Before=sysinit.target | ||
6 | |||
7 | [Service] | ||
8 | Type=oneshot | ||
9 | EnvironmentFile=-@SYSCONFDIR@/default/postinst | ||
10 | ExecStart=-@BASE_BINDIR@/sh -c " if [ $POSTINST_LOGGING = '1' ]; then @BINDIR@/opkg configure > $LOGFILE 2>&1; else @BINDIR@/opkg configure; fi" | ||
11 | ExecStartPost=@BASE_BINDIR@/systemctl --no-reload disable opkg-configure.service | ||
12 | StandardOutput=syslog | ||
13 | RemainAfterExit=No | ||
14 | |||
15 | [Install] | ||
16 | WantedBy=basic.target | ||
17 | WantedBy=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" | |||
12 | PE = "1" | 12 | PE = "1" |
13 | 13 | ||
14 | SRC_URI = "http://downloads.yoctoproject.org/releases/${BPN}/${BPN}-${PV}.tar.gz \ | 14 | SRC_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 | ||
23 | inherit autotools pkgconfig systemd | 22 | inherit autotools pkgconfig systemd |
24 | 23 | ||
25 | SYSTEMD_SERVICE_${PN} = "opkg-configure.service" | ||
26 | |||
27 | target_localstatedir := "${localstatedir}" | 24 | target_localstatedir := "${localstatedir}" |
28 | OPKGLIBDIR = "${target_localstatedir}/lib" | 25 | OPKGLIBDIR = "${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 | ||
61 | RDEPENDS_${PN} = "${VIRTUAL-RUNTIME_update-alternatives} opkg-arch-config libarchive" | 48 | RDEPENDS_${PN} = "${VIRTUAL-RUNTIME_update-alternatives} opkg-arch-config libarchive" |
@@ -68,7 +55,6 @@ RPROVIDES_${PN} = "opkg-collateral" | |||
68 | PACKAGES =+ "libopkg" | 55 | PACKAGES =+ "libopkg" |
69 | 56 | ||
70 | FILES_libopkg = "${libdir}/*.so.* ${OPKGLIBDIR}/opkg/" | 57 | FILES_libopkg = "${libdir}/*.so.* ${OPKGLIBDIR}/opkg/" |
71 | FILES_${PN} += "${systemd_unitdir}/system/" | ||
72 | 58 | ||
73 | BBCLASSEXTEND = "native nativesdk" | 59 | BBCLASSEXTEND = "native nativesdk" |
74 | 60 | ||