aboutsummaryrefslogtreecommitdiffstats
path: root/meta/classes/update-rc.d.bbclass
AgeCommit message (Collapse)Author
2014-09-23update-rc.d/systemd: Remove OVERRIDES dependencyRichard Purdie
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-09-03update-rc.d: fix logic in populate_packages_updatercdChen Qi
The 'and' logic for the check is wrong. To make things clear, please see the example below. Say that we have a recipe A, which has a sysv-init style init script named initA and no corresponding service file. The recipe inherits update-rc.d, but it doesn't inherit systemd.bbclass. The DISTRO_FEATURES has 'systemd' inside it, but it doesn't have 'sysvinit'. Now if we build an image, with the 'and' logic in the check, the symlinks for initA would not be installed into /etc/rc?.d directory. This is incorrect. Because there's no corresponding service. The symlinks in /etc/rc?.d/ should be created so that the service would be correctly started at boot time. The logic should really be 'or' in the check. This is actually what the code was when it was originally written. Several different situations are listed below to prove the correctness of the 'or' logic. If 'sysvinit' is in DISTRO_FEATURES, the initA script would always be installed with corresponding preisnt/postinst generated and added. If 'sysvinit' is not in DISTRO_FEATURES, we have three situations. 1) A has initA and A.service. In such situation, systemd.bbclass would set INHIBIT_UPDATERCD_BBCLASS, so no preinst/postinst about update-rc.d would be added and the symlinks for initA would not be created. 2) A has initA, and the functionality of initA is not implemented internally in systemd. In such situation, symlinks for initA would be installed. 3) A has initA, and the functionality of initA is implemented internally in systemd or in some other recipe. Examples for such situation are alsa-state and keymaps in OE. In such situation, we need to set INHIBIT_UPDATERCD_BBCLASS in the recipe so that there would be no preinst/postinst scripts about update-rc.d added. Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-06-10update-rc.d: Allow to use different initscripts providerMartin Jansa
* until now all recipes were respecting VIRTUAL-RUNTIME_initscripts variable but commit bba835fed88c3bd5bb5bd58962034aef57c408d8 hardcoded "initscripts" runtime dependency Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2014-06-06update-rc.d/useradd: Add additional dependeciesSaul Wold
These dependcies are needed to ensure that thier packages are created correctly since these classes have runtime dependiences in their packages but they are not actually created yet at rootfs time. [YOCTO #6072] Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-05-11update-rc.d: Handle multilib case for initscriptsSaul Wold
When building multilib, we also have to add the multlib prefix otherwise we get a WARNING: WARNING: Multilib QA Issue: lib32-dbus package lib32-dbus - suspicious values 'initscripts-functions' in RDEPENDS [YOCTO #6164] Signed-off-by: Saul Wold <sgw@linux.intel.com>
2014-04-25Globally replace oe.utils.contains to bb.utils.containsOtavio Salvador
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. Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-20update-rc.d.bbclass: fix inhibit checkKai Kang
In update-rc.d.bbclass it checks variable INHIBIT_UPDATERCD_BBCLASS to inhibit from inheriting this class. But it is wrong logic that when 'sysvinit' is in 'DISTRO_FEATURES', INHIBIT_UPDATERCD_BBCLASS will not be checked. Replace 'or' with 'and' to fix it. Signed-off-by: Kai Kang <kai.kang@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2014-02-12meta/recipes: Remove virtclass referencesRichard Purdie
The virtclass overrides will go away at some point (apart from the multilib one). Change them all to class-xxx instead since people enjoy copy and pasting them. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-02update-rc.d: automatically rdepend on initscripts-funtionsChen Qi
Automatically add 'initscripts-functions' to packages when needed. This extra dependency is added only when the package's init script would be used at system start-up. In other words, in a systemd based image, if the package has already got its service files, it will not have this extra dependency. Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-12-05classes/recipes: More optimal DISTRO_FEATURES referencesRichard Purdie
Using the contains function results in more optimal sstate checksums resulting in better cache reuse as we as more consistent code. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-10-31update-rc.d.bbclass: Cleanup package scriptsJacob Kroon
* Add proper preinst script * Use -n "$D"/-z "$D" checks throughout the scripts * Only set OPT in cases where its used * Don't pass unnecessary -f to update-rc.d in postrm script * Remove outdated comment Signed-off-by: Jacob Kroon <jacob.kroon@mikrodidakt.se> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-10-29update-rc.d.bbclass: Fix host/target test in postinstJacob Kroon
When running the postinst script I get a shell warning: sh: argument expected and the service is never stopped. This patch fixes the warning message and stops the service. Patch v2: Hans Beckérus pointed out that the patch is not correct. This version uses the syntax proposed by Hans. I've tested that the postinst script works correctly when run on the target, both when the init script exists and when it doesn't exist. Signed-off-by: Jacob Kroon <jacob.kroon@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-10-16update-rcd.bbclass: fix host/target testRoss Burton
"update-rc: Stop and remove service if updating package" (oe-core d91b08) had a bug in it's implementation of a "host or target" test which always resulted in "target", so the rootfs scripts were attempting to restart daemons on the host. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-10-14update-rc: Stop and remove service if updating packageFelipe F. Tonello
Since when updating packages packages managers do not remove the previous package, it just replaces new files and run pre/post install scripts. This causes not to update update-rc scripts if they were changed. This patch is useful in case the newer package version updated the update-rc script. Signed-off-by: Felipe F. Tonello <eu@felipetonello.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-10-04udpated-rc.d: Track postinst/prerm/postrm in task checksumRichard Purdie
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-09classes: Use modern exception raising syntaxRichard Purdie
Modern expection rasing syntax is function call format, convert to this to keep python 3 happy and model correct coding style in the core. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-04-10update-rc.d: correctly look up the initscript params with overridesRoss Burton
The creation of a clone of d with extra OVERRIDES was removed in 72c1fd72d3b479c728e249eaa763116d352e945b but some of the lookups are essential so that variables such as ${INITSCRIPT_PARAMS} get overriden and resolved correctly on a per-package basis. [ YOCTO #3960 ] Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-04-02update-rc.d, systemd: redirect also stderr from typeMartin Jansa
* different shells different behavior? bash prints 'type: update-rc.d: not found' on stderr busybox's sh on stdout Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-26update-rc.d/systemd: change communication variable nameRoss Burton
Rename SYSTEMD_BBCLASS_ENABLED to INHIBIT_UPDATERCD_BBCLASS to reflect the action, for clarity. Signed-off-by: Ross Burton <ross.burton@intel.com>
2013-03-26update-rcd: drop depends to recommends, check for update-rcd in scriptsRoss Burton
Signed-off-by: Ross Burton <ross.burton@intel.com>
2013-03-26update-rcd.bbclass: handle both sysvinit and systemd features being presentRoss Burton
Run the helper if the sysvinit feature is present, or if the systemd feature is present but the systemd class hasn't been inherited. We want to run in the latter case as systemd has sysvinit compatibility, but we don't want to always run so that pure systemd images don't have redundant sysvinit files. Signed-off-by: Ross Burton <ross.burton@intel.com>
2013-02-17classes: Drop none package specific packaging variable accessesRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-11update-rc.d: don't do anything if systemd.bbclass is inheritedRoss Burton
We need the update-rc.d class to work when systemd is being used so that packages that only have SysV init scripts still work. However if a recipe supports both we don't want to install SysV and systemd files under systemd. To solve this, before doing real work in update-rc.d check if the systemd class has been inherited and don't do anything if it has. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-08Revert: update-rc.d: disable update-rc.d.bbclass when systemd enabledSaul Wold
This was just wrong - when systemd is being used there'll still be packages that use SysV-style init scripts, which systemd supports fine. This reverts commit b94227f7290796f6ebbe5c5ff1680b9b689022b1. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-01-20update-rc.d: disable update-rc.d.bbclass when systemd enabledRadu Moisan
update-rc.d is not necessary when systemd is enabled, systemctl is the replacement Signed-off-by: Radu Moisan <radu.moisan@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-01-18update-rc.d:fix support postrm at image creation timeHongxu Jia
updatercd_postrm failed at image creation time because "-f -r ${D}" is not used as update-rc.d's option. [YOCTO #3633] Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-11-02classes: replace virtclass-native(sdk) with class-native(sdk)Robert Yang
The overrides virtclass-native and virtclass-nativesdk are deprecated, which should be replaced by class-native and class-nativesdk. [YOCTO #3297] Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2012-07-19Convert tab indentation in python functions into four-spaceRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-05meta: Convert getVar/getVarFlag(xxx, 1) -> (xxx, True)Richard Purdie
Using "1" with getVar is bad coding style and "True" is preferred. This patch is a sed over the meta directory of the form: sed \ -e 's:\(\.getVar([^,()]*, \)1 *):\1True):g' \ -e 's:\(\.getVarFlag([^,()]*, [^,()]*, \)1 *):\1True):g' \ -i `grep -ril getVar *` Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-02-24update-rc.d.bbclass: do nothing for extended cross packagesOtavio Salvador
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-12-16update-rc.d.bbclass: override UPDATERCD for nativesdkBernhard Guillon
Override UPDATERCD for nativesdk. Without, update-rc.d is installed to /usr/sbin/update-rc.d with meta-toolchain if nativesdk recipe inherits update-rc.d. An example recipe for this is dbus. Signed-off-by: Bernhard Guillon <Bernhard.Guillon@hale.at> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-26getVar/setVar cleanupsRichard Purdie
Complete the bb.data.getVar/setVar replacements with accesses directly to the data store object. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-10Convert to use direct access to the data store (instead of bb.data.*Var*())Richard Purdie
This is the result of running the following over the metadata: sed \ -e 's:bb.data.\(setVar([^,()]*,[^,()]*\), *\([^ )]*\) *):\2.\1):g' \ -e 's:bb.data.\(setVarFlag([^,()]*,[^,()]*,[^,()]*\), *\([^) ]*\) *):\2.\1):g' \ -e 's:bb.data.\(getVar([^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \ -e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \ -e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^() ]*\) *):\2.\1):g' \ -e 's:bb.data.\(getVar([^,()]*\), *\([^) ]*\) *):\2.\1):g' \ -i `grep -ril bb.data *` Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-24update-rc.d.bbclass: Changed RDEPENDS for nativeSaul Wold
Signed-off-by: Saul Wold <sgw@linux.intel.com>
2010-12-30update-rc.d: Allow the primary deamon package to be specified in UPDATERCPN, ↵Richard Purdie
update gsmd to use this Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-08-17update-rc.d.bbclass: adjust order on tweaking postinstKevin Tian
So far unlike prerm/postrm, update-rc.d has its own postinst method prepended to pkg_postinst, which may result "System startup links for xxx already exist" warning in the 1st boot of target image. Some pkg_postinst requires to run on the target, and thus prepend here makes update-rc.d method executed twice: one in rootfs creation and the other in the 1st target boot. So adjust the order to append. Signed-off-by: Kevin Tian <kevin.tian@intel.com>
2009-11-16update-rc.d: Add native version, add native dependency to class, convert ↵Richard Purdie
staging function Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13classes: Remove and sanitise import statementsRichard Purdie
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-01-07update-rc.d.bbclass: Only change the main package RDEPENDS, not all the ↵Richard Purdie
RDEPENDS as this affects things like the -doc packages
2008-07-29update-rc.d.bbclass: add code at start of post install scripts so it will be ↵Marcin Juszkiewicz
called on host git-svn-id: https://svn.o-hand.com/repos/poky/trunk@4976 311d38ba-8fff-0310-9ca6-ca027cbcb966
2007-08-06update-rc.d.bbclass: Tweak changeRichard Purdie
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@2370 311d38ba-8fff-0310-9ca6-ca027cbcb966
2007-08-06update-rc.d.bbclass: Stop the class corrupting the D variableRichard Purdie
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@2369 311d38ba-8fff-0310-9ca6-ca027cbcb966
2006-11-20classes: Sync with OE - mainly quoting fixes or other minor updatesRichard Purdie
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@885 311d38ba-8fff-0310-9ca6-ca027cbcb966
2006-11-20Fix whitespaceRoss Burton
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@883 311d38ba-8fff-0310-9ca6-ca027cbcb966
2006-11-20update-rc.d.bbclass: 'Fix' whitespaceRichard Purdie
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@881 311d38ba-8fff-0310-9ca6-ca027cbcb966
2006-11-20classes: Standardise whitespace in anonymous python methods and factor out ↵Richard Purdie
functions for more efficent use by bitbake (as also patched in OE) git-svn-id: https://svn.o-hand.com/repos/poky/trunk@875 311d38ba-8fff-0310-9ca6-ca027cbcb966
2006-07-21Rename /openembedded/ -> /meta/Richard Purdie
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@530 311d38ba-8fff-0310-9ca6-ca027cbcb966