[oe-commits] Koen Kooi : systemd-compat-units: make opkg unit block startup

git version control git at git.openembedded.org
Fri Jun 10 13:47:09 UTC 2011


Module: meta-openembedded.git
Branch: master
Commit: ea3ad6818eee8d43556bf69c337a5484eb0630e6
URL:    http://git.openembedded.org/?p=meta-openembedded.git&a=commit;h=ea3ad6818eee8d43556bf69c337a5484eb0630e6

Author: Koen Kooi <koen at dominion.thruhere.net>
Date:   Fri Jun 10 10:49:23 2011 +0200

systemd-compat-units: make opkg unit block startup

Without Type=oneshot it would configure things in the background and bootup would go as normal. Now it will block sysinit.target till it's done.

Sadly no full feedback on the console yet.

Signed-off-by: Koen Kooi <koen at dominion.thruhere.net>

---

 .../recipes-core/systemd/systemd-compat-units.bb   |   11 +++++++++--
 .../systemd/systemd-compat-units/opkg.service      |    8 +++++++-
 2 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/meta-oe/recipes-core/systemd/systemd-compat-units.bb b/meta-oe/recipes-core/systemd/systemd-compat-units.bb
index 2fd88ab..7571514 100644
--- a/meta-oe/recipes-core/systemd/systemd-compat-units.bb
+++ b/meta-oe/recipes-core/systemd/systemd-compat-units.bb
@@ -3,7 +3,7 @@ DESCRIPTION = "Units to make systemd work better with existing sysvinit scripts"
 LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58"
 
-PR = "r1"
+PR = "r9"
 
 inherit allarch
 
@@ -11,8 +11,15 @@ SRC_URI = "file://opkg.service"
 
 do_install() {
 	install -d ${D}${base_libdir}/systemd/system/basic.target.wants
+	install -d ${D}${base_libdir}/systemd/system/sysinit.target.wants/
 	install -m 0644 ${WORKDIR}/opkg.service ${D}${base_libdir}/systemd/system
 	ln -sf ../opkg.service ${D}${base_libdir}/systemd/system/basic.target.wants/
+	ln -sf ../opkg.service ${D}${base_libdir}/systemd/system/sysinit.target.wants/
+
+	# hack to make old style sysvinit postinsts succeed
+	install -d ${D}${bindir}
+	echo "echo 1" > ${D}${bindir}/runlevel
+	chmod 0755 ${D}${bindir}/runlevel
 }
 
 pkg_postinst_${PN} () {
@@ -27,7 +34,7 @@ for i in busybox-udhcpc dnsmasq hwclock.sh networking syslog syslog.busybox ; do
 done ; echo
 }
 
-FILES_${PN} = "${base_libdir}/systemd/system"
+FILES_${PN} = "${base_libdir}/systemd/system ${bindir}"
 RDPEPENDS_${PN} = "systemd"
 
 
diff --git a/meta-oe/recipes-core/systemd/systemd-compat-units/opkg.service b/meta-oe/recipes-core/systemd/systemd-compat-units/opkg.service
index c346e57..43da75c 100644
--- a/meta-oe/recipes-core/systemd/systemd-compat-units/opkg.service
+++ b/meta-oe/recipes-core/systemd/systemd-compat-units/opkg.service
@@ -1,10 +1,16 @@
 [Unit]
 Description=Opkg first boot configure
+DefaultDependencies=no
 ConditionPathExists=|/etc/rcS.d/S98configure
+Before=sysinit.target systemd-tmpfiles.service
 
 [Service]
 ExecStart=/etc/rcS.d/S98configure
-RemainAfterExit=no
+RemainAfterExit=No
+Type=oneshot
+StandardOutput=syslog
+TimeoutSec=0
 
 [Install]
 WantedBy=basic.target
+WantedBy=sysinit.target





More information about the Openembedded-commits mailing list