Commit Graph

63 Commits

Author SHA1 Message Date
Richard Purdie bfd0a39bdf classes: Drop now unneeded update_data calls
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>
2017-02-15 09:29:55 -08:00
Jussi Kukkonen b699afaeb8 update-rc.d: Add PACKAGE_WRITE_DEPS for postinst
use_updatercd() will always return true in rootfs generation so
checking that is not required.

(From OE-Core rev: 0db5328ee2a80152904b9f82b738f92e9e38da55)

Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-20 11:53:50 +00:00
David Vincent fc89a3f739 classes: Fix alternatives and rc.d ordering
When using an alternative as an initscript, the ordering between
update-rc.d and update-alternatives tasks during prerm and postinst
tasks must always be the following in order to work:
  * prerm:
    - stop daemon
    - remove alternative

  * postinst:
    - add alternative
    - start daemon

This patchset adds comments to the scripts generated by both classes and
organize the generated sections based on those comments.

[YOCTO #10433]

Changes since v5:
    - Remove boolean in d.getVar() calls

(From OE-Core rev: aa87b1a4dcc14e4dfe719b6c55045c5662bc59c2)

Signed-off-by: David Vincent <freesilicon@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-09 13:39:11 +00:00
Joshua Lock c4e2c59088 meta: remove True option to getVar calls
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>
2016-12-16 10:23:23 +00:00
Andreas Oberritter b4da2b0040 update-rc.d: ignore initscript in prerm and preinst when systemd is active
In hybrid systemd/sysvinit builds, if the recipe inherits systemd and systemd
is installed, we can safely assume that the service gets stopped by the prerm
script fragment from systemd.bbclass. This fixes deinstallation of packages
with initscripts returning errors when no running service was found. The preinst
shouldn't run the initscript either, because postinst will call systemctl restart.

(From OE-Core rev: f2cc0fdfd97b097145e40bc52674e17378cec863)

Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-08 10:31:30 +00:00
Markus Lehtonen 83e4e27246 update-rc.d.bbclass: ignore init script return code
We need to ignore the return code from the init script 'stop' command in
the preinst and prerm scriptlets. Otherwise package upgrade or
deinstallation (at least when opkg is used) is likely to fail if the
daemon is not running. That is because an init script possibly returns
'1' if you try to stop a service that is not running which, in turn,
causes the scriptlet to fail which, in turn, causes the package
(de-)installation to fail.

[YOCTO #10299]

(From OE-Core rev: daa3c266a7ffa060b52381fa00df518102fceda8)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-11 22:19:21 +01:00
Markus Lehtonen ac647ea696 update-rc.d.bbclass: check that init script is executable before running it
Check that the init script that is going to be called in the prerm()
script really exists and is executable. There might be a packaging bug
or the script might've been removed already earlier in prerm().

[YOCTO #10299]

(From OE-Core rev: aabb87c9dbd60fe9467ca0354ec05c275a3f1b1a)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-07 16:53:18 +01:00
Ulf Magnusson 7f22c97be3 update-rc.d.bbclass: Use bb.fatal() instead of raising FuncFailed
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: a77b4e543407eee133fbd38ac9b69e90bea541e0)

Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-04 16:29:04 +01:00
Mariano Lopez 1ed0e8a0e6 update-rc.d.bbclass: Disable class when sysvinit is not in DISTRO_FEATURES
When sysvinit is not in use, update-rd.d class adds build dependencies
that won't be needed, this patch removes the build dependecies and
won't add the task to PACKAGESPLITFUNCS.

[YOCTO #9515]

(From OE-Core rev: 5b2139a79cd8c280e755923016b3a6e84413184e)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-15 18:05:21 +01:00
Christopher Larson 67ecba4be0 update-rc.d.bbclass: explicitly dep on initscripts
update-rc.d doesn't just want an initscripts package, it wants
initscripts-functions. In the case where VIRTUAL-RUNTIME_initscripts is set to
nothing, update-rc.d still needs initscripts-functions to satisfy its runtime
dependencies. Further, we shouldn't be using a *runtime* virtual in a *build
time* variable. This should resolve image creation failures with
configurations without sysv initscripts when a recipe inherits update-rc.d and
doesn't inherit systemd.

(From OE-Core rev: e6642ae0849e5ac3174c643a7693af25d829d6d1)

(From OE-Core rev: 833302761df924bb503cc2ad04ecae1023381f8f)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-30 12:35:58 +01:00
Richard Purdie d9411412d2 updated-rc.d: Only add dependencies in target case
Avoid errors like:
  ERROR: Nothing PROVIDES 'nativesdk-update-rc.d' (but virtual:nativesdk:dbus_1.8.18.bb
  DEPENDS on or otherwise requires it).

(From OE-Core rev: 270a1716b02981aad353c266d3d19735fc85cf10)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-26 09:14:30 +01:00
Richard Purdie 6381d45db7 update-rc.d: Include updated-rc.d in DEPENDS
If you build a user of updated-rc.d like udev, as things stand currently
nothing pulls in updated-rc.d but there is a dependency added on the
package at do_package time. This can lead to errors during rootfs
construction either with licensing. The fact its a RRECOMMEND means
the image are not deterministic.

A particularly good test case for reproducing this is:

MACHINE=A bitbake core-image-minimal
MACHINE=B bitbake core-image-minimal-initramfs

and since the second machine can find the package but not the license
manifest, a failure will result.

Extending the DEPENDS is the easy way to fix the issues.

(From OE-Core rev: 164b1b54c4b3127733bcd0a21b379bb6869693cc)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-25 23:06:59 +01:00
Richard Purdie 86d30d756a meta: Add explict getVar param for (non) expansion
Rather than just use d.getVar(X), use the more explict d.getVar(X, False)
since at some point in the future, having the default of expansion would
be nice. This is the first step towards that.

This patch was mostly made using the command:

sed -e 's:\(getVar([^,()]*\)\s*):\1, False):g' -i `grep -ril getVar *`

(From OE-Core rev: ab7c1d239b122c8e549e8112c88fd46c9e2b061b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-23 11:57:25 +01:00
Robert Yang ad9542cf26 update-rc.d.bbclass: add MLPREFIX when set RRECOMMENDS
Fixed when build with multilib:
WARNING: Multilib QA Issue: lib32-alsa-state package lib32-alsa-state - suspicious values 'update-rc.d' in RRECOMMENDS
WARNING: Multilib QA Issue: lib32-modutils-initscripts package lib32-modutils-initscripts - suspicious values 'update-rc.d' in RRECOMMENDS
WARNING: Multilib QA Issue: lib32-init-ifupdown package lib32-init-ifupdown - suspicious values 'update-rc.d' in RRECOMMENDS
WARNING: Multilib QA Issue: lib32-xserver-nodm-init package lib32-xserver-nodm-init - suspicious values 'update-rc.d' in RRECOMMENDS
WARNING: Multilib QA Issue: lib32-sysklogd package lib32-sysklogd - suspicious values 'update-rc.d' in RRECOMMENDS

(From OE-Core rev: 43e8192606444c339ef732d611d4cbc18dee21e4)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-11 23:59:16 +01:00
Richard Purdie 3b627bb28c update-rc.d: Improve RRECOMMENDS handling
Unfortunately the combination of:

RRECOMMENDS_${PN} = "X"
UPDATERCPN = "${PN}"
RRECOMMENDS_${UPDATERCPN}_append = "Y"

is tricky for bitbake to order correctly since RRECOMMENDS_${UPDATERCPN} can
become "Y" which can then completely overwrite RRECOMMENDS_${PN}.

Avoid these issues and improve handling in general by explictly setting
the RRECOMMENDS on the list of packages modified in the general
code.

(From OE-Core rev: 053b8a4e6b9a4b02c0b1b4bc1e297a1251a901a9)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-29 10:17:14 +01:00
Chen Qi 3d7c798dff update-rc.d: use '-f' option in updatercd_postrm
Use '-f' ('--force') option so that while removing packages using deb,
we don't fail because of the following error:

   update-rc.d: $initd/$bn exists during rc.d purge (use -f to force)

Using '-f' option would make this a warning but continue to execute.

   update-rc.d: $initd/$bn exists during rc.d purge (continuing)

We need this option because dpkg package backend have special handling for
configuration files. And if files under /etc/init.d are treated as configuration
files, we will have errors.

(From OE-Core rev: ebb2d557bbf410d98040cdaabbddd7e3ee0a9709)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-17 22:35:03 +00:00
Richard Purdie 4ebd2e4915 update-rc.d/systemd: Remove OVERRIDES dependency
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>
2014-09-23 21:38:59 +01:00
Chen Qi ee05cc8359 update-rc.d: fix logic in populate_packages_updatercd
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.

(From OE-Core rev: 6272c81509bbdb5d602056ceaa6f2c02bbf47a41)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-09-03 11:09:04 +01:00
Martin Jansa f365b56590 update-rc.d: Allow to use different initscripts provider
* until now all recipes were respecting VIRTUAL-RUNTIME_initscripts
  variable but commit bba835fed88c3bd5bb5bd58962034aef57c408d8
  hardcoded "initscripts" runtime dependency

(From OE-Core rev: 8b4256758ba55dcabe80dd1bf3884cdf1cc39909)

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>
2014-06-10 17:24:19 +01:00
Saul Wold f39d8765b1 update-rc.d/useradd: Add additional dependecies
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]

(From OE-Core rev: bba835fed88c3bd5bb5bd58962034aef57c408d8)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-06-06 10:25:40 +01:00
Saul Wold a4d931edd1 update-rc.d: Handle multilib case for initscripts
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]

(From OE-Core rev: 2e14dbb7f85532220f9aec293ddd4143fae8407b)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-05-11 12:27:22 +01:00
Otavio Salvador 08a38a7865 Globally replace oe.utils.contains to bb.utils.contains
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>
2014-04-25 17:19:19 +01:00
Kai Kang 27b81efd3a update-rc.d.bbclass: fix inhibit check
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.

(From OE-Core rev: a0353102184892f09d3f97f018e457a4684550ea)

Signed-off-by: Kai Kang <kai.kang@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-21 16:09:07 +00:00
Richard Purdie 4db39d233c meta/recipes: Remove virtclass references
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.

(From OE-Core rev: d1c073d2813bd913617990cd047507353ea0c09e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-13 11:41:21 +00:00
Chen Qi 021129ab0b update-rc.d: automatically rdepend on initscripts-funtions
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.

(From OE-Core rev: de875cb8893fd8372dd77babaef54ab2d790693d)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-02 11:22:11 +00:00
Richard Purdie 6ab56c54f3 classes/recipes: More optimal DISTRO_FEATURES references
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>
2013-12-05 14:24:43 +00:00
Jacob Kroon 717c1ed719 update-rc.d.bbclass: Cleanup package scripts
* 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

(From OE-Core rev: 2d9114aaf130179cb13c20c8b045c2694eca6fd9)

Signed-off-by: Jacob Kroon <jacob.kroon@mikrodidakt.se>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-11-01 11:09:04 +00:00
Jacob Kroon 76751a03b1 update-rc.d.bbclass: Fix host/target test in postinst
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.

(From OE-Core rev: 7e23557835f756b22b95fa7a1926b5d1d21872c3)

Signed-off-by: Jacob Kroon <jacob.kroon@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-10-29 10:45:21 +00:00
Ross Burton 529bf977e9 update-rcd.bbclass: fix host/target test
"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.

(From OE-Core rev: 2b179d90eacc58f0b217f64407782a9174362850)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-10-16 14:51:07 +01:00
Felipe F. Tonello 86bb78cc53 update-rc: Stop and remove service if updating package
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.

(From OE-Core rev: d91b08f3a27baa49ae35dc20dba1b2d76e6abd64)

Signed-off-by: Felipe F. Tonello <eu@felipetonello.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-10-14 16:55:26 +01:00
Richard Purdie 479fcbfd30 udpated-rc.d: Track postinst/prerm/postrm in task checksum
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: 4003218f774c38bb5de0d95a43153f8b8d7fc4ce)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-10-07 09:37:31 +01:00
Richard Purdie db8217f6b8 classes: Use modern exception raising syntax
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>
2013-05-09 14:06:50 +01:00
Ross Burton 8cab6d76f8 update-rc.d: correctly look up the initscript params with overrides
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 ]

(From OE-Core rev: b016bc9aaabc90fe4dc98af8c5e73dfcb4526ef4)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-04-10 12:56:52 +01:00
Martin Jansa c0910f26ea update-rc.d, systemd: redirect also stderr from type
* 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>
2013-04-02 18:16:24 +01:00
Ross Burton d82e303921 update-rc.d/systemd: change communication variable name
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>
2013-03-26 22:43:03 +00:00
Ross Burton 49ae578774 update-rcd: drop depends to recommends, check for update-rcd in scripts
(From OE-Core rev: 2c403979c03898c679c5a1e1092aec784dbeb77c)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-26 22:43:03 +00:00
Ross Burton 55ba8ea863 update-rcd.bbclass: handle both sysvinit and systemd features being present
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.

(From OE-Core rev: a3856ab19f1d4ae312f559521785ad4384700729)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-26 22:43:03 +00:00
Richard Purdie 069a332d1c classes: Drop none package specific packaging variable accesses
(From OE-Core rev: 24cbe88429ba021d7c461e0271b67106d11d5eb2)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-17 22:32:03 +00:00
Ross Burton 3936cef145 update-rc.d: don't do anything if systemd.bbclass is inherited
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.

(From OE-Core rev: 0273a22fec3c9360df2510b759c5bf9af610551f)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-11 14:46:10 +00:00
Saul Wold d69d193a96 Revert: update-rc.d: disable update-rc.d.bbclass when systemd enabled
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 b94227f729.

(From OE-Core rev: 3f50b61c77406f87d36437cca53573f86f314641)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-08 14:50:36 +00:00
Radu Moisan b94227f729 update-rc.d: disable update-rc.d.bbclass when systemd enabled
update-rc.d is not necessary when systemd is enabled,
systemctl is the replacement

(From OE-Core rev: eaa82c842d3197e0251a887ba16028c22f9d8d94)

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-20 12:58:55 +00:00
Hongxu Jia ee5333b0bd update-rc.d:fix support postrm at image creation time
updatercd_postrm failed at image creation time because "-f -r ${D}" is not
used as update-rc.d's option.

[YOCTO #3633]

(From OE-Core rev: deb8ac868a989f41c0664312a5fb855358be2296)

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-01-18 13:28:08 +00:00
Robert Yang 51c7ad682f classes: replace virtclass-native(sdk) with class-native(sdk)
The overrides virtclass-native and virtclass-nativesdk are deprecated,
which should be replaced by class-native and class-nativesdk.

[YOCTO #3297]

(From OE-Core rev: 9fbeab63315fef0dbcc91c5e7051665764758a6e)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-11-02 16:18:27 +00:00
Richard Purdie bfd279de32 Convert tab indentation in python functions into four-space
(From OE-Core rev: 604d46c686d06d62d5a07b9c7f4fa170f99307d8)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-19 10:24:50 +01:00
Richard Purdie 06f2f8ce0a meta: Convert getVar/getVarFlag(xxx, 1) -> (xxx, True)
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-03-05 10:22:56 -08:00
Otavio Salvador 5aca6a7e94 update-rc.d.bbclass: do nothing for extended cross packages
(From OE-Core rev: a1f23a7cc527afdd1ce6cc7cd6083ee78fde09b3)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-02-24 00:47:51 +00:00
Bernhard Guillon 45d3f0c801 update-rc.d.bbclass: override UPDATERCD for nativesdk
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.

(From OE-Core rev: bf10cc692491acd615b503779c44e6d7ab3ffe68)

Signed-off-by: Bernhard Guillon <Bernhard.Guillon@hale.at>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-12-16 16:12:46 +00:00
Richard Purdie 0a434ac101 getVar/setVar cleanups
Complete the bb.data.getVar/setVar replacements with accesses
directly to the data store object.

(From OE-Core rev: 2864ff6a4b3c3f9b3bbb6d2597243cc5d3715939)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-27 10:25:34 +00:00
Richard Purdie c8dee9b92d Convert to use direct access to the data store (instead of bb.data.*Var*())
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 *`

(From OE-Core rev: b22831fd63164c4db9c0b72934d7d734a6585251)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-10 11:51:19 +00:00
Saul Wold e144427cb9 update-rc.d.bbclass: Changed RDEPENDS for native
Signed-off-by: Saul Wold <sgw@linux.intel.com>
2011-01-24 14:09:14 -08:00