Commit Graph

19 Commits

Author SHA1 Message Date
Peter Kjellerstedt 4bd647af83 update_gio_module_cache: Do not chown a non-existing file
Only change the ownership of ${libdir}/gio/modules/giomodule.cache if
it exists.

(From OE-Core rev: df2e1a8fbadffac0f1781a0d07e050356a007327)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-04-05 23:22:12 +01:00
Abdur Rehman 07171aba2b update_gio_module_cache: fix host user contamination
update_gio_module_cache intercept creates file:
$D${libdir}/gio/modules/giomodule.cache

Change ownership of this file to root:root to avoid user contamination
by host.

(From OE-Core rev: 9a23af37ad11a7176248ade88511f34fe6dd97bb)

Signed-off-by: Abdur Rehman <abdur_rehman@mentor.com>
Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-29 16:37:27 +01:00
Jussi Kukkonen cef8bc9e80 gio-module-cache: Add class for Gio modules
The new class uses gio-querymodules tool on postinst and postrm.
This regenerates the module cache which is useful to avoid loading
modules that are not needed at runtime: If a Gio module is not
listed in the cache file it will always get loaded.

* Add a postinst-intercept 'gio-module-cache': it runs
  gio-querymodules using qemuwrapper. This is required because the tool
  actually loads the modules to generate the cache.
* Add a gio-module-cache class that adds postinstall and postrm
  scripts. In the sysroot population case use the new intercept.
* Inherit the new class in glib-2.0, glib-networking and gconf.

