From 679567dfdc6709417f57f0497252a4315d9b3a19 Mon Sep 17 00:00:00 2001 From: Samuli Piippo Date: Mon, 9 Nov 2015 16:01:03 +0200 Subject: Use Systemd as the init system Remove sysvinit from distro features and add Systemd as the default init system. Add necessary service files to all recipes that need them. Change-Id: I9cd4c0239fe16f35145bd3bed08e27196f30ee82 Reviewed-by: Gatis Paeglis Reviewed-by: Teemu Holappa --- conf/distro/b2qt.conf | 8 ++++++- conf/distro/include/emulator.conf | 2 +- recipes-qt/b2qt-addons/b2qt-emulator-proxy.bb | 8 ++++++- .../b2qt-emulator-proxy/emulatorproxy.service | 9 ++++++++ .../b2qt-addons/b2qt-emulator-sdcardmountd.bb | 8 ++++++- .../b2qt-emulator-sdcardmountd/sdcardmount.service | 9 ++++++++ recipes-qt/b2qt-addons/b2qt-launcher.bb | 12 +++++++--- recipes-qt/b2qt-addons/b2qt-launcher/b2qt.service | 10 +++++++++ .../b2qt-addons/b2qt-launcher/qtlauncher.service | 10 +++++++++ recipes/adbd/adbd.bb | 13 ++++++++--- recipes/adbd/files/adbd.service | 11 +++++++++ recipes/ostree/ostree.bb | 8 ++++++- .../packagegroup-b2qt-embedded-toolchain-target.bb | 2 +- .../packagegroup-b2qt-embedded-tools.bb | 1 + recipes/systemd/systemd_%.bbappend | 26 ++++++++++++++++++++++ .../virtualbox/mount-vboxsf/mount-vboxsf.service | 12 ++++++++++ recipes/virtualbox/mount-vboxsf_4.3.30.bb | 11 +++++++-- 17 files changed, 146 insertions(+), 14 deletions(-) create mode 100644 recipes-qt/b2qt-addons/b2qt-emulator-proxy/emulatorproxy.service create mode 100644 recipes-qt/b2qt-addons/b2qt-emulator-sdcardmountd/sdcardmount.service create mode 100644 recipes-qt/b2qt-addons/b2qt-launcher/b2qt.service create mode 100644 recipes-qt/b2qt-addons/b2qt-launcher/qtlauncher.service create mode 100644 recipes/adbd/files/adbd.service create mode 100644 recipes/systemd/systemd_%.bbappend create mode 100644 recipes/virtualbox/mount-vboxsf/mount-vboxsf.service diff --git a/conf/distro/b2qt.conf b/conf/distro/b2qt.conf index f31a9d7..f006cf6 100644 --- a/conf/distro/b2qt.conf +++ b/conf/distro/b2qt.conf @@ -39,11 +39,17 @@ SYSVINIT_ENABLED_GETTYS = "" DISTRO_FEATURES_DEFAULT = "alsa argp bluetooth ext2 largefile usbgadget usbhost wifi xattr nfs webengine" POKY_DEFAULT_DISTRO_FEATURES = "largefile opengl multiarch" -DISTRO_FEATURES_BACKFILL_CONSIDERED = "pulseaudio" +DISTRO_FEATURES_BACKFILL_CONSIDERED = "pulseaudio sysvinit" # use GStreamer 1.0, optionally change to "gstreamer010" to use GStreamer 0.10 DISTRO_FEATURES += "gstreamer" +DISTRO_FEATURES += "systemd" +VIRTUAL-RUNTIME_init_manager = "systemd" +VIRTUAL-RUNTIME_initscripts = "" +PREFERRED_PROVIDER_udev ?= "systemd" +PREFERRED_PROVIDER_udev-utils ?= "systemd" + PREFERRED_PROVIDER_jpeg ?= "libjpeg-turbo" PREFERRED_PROVIDER_jpeg-native ?= "libjpeg-turbo-native" diff --git a/conf/distro/include/emulator.conf b/conf/distro/include/emulator.conf index 28be593..34b2029 100644 --- a/conf/distro/include/emulator.conf +++ b/conf/distro/include/emulator.conf @@ -32,7 +32,7 @@ MACHINE_EXTRA_RRECOMMENDS += "\ PREFERRED_PROVIDER_virtual/egl = "qtglesstream-dummy-client" PREFERRED_PROVIDER_virtual/libgles2 = "qtglesstream-dummy-client" -KERNEL_MODULE_AUTOLOAD += "snd-intel8x0 vboxguest" +KERNEL_MODULE_AUTOLOAD += "snd-intel8x0 vboxguest vboxsf" DISTRO_FEATURES_remove = "webengine opengl" diff --git a/recipes-qt/b2qt-addons/b2qt-emulator-proxy.bb b/recipes-qt/b2qt-addons/b2qt-emulator-proxy.bb index 15fe3c0..ea31e21 100644 --- a/recipes-qt/b2qt-addons/b2qt-emulator-proxy.bb +++ b/recipes-qt/b2qt-addons/b2qt-emulator-proxy.bb @@ -29,6 +29,7 @@ inherit qt5-module SRC_URI = " \ git://codereview.qt-project.org/tqtc-boot2qt/emulator;branch=${BRANCH};protocol=ssh \ file://emulatorproxyd.sh \ + file://emulatorproxy.service \ " SRCREV = "89ca944fae7106a55803ddce6fd84447685b61e5" @@ -41,9 +42,14 @@ DEPENDS = "qtbase qtsimulator" do_install_append() { install -m 0755 -d ${D}${sysconfdir}/init.d install -m 0755 ${WORKDIR}/emulatorproxyd.sh ${D}${sysconfdir}/init.d/ + + install -m 0755 -d ${D}${systemd_unitdir}/system + install -m 0644 ${WORKDIR}/emulatorproxy.service ${D}${systemd_unitdir}/system/ } INITSCRIPT_NAME = "emulatorproxyd.sh" INITSCRIPT_PARAMS = "defaults 97 10" -inherit update-rc.d +SYSTEMD_SERVICE_${PN} = "emulatorproxy.service" + +inherit update-rc.d systemd diff --git a/recipes-qt/b2qt-addons/b2qt-emulator-proxy/emulatorproxy.service b/recipes-qt/b2qt-addons/b2qt-emulator-proxy/emulatorproxy.service new file mode 100644 index 0000000..d48ed41 --- /dev/null +++ b/recipes-qt/b2qt-addons/b2qt-emulator-proxy/emulatorproxy.service @@ -0,0 +1,9 @@ +[Unit] +Description=QtSimulator Proxy Daemon +After=systemd-user-sessions.service + +[Service] +ExecStart=/usr/bin/emulatorproxyd + +[Install] +WantedBy=multi-user.target diff --git a/recipes-qt/b2qt-addons/b2qt-emulator-sdcardmountd.bb b/recipes-qt/b2qt-addons/b2qt-emulator-sdcardmountd.bb index 622363d..038c972 100644 --- a/recipes-qt/b2qt-addons/b2qt-emulator-sdcardmountd.bb +++ b/recipes-qt/b2qt-addons/b2qt-emulator-sdcardmountd.bb @@ -29,6 +29,7 @@ inherit qt5-module SRC_URI = " \ git://codereview.qt-project.org/tqtc-boot2qt/emulator;branch=${BRANCH};protocol=ssh \ file://sdcardmountd.sh \ + file://sdcardmount.service \ " SRCREV = "89ca944fae7106a55803ddce6fd84447685b61e5" @@ -41,9 +42,14 @@ DEPENDS = "qtbase qtsimulator" do_install_append() { install -m 0755 -d ${D}${sysconfdir}/init.d install -m 0755 ${WORKDIR}/sdcardmountd.sh ${D}${sysconfdir}/init.d/ + + install -m 0755 -d ${D}${systemd_unitdir}/system + install -m 0644 ${WORKDIR}/sdcardmount.service ${D}${systemd_unitdir}/system/ } INITSCRIPT_NAME = "sdcardmountd.sh" INITSCRIPT_PARAMS = "defaults 97 10" -inherit update-rc.d +SYSTEMD_SERVICE_${PN} = "sdcardmount.service" + +inherit update-rc.d systemd diff --git a/recipes-qt/b2qt-addons/b2qt-emulator-sdcardmountd/sdcardmount.service b/recipes-qt/b2qt-addons/b2qt-emulator-sdcardmountd/sdcardmount.service new file mode 100644 index 0000000..1171089 --- /dev/null +++ b/recipes-qt/b2qt-addons/b2qt-emulator-sdcardmountd/sdcardmount.service @@ -0,0 +1,9 @@ +[Unit] +Description=QtSimulator SD Card Mount Daemon +After=systemd-user-sessions.service + +[Service] +ExecStart=/usr/bin/sdcardmountd + +[Install] +WantedBy=multi-user.target diff --git a/recipes-qt/b2qt-addons/b2qt-launcher.bb b/recipes-qt/b2qt-addons/b2qt-launcher.bb index 98de916..ab02d97 100644 --- a/recipes-qt/b2qt-addons/b2qt-launcher.bb +++ b/recipes-qt/b2qt-addons/b2qt-launcher.bb @@ -29,6 +29,8 @@ inherit qmake5 sdk-sources SRC_URI = " \ git://codereview.qt-project.org/tqtc-boot2qt/launcher;branch=${BRANCH};protocol=ssh;sdk-uri=5.5/Boot2Qt/sources/b2qt-launcher \ file://b2qt-startup.sh \ + file://qtlauncher.service \ + file://b2qt.service \ " SRCREV = "e824e206f28eb20bcb6f1d9064990f5e927261f4" @@ -42,11 +44,15 @@ DEPENDS = "qtbase qtdeclarative \ do_install_append() { install -m 0755 -d ${D}${sysconfdir}/init.d install -m 0755 ${WORKDIR}/b2qt-startup.sh ${D}${sysconfdir}/init.d/ -} -FILES_${PN} += "${sysdir}/init.d/b2qt-startup.h" + install -m 0755 -d ${D}${systemd_unitdir}/system + install -m 0644 ${WORKDIR}/qtlauncher.service ${D}${systemd_unitdir}/system/ + install -m 0644 ${WORKDIR}/b2qt.service ${D}${systemd_unitdir}/system/ +} INITSCRIPT_NAME = "b2qt-startup.sh" INITSCRIPT_PARAMS = "defaults 30" -inherit update-rc.d +SYSTEMD_SERVICE_${PN} = "qtlauncher.service b2qt.service" + +inherit update-rc.d systemd diff --git a/recipes-qt/b2qt-addons/b2qt-launcher/b2qt.service b/recipes-qt/b2qt-addons/b2qt-launcher/b2qt.service new file mode 100644 index 0000000..f941f91 --- /dev/null +++ b/recipes-qt/b2qt-addons/b2qt-launcher/b2qt.service @@ -0,0 +1,10 @@ +[Unit] +Description=B2Qt user application +After=systemd-user-sessions.service +ConditionPathExists=/usr/bin/b2qt + +[Service] +ExecStart=-/usr/bin/appcontroller /usr/bin/b2qt + +[Install] +WantedBy=multi-user.target diff --git a/recipes-qt/b2qt-addons/b2qt-launcher/qtlauncher.service b/recipes-qt/b2qt-addons/b2qt-launcher/qtlauncher.service new file mode 100644 index 0000000..7658ca8 --- /dev/null +++ b/recipes-qt/b2qt-addons/b2qt-launcher/qtlauncher.service @@ -0,0 +1,10 @@ +[Unit] +Description=B2Qt Launcher Demo +After=systemd-user-sessions.service +ConditionPathExists=!/usr/bin/b2qt + +[Service] +ExecStart=-/usr/bin/appcontroller /usr/bin/qtlauncher --applications-root /data/user/qt + +[Install] +WantedBy=multi-user.target diff --git a/recipes/adbd/adbd.bb b/recipes/adbd/adbd.bb index c372755..e32311e 100644 --- a/recipes/adbd/adbd.bb +++ b/recipes/adbd/adbd.bb @@ -38,6 +38,7 @@ SRC_URI = "git://android.googlesource.com/platform/system/core;protocol=https;br file://Makefile.adbd \ file://adb-init \ file://defaults \ + file://adbd.service \ " S = "${WORKDIR}/git" @@ -57,15 +58,21 @@ do_compile() { do_install() { install -m 0755 -d ${D}${bindir}/ install -m 0755 ${WORKDIR}/git/adb/adbd ${D}${bindir}/ + install -m 0755 ${WORKDIR}/adb-init ${D}${bindir}/ install -m 0755 -d ${D}${sysconfdir}/init.d - install -m 0755 ${WORKDIR}/adb-init ${D}${sysconfdir}/init.d/ + ln -s ${bindir}/adb-init ${D}${sysconfdir}/init.d/ + + install -m 0755 -d ${D}${systemd_unitdir}/system + install -m 0644 ${WORKDIR}/adbd.service ${D}${systemd_unitdir}/system/ install -m 0755 -d ${D}${sysconfdir}/default - install -m 0755 ${WORKDIR}/defaults ${D}${sysconfdir}/default/adbd + install -m 0644 ${WORKDIR}/defaults ${D}${sysconfdir}/default/adbd } INITSCRIPT_NAME = "adb-init" INITSCRIPT_PARAMS = "defaults 96" -inherit update-rc.d +SYSTEMD_SERVICE_${PN} = "adbd.service" + +inherit update-rc.d systemd diff --git a/recipes/adbd/files/adbd.service b/recipes/adbd/files/adbd.service new file mode 100644 index 0000000..f8ee77d --- /dev/null +++ b/recipes/adbd/files/adbd.service @@ -0,0 +1,11 @@ +[Unit] +Description=ADB Server Daemon +After=network.target + +[Service] +Type=forking +ExecStart=/usr/bin/adb-init start +ExecStop=/usr/bin/adb-init stop + +[Install] +WantedBy=multi-user.target diff --git a/recipes/ostree/ostree.bb b/recipes/ostree/ostree.bb index 96931f1..acd8305 100644 --- a/recipes/ostree/ostree.bb +++ b/recipes/ostree/ostree.bb @@ -25,7 +25,7 @@ SUMMARY = "Tool for managing bootable, immutable, versioned filesystem trees." LICENSE = "LGPL-2.1" LIC_FILES_CHKSUM = "file://COPYING;md5=5f30f0716dfdd0d91eb439ebec522ec2" -inherit autotools pkgconfig +inherit autotools pkgconfig systemd SRC_URI = " \ git://github.com/GNOME/ostree.git;tag=v2015.9 \ @@ -36,6 +36,12 @@ S = "${WORKDIR}/git" DEPENDS = "glib-2.0 e2fsprogs gpgme attr libsoup-2.4 libgsystem libassuan xz" +PACKAGECONFIG ??= "${@base_contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)}" +PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_unitdir}/system/,,," + +SYSTEMD_SERVICE_${PN} = "ostree-prepare-root.service ostree-remount.service" +FILES_${PN} += "${systemd_unitdir}/system/" + EXTRA_OECONF = "--with-dracut --without-selinux --without-libarchive --with-grub2=no --enable-gtk-doc-html=no" do_configure_prepend() { diff --git a/recipes/packagegroup/packagegroup-b2qt-embedded-toolchain-target.bb b/recipes/packagegroup/packagegroup-b2qt-embedded-toolchain-target.bb index 9aad8df..47b7716 100644 --- a/recipes/packagegroup/packagegroup-b2qt-embedded-toolchain-target.bb +++ b/recipes/packagegroup/packagegroup-b2qt-embedded-toolchain-target.bb @@ -41,7 +41,7 @@ RDEPENDS_${PN} += "\ ${@base_contains("DISTRO_FEATURES", "gstreamer", "gstreamer1.0-dev gstreamer1.0-plugins-base-dev", "", d)} \ icu-dev \ libxslt-dev \ - udev-dev \ + ${@base_contains("DISTRO_FEATURES", "systemd", "systemd-dev", "udev-dev", d)} \ tslib-dev \ hunspell-dev \ libcap-dev \ diff --git a/recipes/packagegroup/packagegroup-b2qt-embedded-tools.bb b/recipes/packagegroup/packagegroup-b2qt-embedded-tools.bb index de36975..1af3a6b 100644 --- a/recipes/packagegroup/packagegroup-b2qt-embedded-tools.bb +++ b/recipes/packagegroup/packagegroup-b2qt-embedded-tools.bb @@ -35,4 +35,5 @@ RDEPENDS_${PN} = "\ htop \ ntp \ connman-client \ + ${@base_contains("DISTRO_FEATURES", "systemd", "systemd-analyze", "", d)} \ " diff --git a/recipes/systemd/systemd_%.bbappend b/recipes/systemd/systemd_%.bbappend new file mode 100644 index 0000000..be5517d --- /dev/null +++ b/recipes/systemd/systemd_%.bbappend @@ -0,0 +1,26 @@ +############################################################################# +## +## Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). +## +## This file is part of the Qt Enterprise Embedded Scripts of the Qt +## framework. +## +## $QT_BEGIN_LICENSE$ +## Commercial License Usage Only +## Licensees holding valid commercial Qt license agreements with Digia +## with an appropriate addendum covering the Qt Enterprise Embedded Scripts, +## may use this file in accordance with the terms contained in said license +## agreement. +## +## For further information use the contact form at +## http://www.qt.io/contact-us. +## +## +## $QT_END_LICENSE$ +## +############################################################################# + +do_install_append() { + # remove login from tty1 + rm -f ${D}${sysconfdir}/systemd/system/getty.target.wants/getty@tty1.service +} diff --git a/recipes/virtualbox/mount-vboxsf/mount-vboxsf.service b/recipes/virtualbox/mount-vboxsf/mount-vboxsf.service new file mode 100644 index 0000000..7c7211f --- /dev/null +++ b/recipes/virtualbox/mount-vboxsf/mount-vboxsf.service @@ -0,0 +1,12 @@ +[Unit] +Description=QtSimulator Shared Mount Point +After=systemd-user-sessions.service + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=/usr/bin/mount-vboxsf.sh start +ExecStop=/usr/bin/mount-vboxsf.sh stop + +[Install] +WantedBy=multi-user.target diff --git a/recipes/virtualbox/mount-vboxsf_4.3.30.bb b/recipes/virtualbox/mount-vboxsf_4.3.30.bb index 171ba7e..e84e227 100644 --- a/recipes/virtualbox/mount-vboxsf_4.3.30.bb +++ b/recipes/virtualbox/mount-vboxsf_4.3.30.bb @@ -26,6 +26,7 @@ LIC_FILES_CHKSUM = "file://${WORKDIR}/VirtualBox-${PV}/COPYING;md5=e197d5641bb35 SRC_URI = "http://download.virtualbox.org/virtualbox/${PV}/VirtualBox-${PV}.tar.bz2 \ file://mount-vboxsf.sh \ + file://mount-vboxsf.service \ " SRC_URI[md5sum] = "cc053340f88922a11ad9d4fab56557bd" @@ -40,12 +41,18 @@ do_compile() { do_install() { install -m 0755 -d ${D}${bindir}/ install -m 0755 mount.vboxsf ${D}${bindir}/ + install -m 0755 ${WORKDIR}/mount-vboxsf.sh ${D}${bindir}/ install -m 0755 -d ${D}${sysconfdir}/init.d - install -m 0755 ${WORKDIR}/mount-vboxsf.sh ${D}${sysconfdir}/init.d/ + ln -s ${bindir}/mount-vboxsf.sh ${D}${sysconfdir}/init.d/ + + install -m 0755 -d ${D}${systemd_unitdir}/system + install -m 0644 ${WORKDIR}/mount-vboxsf.service ${D}${systemd_unitdir}/system/ } INITSCRIPT_NAME = "mount-vboxsf.sh" INITSCRIPT_PARAMS = "defaults 33" -inherit update-rc.d +SYSTEMD_SERVICE_${PN} = "mount-vboxsf.service" + +inherit update-rc.d systemd -- cgit v1.2.3-54-g00ecf