[PATCH weston-ivi-shell v4 8/9] Add a reference of weston.ini for ivi-shell and ivi-hmi-controller.

Pekka Paalanen ppaalanen at gmail.com
Fri Apr 25 03:41:42 PDT 2014


On Mon, 17 Mar 2014 15:31:09 +0900
Nobuhiko Tanibata <NOBUHIKO_TANIBATA at xddp.denso.co.jp> wrote:

> Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA at xddp.denso.co.jp>
> ---
> 
> Changes for v2:
>  - squash Makefile to this patch
> 
> Changes for v3 and v4
>   - nothing. Version number aligned to the first patch
> 
>  ivi-shell/Makefile.am   | 12 ++++++++
>  ivi-shell/weston.ini.in | 79 +++++++++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 91 insertions(+)
>  create mode 100644 ivi-shell/weston.ini.in
> 
> diff --git a/ivi-shell/Makefile.am b/ivi-shell/Makefile.am
> index afaa5e3..333abb7 100644
> --- a/ivi-shell/Makefile.am
> +++ b/ivi-shell/Makefile.am
> @@ -67,3 +67,15 @@ CLEANFILES = $(BUILT_SOURCES)
>  
>  wayland_protocoldir = $(top_srcdir)/protocol
>  include $(top_srcdir)/wayland-scanner.mk
> +
> +
> +weston.ini : $(srcdir)/weston.ini.in
> +	$(AM_V_GEN)$(SED) \
> +		-e 's|@bindir[@]|$(bindir)|g' \
> +		-e 's|@abs_top_builddir[@]|$(abs_top_builddir)|g' \
> +		-e 's|@libexecdir[@]|$(libexecdir)|g' \
> +		$< > $@
> +
> +all-local : weston.ini
> +
> +CLEANFILES += weston.ini
> diff --git a/ivi-shell/weston.ini.in b/ivi-shell/weston.ini.in
> new file mode 100644
> index 0000000..c9a6861
> --- /dev/null
> +++ b/ivi-shell/weston.ini.in
> @@ -0,0 +1,79 @@
> +[core]
> +shell=ivi-shell.so
> +modules=hmi-controller.so

Ooh, I see, this is how you get hmi-controller.so loaded.

Since both ivi-shell.so and hmi-controller.so both link to
libweston-layout.la at build time and both are dlopen'd at runtime, what
guarantees that both use the same instance of the global 'ivilayout'
defined in weston-layout.c?

My knowledge of runtime dynamic linking is a bit weak, but
personally I'd just avoid that global there. It is a bit much of magic.

AFAICS, you might be implicitly depending on the loading order of
ivi-shell.so first, hmi-controller.so next. Weston does do it that way,
but I'd hope the dependency was more obvious than both secretly using
the same global in a yet third library.

What happens, if hmi-controller.so is loaded, but shell is not
ivi-shell.so?

What happens, if ivi-shell.so is the shell, but hmi-controller.so is
not loaded?

Would it be better if ivi-shell.so loaded the whatever hmi-controller
plugin that is appropriate? weston_load_module() is exported, and that
would make the dependency explicit, allowing you to nicely exit weston
with an error if something doesn't load right.

After all, hmi-controller.so seems like a plugin to ivi-shell than
anything else.


Thanks,
pq


More information about the wayland-devel mailing list