Fixes [YOCTO #9241].

(From OE-Core rev: 168cf5502a2dda78348cc9679e37bed0c69c0208)

Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-28 15:55:49 +01:00
Ross Burton a9f2e87bd5 postinst-intercepts: always use set -e
If a postinst has a problem (say, qemu crashes) and set -e isn't in operation,
the only mention of the problem is a single line in the rootfs log that doesn't
trigger any warnings.

(From OE-Core rev: 072800f89a136bb5da44627f25599d3060cca0a1)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-19 17:37:33 +00:00
Ross Burton 34f8db9b44 update_font_cache: only scan system font directories
By default fc-cache will scan both system and user directories, which means it
attempts to scan $HOME/.fonts.  As this is the build host's idea of $HOME this
generally doesn't exist, and causes fc-cache to exit with a failure.

Solve this by passing --system-only so that fc-cache will only scan system
directories, as is appropriate for a rootfs-time invocation.

(From OE-Core rev: 541315d6c56df6448f64c262f99d43d5c1e9400b)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-11 23:26:32 +00:00
Ross Burton da386d3d21 gtk-icon-cache: pass the native libdir to the intercept
The intercept runs against the native sysroot so we need to pass it
the native libdir instead of the target libdir, as otherwise it will
use target paths (such as lib64) in the native sysroot.

(From OE-Core rev: 0fe84007176c98644b1917966c98501beb7e0ce2)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-29 07:31:16 +00:00
Ross Burton 517132904e intercepts/update_icon_cache: use STAGING_DIR_NATIVE from environment
Instead of expecting that the calling postinst has exported
STAGING_LIBDIR_NATIVE (which will get set to the sysroot at package build time
and may not be correct if sstate is used), use the new STAGING_DIR_NATIVE that
is exported by rootfs.py.

[ YOCTO #8547 ]

(From OE-Core rev: 9fa5ff645eb683533af482925079dff5c9151831)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-27 07:24:30 +00:00
Martin Jansa dff30d2906 fontcache: allow to pass extra parameters and environment to fc-cache
* this can be useful for passing extra parameters, pass
  -v by default to see what's going on in do_rootfs
* we need to use this for extra parameter we implemented
  in fontconfig:
  --ignore-mtime always use cache file regardless of font directory mtime
  because the checksum of fontcache generated in do_rootfs
  doesn't match with /usr/share/fonts directory as seen on
  target device causing fontconfig to re-create the cache
  when fontconfig is used for first time or worse create
  new cache in every user's home directory when /usr/
  filesystem is read only and cache cannot be updated.

  Running FC_DEBUG=16 fc-cache -v on such device shows:
  FcCacheTimeValid dir "/usr/share/fonts" cache checksum 1441207803 dir checksum 1441206149
* my guess is that the checksum is different, because pseudo
  (which is unloaded when running qemuwrapper) or because some
  influence of running the rootfs under qemu.

(From OE-Core rev: e07fdc5f047f309a0e99331f430c14d708ed2161)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-01 17:54:55 +01:00
Ross Burton 8a12632e97 gdk-pixbuf: move gdk-pixbuf-query-loaders to $libdir for multilib safety
If for example gdk-pixbuf and lib32-gdk-pixbuf are in an image then only one
${bindir}/gdk-pixbuf-query-loaders will be installed, so only one variant will
actually be usable.

Solve this by moving gdk-pixbuf-query-loaders into ${libdir} as it's intimately
tied to the library and rarely directly invoked by the user, and update the
callers to use the right path.

(From OE-Core rev: 69df75f268e2b3d5874f05e2b5a6125f6d990a03)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-28 12:00:16 +01:00
Martin Jansa e570b32020 postinst_intercept: allow to pass variables with spaces
* trying to pass foo="a b" through postinst_intercept ends
  with the actual script header to containing:
  b
  foo=a
  which fails because "b" command doesn't exist.

(From OE-Core rev: c66d7d85b7225be8c838449324d506565dd0081d)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-09 14:27:39 +01:00
Martin Jansa 29361a0e07 fontcache: allow to pass different fontconfig cache dir
(From OE-Core rev: 40f7986313277ef815b19331388bca124187bfeb)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-21 07:20:25 +01:00
Matthieu Crapet 543d1bd488 postinst_intercept script: drop pipe
Avoid useless subshell.
There's no word splitting in variable assignment.

(From OE-Core rev: 7b12f4860138d8f5e53ebdfa2a87b59a9ea5c487)

Signed-off-by: Matthieu Crapet <Matthieu.Crapet@ingenico.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-03-22 14:42:16 +00:00
Jonathan Liu d03e1677d5 postinst-intercepts/update_font_cache: fix ownership of fontconfig cache
The file ownership of the cache files in /var/cache/fontconfig needs to
be set to root:root otherwise it inherits the user and group id of the
build user.

[YOCTO #7411]

(From OE-Core rev: 23393c6685860d0b1c459874d35395360d0b6d3c)

Signed-off-by: Jonathan Liu <net147@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-03-16 17:41:53 +00:00
Ross Burton 1eae7d2503 gdk-pixbuf: pass GDK_PIXBUF_FATAL_LOADER where relevant
Pass GDK_PIXBUF_FATAL_LOADER to the sstate postinst and intercept so that any
problems are flagged as errors instead of being silently ignored.

(From OE-Core rev: 0a97b1571821848af11d8651c7145ed9592f9e31)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-04-01 23:39:14 +01:00
Laurentiu Palcu a150272845 scripts/postinst-intercepts: do not redirect errors to /dev/null
The redirection was necessary with the old bash code because the log
checking routine was searching for error strings in the log and abort
the build in case failures occured. With the new python code,
redirecting the intercept stderr is no longer necessary. This also makes
the intercept hooks easier to debug.

(From OE-Core rev: e2c3c59b26d84cd4052a953adafcd4d456264c26)

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-11 11:53:43 +00:00
Laurentiu Palcu 1a438afd69 scripts/postinst-intercepts: create separete hooks for multilib
When using multilib, the hooks for lib32/lib64 must be different because
the libdir/base_libdir point to different locations. Postinstalls
calling postint_intercept script must pass the mlprefix in the 3rd
argument.

(From OE-Core rev: 2c5c6e3ffcd561c25a34603922b622449f677a34)

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-04-29 14:45:10 +01:00
Laurentiu Palcu 2435d807d1 postinst-intercepts, qemu.bbclass: fix segfaults in postinstalls
Postinstalls that use qemu are throwing a segmentation fault when
building for qemux86-64 on a 64bit host (it might also happen for
qemux86 if building on a 32bit host but I didn't test). It looks like
qemu looks for ld.so.cache which is not found because it is generated
after rootfs_(rpm|ipk|deb)_do_rootfs is called and then it tries to load
libraries from the default paths (which are the host's). In order to
avoid this, pass the LD_LIBRARY_PATH explicitly to the target's dynamic
loader.

(From OE-Core rev: 48e8b613b3f5c7b1d917bf3147606d44072ce49e)

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-04-10 12:56:52 +01:00
Laurentiu Palcu 1872ee316b postinst-intercepts, qemu.bbclass: fix issue on 32 bit hosts
The intercept scripts fail to run on 32 bit hosts. Apparently, the
current approach worked on 64 bit hosts due to the larger virtual address
space (probably). On 32 bit hosts, however, calling the target binary like:

qemu-arm ld-linux.so --library-path /lib:/usr/lib arm_binary

fails with:

arm_binary: error while loading shared libraries: arm_binary: failed to
map segment from shared object: Operation not permitted

When run like this, qemu-arm fails to map the arm_binary executable in
memory because it's hitting the lower limit of
/proc/sys/vm/mmap_min_addr. That's because it loads the
ld-linux.so binary successfully, taking into account mmap_min_addr, runs
it, and then ld-linux.so will map the arm_binary at a fixed address but this
will fail because it is below mmap_min_addr. The qemu's guest base probing,
apparently, doesn't work fine when a program runs inside other.

One way around this would be to set mmap_min_addr to 0 (on recent
distributions is set to 65536 to avoid "kernel NULL pointer dereference"
defects) but this approach is not safe.

The other way is to call the binary directly but providing qemu with a
prefix (-L option) in order to find the elf interpreter correctly. This
way, both the target binary and dynamic loader are mapped into memory
under qemu's control and, only after, the dynamic loader is started.

[YOCTO #4179]

(From OE-Core rev: 78f91e08c8a7b0f0c831a087f7c89e2c76047e7a)

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-04-05 17:36:34 +01:00
Laurentiu Palcu 7306dbea6d Add separate directory for postinstall intercepts
The scripts/postinst-intercepts will contain all postinstall hooks that
we need to run after all packages have been installed.

If one wants to install such a postinst hook, all it needs to do is put
the hook in this directory and, from the package postinstall scriptlet,
call:
	postinst_intercept <hook_name> <package_name> <var1=...> ...

This will, practically, add the package_name in the list of packages
that need the hook to run and, also, set any variables that would be
needed in the hook. For example, variables like ${libdir}, ${bindir},
etc. that might depend on distribution can be passed on to the script in
this way.

(From OE-Core rev: 0ef538d75c2f3921a2fcbe6ca1deed5525b276cc)

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-13 16:52:28 +00:00