summaryrefslogtreecommitdiffstats
path: root/meta/classes/systemd.bbclass
Commit message (Collapse)AuthorAgeFilesLines
* systemd.bbclass: improve error message when a service unit specified in ↵Chris Laplante2021-01-211-1/+2
| | | | | | | | | | | | | | SYSTEMD_SERVICE is not found The previous message was fairly useless without diving into the bbclass. (From OE-Core rev: 7dfef3de5811002c7cab17c5eb2801e5a55a3a4d) Signed-off-by: Chris Laplante <mostthingsweb@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit ef6117b148be65536e89409a83cbfd22049c652e) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* systemd.bbclass: enable all services specified in ${SYSTEMD_SERVICE}Mikko Rapeli2019-10-191-5/+1
| | | | | | | | | | | | | | | | | | | This has been the traditional way of enabling systemd services. It may conflict with presets feature, but other layers, image classes and recipes add services to be enabled using SYSTEMD_SERVICE variable also with read-only rootfs, e.g. IMAGE_FEATURES has stateless-rootfs and systemd_preset_all task is not executed. Fixes startup of custom services from our recipes using custom image classes with various BSP layers. In the worst case even serial console getty service wasn't starting due to dependency no not enabled services. (From OE-Core rev: 68a10763e64764a0d43be9162e7b99833f5296db) Signed-off-by: Mikko Rapeli <mikko.rapeli@bmw.de> Cc: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* systemd.bbclass: add RMINITDIR for nativesdk buildsTrevor Gamblin2019-10-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | nativesdk builds such as nativesdk-dnf are installing systemd service files, leading bitbake to throw installed-vs-shipped warnings, but these are not needed in nativesdk: WARNING: nativesdk-dnf-4.2.2-r0 do_package: QA Issue: nativesdk-dnf: Files/directories were installed but not shipped in any package: /usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/lib /usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/lib/systemd /usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/lib/systemd/system /usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/lib/systemd/system/dnf-automatic.timer /usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/lib/systemd/system/dnf-makecache.timer /usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/lib/systemd/system/dnf-automatic.service /usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/lib/systemd/system/dnf-makecache.service /usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/lib/systemd/system/dnf-automatic-notifyonly.timer /usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/lib/systemd/system/dnf-automatic-download.service /usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/lib/systemd/system/dnf-automatic-download.timer /usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/lib/systemd/system/dnf-automatic-notifyonly.service /usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/lib/systemd/system/dnf-automatic-install.timer /usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/lib/systemd/system/dnf-automatic-install.service Please set FILES such that these items are packaged. Alternatively if they are unneeded, avoid installing them or delete them within do_install. nativesdk-dnf: 13 installed and not shipped files. [installed-vs-shipped] Rather than have each recipe remove the files, an RMINITDIR case for nativesdk builds should be added to systemd.bbclass. (From OE-Core rev: 86092fdac2ed2935b25a6c05f16055df77a10575) Signed-off-by: Trevor Gamblin <trevor.gamblin@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* systemd.bbclass: Limit rm_sysvinit_initddir and rm_systemd_unitdir to target ↵Khem Raj2019-08-211-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | alone These postfuncs cause native recipes to rebuild when changing system init provider between sysvinit and systemd. Some of these native recipes are pretty early in dependency chain ( e.g. util-linux ) which can casue rebuild of pretty much everything including compiler. Found with bitbake-diffsigs Hash for dependent task python/python3_3.7.4.bb:do_prepare_recipe_sysroot:virtual:native:/mnt/a/yoe/sources/openembedded-core/meta/recipes-devt ools/python/python3_3.7.4.bb changed from 2a45fe0cd0d3640a88c4a5c8b1880c4e9a089cc7446a91d2a920c1cef6fa916a to bc2a0921cce50da1b7be3b59a3d8211ec 2a31262493ffa5909acbb7116fad3bf Hash for dependent task util-linux/util-linux_2.34.bb:do_populate_sysroot:virtual:native:/mnt/a/yoe/sources/openembedded-core/meta/recipes- core/util-linux/util-linux_2.34.bb changed from 15d6e165f025f10c2c455df8a875cafe021eaed4214c793e708d4827a58ca89d to 54e542d5da99cacfc9290ef5d27 9de50bdcb9195f67ae6dfff59fe41d10f7bd2 Hash for dependent task util-linux/util-linux_2.34.bb:do_install:virtual:native:/mnt/a/yoe/sources/openembedded-core/meta/recipes-core/ util-linux/util-linux_2.34.bb changed from e25b1119ce8dd7ca43fbd2db771e04fa6ff6b9d701fd78ac6c443224b036ed9f to bb5b172a83e7edd272402a9dcd80c4e1 29aa1ecb824c2cfa388086cfed24fef5 basehash changed from 62df6610eab9c1b1a17d7132943507641c8538690f26186843c86144d4598e64 to 80471f7c0bded9d1b593da69708b0e0f10882db08 5e1bf769edb3018e6c744d0 Variable rm_sysvinit_initddir value changed: @@ -11,4 +11,4 @@ shutil.rmtree(sysv_initddir) DISTRO_FEATURES{systemd} = Unset -DISTRO_FEATURES{sysvinit} = Set +DISTRO_FEATURES{sysvinit} = Unset (From OE-Core rev: f2d60e0f6a8e93cb0779f4719e58b99ad01fb954) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* systemd: Restore mask and preset targets, fix instance creationAlex Kiernan2019-05-091-9/+28
| | | | | | | | | | | | | | | Ensure that anyone who sets SYSTEMD_AUTO_ENABLE_${PN} = "mask" (or "preset") retains the previous behaviour. In addition fix "enable" so it can (again) create instance units out of templates. Remove over-zealous quoting of SYSTEMD_SERVICE_ESCAPED as it's already safely escaped (and can be multiple arguments). Reported-by: Paul Barker <paul@betafive.co.uk> (From OE-Core rev: e9444649f49431a8e203e6e2009a1de05e505007) Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* systemd: create preset files instead of installing in imageJonas Bonn2019-05-031-22/+19
| | | | | | | | | | | | | | | | | | | At first boot, systemd will create the /etc/systemd/system directory from service preset files. As such, for a normal, writable /etc (writable rootfs), there is no need to set up this directory at image creation time. This patch changes the systemd machinery to create preset files and to rely on systemd to do the service enablement. This breaks the read-only-rootfs case; there's a fix for this in a follow-up patch. (From OE-Core rev: 154abbc3296eded11d2bbe3e102470b6986d42cd) Signed-off-by: Jonas Bonn <jonas@norrbonn.se> Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meta: remove True option to getVar calls (again)André Draszik2019-01-141-1/+1
| | | | | | | | | | | | | | | | A couple have still been missed in the past despite multiple attempts at doing so (or simply have re-appeared?). Search & replace made using the following command: sed -e 's|\(d\.getVar \?\)( \?\([^,()]*\), \?True)|\1(\2)|g' \ -i $(git grep -E 'getVar ?\( ?([^,()]*), ?True\)' \ | cut -d':' -f1 \ | sort -u) (From OE-Core rev: 9f551d588693328e4d99d33be94f26684eafcaba) Signed-off-by: André Draszik <andre.draszik@jci.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* systemd: escape paths passed to shellDamien Riegel2018-06-271-5/+9
| | | | | | | | | | | | | | | | | | | | | Systemd mount configuration file must have a name that match the mount point directory they control. So for instance, if a mount file contains [Mount] ... Where=/mnt/my-data The file must be named `mnt-my\x2ddata.mount`, or systemd will refuse to honour it. If this config file contains an [Install] section, it will silently fail because the unit file is not escaped properly when systemctl is called. To fix that, make sure paths are escaped through `shlex.quote`. (From OE-Core rev: bbd9524256461f1bcafd4103edd575e668de76f8) Signed-off-by: Damien Riegel <damien.riegel@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* systemd: allow dots in arguments to template unitsMartin Hundebøll2017-12-101-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | When installing systemd template units with an argument, the current code removes characters between the '@' and the '.' from service names in SYSTEMD_SERVICE_${PN}, e.g.: getty@tty1.service -> getty@.service This fails for services with dots in the argument (which is perfectly legal in systemd), since the code searches only until the first dot. E.g.: vlan@eth0.1.service -> vlan@1.service This is obviously wrong, and fails in systemd_populate_packages(), where it fails to find the unit file. Fix this by reworking the removal of the argument part of the service name, so that parts before '@' and after teh last '.' are used as base name. (From OE-Core rev: 4704bd91458a728f28cbdc57dcf78f5d04cfd0cd) Signed-off-by: Martin Hundebøll <mnhu@prevas.dk> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes: Drop now unneeded update_data callsRichard Purdie2017-02-151-1/+0
| | | | | | | | | | Now that the datastore works dynamically we don't need the update_data calls so we can just remove them. They're not actually done anything at all for a while. (From OE-Core rev: 8de0c5d3bd01919e2bf0394f9c485936d6098cec) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* systemd: Add PACKAGE_WRITE_DEPS for postinstRichard Purdie2017-01-201-0/+1
| | | | | | | | The postinstall needs systemd-systemctl-native, mark the dependency (From OE-Core rev: d2fb76e4aed927e9900de2e87e7e1b792bc88651) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meta/scripts: Various getVar/getVarFlag expansion parameter fixesRichard Purdie2017-01-091-1/+1
| | | | | | | | | | | | | | | | | There were a few straggling expansion parameter removals left for getVar/getVarFlag where the odd whitespace meant they were missed on previous passes. There were also some plain broken ussages such as: d.getVar('ALTERNATIVE_TARGET', old_name, True) path = d.getVar('PATH', d, True) d.getVar('IMAGE_ROOTFS', 'True') which I've corrected (they happend to work by luck). (From OE-Core rev: 688f7a64917a5ce5cbe12f8e5da4d47e265d240f) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meta: remove True option to getVar callsJoshua Lock2016-12-161-19/+19
| | | | | | | | | | | | | getVar() now defaults to expanding by default, thus remove the True option from getVar() calls with a regex search and replace. Search made with the following regex: getVar ?\(( ?[^,()]*), True\) (From OE-Core rev: 7c552996597faaee2fbee185b250c0ee30ea3b5f) Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* systemd.bbclass: don't block on service restartMark Asselstine2016-11-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current class works fine when a recipe uses SYSTEMD_AUTO_ENABLE 'enable' and has no on device pkg_postinst(), ie when the postinst is run as part of rootfs creation. However, when there is a component of pkg_postinst() that is run on device the 'systemctl restart' is run as part of the run_postinsts.service at boot. This results in the boot spinning indefinitely with: [ *** ] A start job is running for Run pending postinsts (7s / no limit) The issue could potentially be that the packages service has an 'After' clause which comes later in the boot, beyond run_postinsts.service, creating a chicken before the egg scenario. Even service files without an 'After' clause cause this situation however. Despite this not being the cause of the issue this fix will prevent this scenario from happenning. Using strace we are able to find that during boot, when run_postinsts.service is running attempting to start or restart any service will result in the call get stuck on poll(). Since the run_postinsts.service does not monitor the outcome of the call to restart we can work around this by using '--no-block'. (From OE-Core rev: 6ad6a0084a73088fc2a27ab9958e5c46d6e094fc) Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* systemd: Reload configuration on package installLinus Wallgren2016-11-231-0/+4
| | | | | | | | | | | When a systemd service file has changed it is required to reload systemd's configuration. Otherwise changes to a service file will not be picked up during package upgrade. (From OE-Core rev: 94efe6d1d7893e241bcf98eff80ac8d8fbf2e885) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* systemd.bbclass: Use bb.fatal() instead of raising FuncFailedUlf Magnusson2016-10-041-2/+1
| | | | | | | | | | | | | | | | | | | | | | | This sets a good example and avoids unnecessarily contributing to perceived complexity and cargo culting. Motivating quote below: < kergoth> the *original* intent was for the function/task to error via whatever appropriate means, bb.fatal, whatever, and funcfailed was what you'd catch if you were calling exec_func/exec_task. that is, it's what those functions raise, not what metadata functions should be raising < kergoth> it didn't end up being used that way < kergoth> but there's really never a reason to raise it yourself FuncFailed.__init__ takes a 'name' argument rather than a 'msg' argument, which also shows that the original purpose got lost. (From OE-Core rev: 8e956d66087b9c41591b8e4e817ed6c9e42f5981) Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* systemd.bbclass: Allow enabling of parameterised servicesBob Ham2015-12-091-0/+14
| | | | | | | | | | | | | | Currently the systemd.class will check whether a service exists when it is requested to enabled it. However, its check does not take into account that a service like 'foo@eth0.service' can be enabled from a service named 'foo@.service'. This patch alters the check function in systemd.class to look for 'foo@.service' if the normal check fails. (From OE-Core rev: 4ce15271dad3520e5de2500c609b05d5a511e453) Signed-off-by: Bob Ham <bob.ham@collabora.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* systemd.bbclass: Use systemd_system_unitdirPau Espin Pedrol2015-08-101-5/+4
| | | | | | | (From OE-Core rev: 0cd61456c0ae912b9fa525db1b3c811e01349d27) Signed-off-by: Pau Espin Pedrol <pau.espin@aweurope.be> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* systemd.bbclass: drop has_exactly_one_service settingDmitry Eremin-Solenikov2015-05-141-3/+0
| | | | | | | | | | | The has_exactly_one_service variable was used in now deleted code. Drop this part to make code cleaner. (From OE-Core rev: 8acee5a86efd146186e0de1c41d0e4e4223d8b36) Signed-off-by: Dmitry Eremin-Solenikov <dmitry_eremin@mentor.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* systemd: don't add files and dependencies from units ConflictsRoss Burton2014-11-041-4/+1
| | | | | | | | | | | Adding dependencies and moving files based on Conflicts tags in unit files isn't right, mainly as it means that systemd depends on systemd-binfmt, because the latter ends up containing the shutdown.target unit. (From OE-Core rev: 02767aac492cedf6ccd02648b8e65751cc23c11c) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* update-rc.d/systemd: Remove OVERRIDES dependencyRichard Purdie2014-09-231-0/+2
| | | | | | | | | | | | | Taking run-postinsts and building for two machines which have different OVERRIDES leads to two different sets of stamps for an allarch package. We don't need to depend on OVERRIDES in these classes, the end resulting variables are good enough. We can therefore exclude the dependency and allow a single package to be generated for run-postinsts. (From OE-Core rev: fdc949154e64afb41dd4db3a97be74a15963128d) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* Globally replace oe.utils.contains to bb.utils.containsOtavio Salvador2014-04-251-6/+6
| | | | | | | | | | | BitBake has the exact same code as oe.utils.contains so there's no reason to duplicate it. We now rely on the bb.utils.contains code for metadata. (From OE-Core rev: 93499ebc46547f5bf6dcecd5a786ead9f726de28) Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* systemd: pass --root in prerm if running on hostRoss Burton2013-12-181-1/+7
| | | | | | | | | | | If a systemd image is built without a package manager then packages will be removed from an image during rootfs generation, but without passing --root the systemctl will look on the *host* system. (From OE-Core rev: d01da862d10d9544f8da846b577cf955041d4c0c) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes/recipes: More optimal DISTRO_FEATURES referencesRichard Purdie2013-12-051-8/+7
| | | | | | | | | Using the contains function results in more optimal sstate checksums resulting in better cache reuse as we as more consistent code. (From OE-Core rev: 9c93526756e7cbbff027c88eb972f877bcb1f057) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* systemd: fix commentsPaul Eggleton2013-11-141-2/+2
| | | | | | | | | It's DISTRO_FEATURES; DISTRO_FEATURE is invalid. (From OE-Core rev: d2380c683d5411e7a85c3ce80115aea329187534) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* systemd: Track postinst/prerm in task checksumRichard Purdie2013-10-071-0/+3
| | | | | | | | | | When these functions change, the package should rebuild but currently it does not. We need to add the dependencies manually as the dependency code can't track dynamically created variables. (From OE-Core rev: c5d7100a358244085a697a23790676df5eb4afa3) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* systemd.bbclass: get the correct /lib directorySaul Wold2013-09-101-3/+3
| | | | | | | | | | | By using os.path.dirname(systemd_unitdir) we get the correct /lib directory instead of dealing with possibly multilib directories. This address a QA Error for shipped/not installed /lib with multilib and x32. (From OE-Core rev: 5b451a46550ba62e2fbfe5dbe50723b34a4fd527) Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* systemd: Remove base_libdir if installed only for systemd_unitdirMuhammad Shakeel2013-09-101-0/+3
| | | | | | | | | | | | | | | | | | | If a recipe installs systemd_unitdir and it is a non-systemd build than systemd.bbclass deletes systemd_unitdir (/lib/systemd/) but not base_libdir (/lib). In this case if base_libdir is empty than following QA Issue is reported. ERROR: QA Issue: openssh: Files/directories were installed but not shipped /lib If base_libdir was installed due to systemd_unitdir installation than for non-systemd build it should also be removed. (From OE-Core rev: c700cb21c189e23a78f0efaaf763259c8cfefa4d) Signed-off-by: Muhammad Shakeel <muhammad_shakeel@mentor.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* systemd: Remove init.d dir if systemd unit file is present and sysvinit not ↵Muhammad Shakeel2013-07-311-0/+15
| | | | | | | | | | | | | | a distro feature If systemd is supported DISTRO_FEATURE and sysvinit is not and also if systemd_unitdir contains anything then no need to keep init.d scripts for sysvinit compatibility. (From OE-Core rev: 823c90ad344ca2205f3055e2dcae08c6616f29b7) Signed-off-by: Muhammad Shakeel <muhammad_shakeel@mentor.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* systemd: Remove systemd_unitdir if systemd is not in distro featuresMuhammad Shakeel2013-07-241-0/+9
| | | | | | | | | | | If systemd is not supported DISTRO_FEATURE than there is no need to package related service files. (From OE-Core rev: ac5d20f4adac69ea1702694fb50849c9e465b443) Signed-off-by: Muhammad Shakeel <muhammad_shakeel@mentor.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* systemd: Don't enable systemd services when native.Randy Witt2013-07-101-0/+2
| | | | | | | | | | | | It shouldn't be desired that systemd enable services when using class native. Blanking out the SYSTEMD_PACKAGES when native seems like the most straightforward way to fix this problem. (From OE-Core rev: e0ce07010d2e818dc43ffdff6f3cdd94f18d7af5) Signed-off-by: Randy Witt <rewitt@declaratino.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes: Use modern exception raising syntaxRichard Purdie2013-05-091-2/+2
| | | | | | | | | Modern expection rasing syntax is function call format, convert to this to keep python 3 happy and model correct coding style in the core. (From OE-Core rev: f4b382754603d3f1caa13824bcc8d06b568bbc59) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* systemd.bbclass: restart service in postinst, not startRoss Burton2013-04-091-1/+1
| | | | | | | | | | | | | | | | | When upgrading packages it's possible that the service is already running because opkg doesn't actually execute the prerm hooks on upgrades, which is where the service should be stopped. Handle this case by restarting in postinst instead of starting. If the service isn't already running then this doesn't make a difference, but if it is running then the service will be restarted. [ YOCTO #4213 ] (From OE-Core rev: 319ef0df4ae7ed0372eff90e11244123eccb023c) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* update-rc.d, systemd: redirect also stderr from typeMartin Jansa2013-04-021-2/+2
| | | | | | | | | | * different shells different behavior? bash prints 'type: update-rc.d: not found' on stderr busybox's sh on stdout (From OE-Core rev: 45e22312c48b23480bd6dff98702b0691a48f7d1) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* update-rc.d/systemd: change communication variable nameRoss Burton2013-03-261-4/+7
| | | | | | | | | | Rename SYSTEMD_BBCLASS_ENABLED to INHIBIT_UPDATERCD_BBCLASS to reflect the action, for clarity. (From OE-Core rev: cf43320c343437659aee94acd005bf7712f273cd) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* systemd: check for systemctl first, and don't force systemd to be installed.Ross Burton2013-03-261-16/+11
| | | | | | | | | | With both sysvinit and systemd features enabled these postinsts may actually run on a target without systemd, so check that systemctl is present before using it. (From OE-Core rev: ac00e56cb9daacef17a6fdebe7b8ca1667b7e1c4) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* systemd.bbclass: fix bb.errorMartin Jansa2013-03-011-1/+1
| | | | | | | | | | | | NOTE: recipe avahi-ui-0.6.31-r7.0: task do_package: Started ERROR: %s does not appear in package list, please add it avahi-ui-daemon ERROR: %s does not appear in package list, please add it avahi-ui-dnsconfd (From OE-Core rev: 36a2bae816b1abf776d0f1a2b6b2c3d9a861a4ca) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* systemd.bbclass: Dont use libdir and base_libdir for unitsKhem Raj2013-02-151-4/+9
| | | | | | | | | | | | | | | | systemd always uses /lib and /usr/lib to store unit files so using libdir and base_libdir is incorrect. It will work where libdir is usr/lib and base_libdir is /lib but wont work when say its /lib64 Add a check to make sure that SYSTEMD_PACKAGES are part of PACKAGES too, otherwise error out (From OE-Core rev: 22e16f44b58ae6bbf719b9074d39aac065a402f1) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* systemd.bbclass: use PACKAGESPLITFUNCS instead of populate_packages_prependRoss Burton2013-02-111-7/+7
| | | | | | | | | This is cleaner and leads to more accurate profiles. (From OE-Core rev: eed7294ba9aedf47af5c64ff11777015e59f48ef) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* systemd.bbclass: helper class for recipes with systemd unitsRoss Burton2013-02-111-0/+158
This class adds postinst/prerm scripts to start/stop/enable/disable the services as relevant, and some magic to ensure the service files are installed. Based on (but not the same as) the systemd.bbclass in meta-systemd, so thanks to the following for their work there: Enrico Scholz <enrico.scholz@sigma-chemnitz.de> Khem Raj <raj.khem@gmail.com> Martin Jansa <Martin.Jansa@gmail.com> Andreas Müller <schnitzeltony@googlemail.com> Koen Kooi <koen@dominion.thruhere.net> (From OE-Core rev: f4bf51612f8be1d3dd340fc456f3fa08fcfa34ef) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>