Currently it's only possible to specify an arbitrary stage number for
sysinit function. This can be a bit troublesome if we need to assure
some packages are initialized in specific order since it required to
adjust stages for all relevant packages. Also some packages have stages
defined via syscfg (which is horrible) which means they can be changed
and the whole setup breaks.
This patch allows to order sysinit by dependencies between functions.
New syntax is allowed in addition to stage number:
$after:func_name
$before:func_name
The former will ensure that function is called after "func_name", and
the latter - after "func_name".
Each sysinit function shall specify one stage number or any number of
dependencies - those cannot be mixed. Some examples of valid sysinit
definitions:
Currently it's only possible to specify an arbitrary stage number for sysinit function. This can be a bit troublesome if we need to assure some packages are initialized in specific order since it required to adjust stages for all relevant packages. Also some packages have stages defined via syscfg (which is horrible) which means they can be changed and the whole setup breaks.
This patch allows to order sysinit by dependencies between functions. New syntax is allowed in addition to stage number:
$after:func_name
$before:func_name
The former will ensure that function is called after "func_name", and the latter - after "func_name".
Each sysinit function shall specify one stage number or any number of dependencies - those cannot be mixed. Some examples of valid sysinit definitions:
(1)
(2)
(3)
Note that (2) is ok even though both functions depend on each other, since effectively both dependencies are the same.
Multiple dependencies can be specified as a list or as a comma-separated string (3).
An error will be raised if circular dependency is found when resolving order of functions.