summaryrefslogtreecommitdiffstats
path: root/scripts/postinst-intercepts
AgeCommit message (Collapse)Author
2018-01-29postinst_intercepts: add a delay_to_first_boot hookAlexander Kanavin
This allows postinsts scripts to explicitly request a deferral to first boot (by calling 'postinst_intercept delay_to_first_boot') instead of 'exit 1' which should be used only to indicate actual script failures. Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-04-05update_gio_module_cache: Do not chown a non-existing filePeter Kjellerstedt
Only change the ownership of ${libdir}/gio/modules/giomodule.cache if it exists. Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-03-28update_gio_module_cache: fix host user contaminationAbdur Rehman
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. 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>
2016-03-28gio-module-cache: Add class for Gio modulesJussi Kukkonen
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]. Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-19postinst-intercepts: always use set -eRoss Burton
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. Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-01-11update_font_cache: only scan system font directoriesRoss Burton
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. Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-10-29gtk-icon-cache: pass the native libdir to the interceptRoss Burton
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. Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-10-24intercepts/update_icon_cache: use STAGING_DIR_NATIVE from environmentRoss Burton
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 ] Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-10-01fontcache: allow to pass extra parameters and environment to fc-cacheMartin Jansa
* 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. 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-09-26gdk-pixbuf: move gdk-pixbuf-query-loaders to $libdir for multilib safetyRoss Burton
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. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-07postinst_intercept: allow to pass variables with spacesMartin Jansa
* 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. Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-21fontcache: allow to pass different fontconfig cache dirMartin Jansa
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-03-22postinst_intercept script: drop pipeMatthieu Crapet
Avoid useless subshell. There's no word splitting in variable assignment. Signed-off-by: Matthieu Crapet <Matthieu.Crapet@ingenico.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-03-16postinst-intercepts/update_font_cache: fix ownership of fontconfig cacheJonathan Liu
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] Signed-off-by: Jonathan Liu <net147@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2014-04-01gdk-pixbuf: pass GDK_PIXBUF_FATAL_LOADER where relevantRoss Burton
Pass GDK_PIXBUF_FATAL_LOADER to the sstate postinst and intercept so that any problems are flagged as errors instead of being silently ignored. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-11scripts/postinst-intercepts: do not redirect errors to /dev/nullLaurentiu Palcu
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. Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
2013-04-29scripts/postinst-intercepts: create separete hooks for multilibLaurentiu Palcu
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. Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-04-10postinst-intercepts, qemu.bbclass: fix segfaults in postinstallsLaurentiu Palcu
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. Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-04-05postinst-intercepts, qemu.bbclass: fix issue on 32 bit hostsLaurentiu Palcu
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] Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-12Add separate directory for postinstall interceptsLaurentiu Palcu
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. Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>