systemd-compat-units.bb 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. SUMMARY = "Enhances systemd compatilibity with existing SysVinit scripts"
  2. LICENSE = "MIT"
  3. LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58"
  4. PR = "r18"
  5. DEPENDS = "systemd-systemctl-native"
  6. inherit allarch
  7. SRC_URI = "file://*.service"
  8. do_install() {
  9. install -d ${D}${systemd_unitdir}/system/basic.target.wants
  10. install -d ${D}${systemd_unitdir}/system/sysinit.target.wants/
  11. sed -i -e 's,@POSTINSTALL_INITPOSITION@,${POSTINSTALL_INITPOSITION},g' \
  12. ${WORKDIR}/run-postinsts.service
  13. install -m 0644 ${WORKDIR}/run-postinsts.service ${D}${systemd_unitdir}/system
  14. ln -sf ../run-postinsts.service ${D}${systemd_unitdir}/system/basic.target.wants/
  15. ln -sf ../run-postinsts.service ${D}${systemd_unitdir}/system/sysinit.target.wants/
  16. }
  17. SYSTEMD_DISABLED_SYSV_SERVICES = " \
  18. busybox-udhcpc \
  19. dnsmasq \
  20. hwclock \
  21. networking \
  22. syslog.busybox \
  23. dbus-1 \
  24. "
  25. pkg_postinst_${PN} () {
  26. cd $D${sysconfdir}/init.d
  27. echo "Disabling the following sysv scripts: "
  28. OPTS=""
  29. if [ -n "$D" ]; then
  30. OPTS="--root=$D"
  31. fi
  32. for i in ${SYSTEMD_DISABLED_SYSV_SERVICES} ; do
  33. if [ \( -e $i -o $i.sh \) -a ! -e $D${sysconfdir}/systemd/system/$i.service ] ; then
  34. echo -n "$i: " ; systemctl ${OPTS} mask $i.service
  35. fi
  36. done ; echo
  37. }
  38. FILES_${PN} = "${systemd_unitdir}/system ${bindir}"
  39. RDPEPENDS_${PN} = "systemd"
  40. # Define a variable to allow distros to run configure earlier.
  41. # (for example, to enable loading of ethernet kernel modules before networking starts)
  42. # note: modifying name or default value for POSTINSTALL_INITPOSITION requires
  43. # changes in opkg.inc
  44. POSTINSTALL_INITPOSITION ?= "98"