Age | Commit message (Collapse) | Author | Files |
|
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.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
The postinstall needs systemd-systemctl-native, mark the dependency
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
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).
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
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\)
Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
|
|
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'.
Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
|
|
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.
Signed-off-by: Ross Burton <ross.burton@intel.com>
|
|
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.
Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
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.
Signed-off-by: Bob Ham <bob.ham@collabora.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
|
|
Signed-off-by: Pau Espin Pedrol <pau.espin@aweurope.be>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
The has_exactly_one_service variable was used in now deleted code. Drop
this part to make code cleaner.
Signed-off-by: Dmitry Eremin-Solenikov <dmitry_eremin@mentor.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
|
|
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.
Signed-off-by: Ross Burton <ross.burton@intel.com>
|
|
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>
|
|
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>
|
|
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.
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
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>
|
|
It's DISTRO_FEATURES; DISTRO_FEATURE is invalid.
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
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>
|
|
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.
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
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.
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>
|
|
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.
Signed-off-by: Muhammad Shakeel <muhammad_shakeel@mentor.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
|
|
If systemd is not supported DISTRO_FEATURE than there is no need to
package related service files.
Signed-off-by: Muhammad Shakeel <muhammad_shakeel@mentor.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
|
|
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.
Signed-off-by: Randy Witt <rewitt@declaratino.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
|
|
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>
|
|
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 ]
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
* 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>
|
|
Rename SYSTEMD_BBCLASS_ENABLED to INHIBIT_UPDATERCD_BBCLASS to reflect the
action, for clarity.
Signed-off-by: Ross Burton <ross.burton@intel.com>
|
|
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.
Signed-off-by: Ross Burton <ross.burton@intel.com>
|
|
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
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
|
|
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
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>
|
|
This is cleaner and leads to more accurate profiles.
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
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>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|