* [PATCH 0/2] have input method modules cached at do-rootfs time
@ 2012-12-19 16:02 Laurentiu Palcu
2012-12-19 16:02 ` [PATCH 1/2] gtk-immodules-cache.bbclass: allow for offline cache generation Laurentiu Palcu
2012-12-19 16:02 ` [PATCH 2/2] matchbox-keyboard: use the gtk-immodules-cache.bbclass Laurentiu Palcu
0 siblings, 2 replies; 7+ messages in thread
From: Laurentiu Palcu @ 2012-12-19 16:02 UTC (permalink / raw)
To: openembedded-core
Hi,
This patchset will change the postinstall routine in gtk-immodules-cache.bbclass,
so it can run at do_rootfs time, and changes matchbox-keyboard recipe to use
the class.
Thanks,
Laurentiu
Laurentiu Palcu (2):
gtk-immodules-cache.bbclass: allow for offline cache generation
matchbox-keyboard: use the gtk-immodules-cache.bbclass
meta/classes/gtk-immodules-cache.bbclass | 22 +++++++++++++++++++-
.../matchbox-keyboard/matchbox-keyboard_git.bb | 18 ++--------------
2 files changed, 23 insertions(+), 17 deletions(-)
--
1.7.9.5
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/2] gtk-immodules-cache.bbclass: allow for offline cache generation
2012-12-19 16:02 [PATCH 0/2] have input method modules cached at do-rootfs time Laurentiu Palcu
@ 2012-12-19 16:02 ` Laurentiu Palcu
2012-12-19 16:06 ` Phil Blundell
` (2 more replies)
2012-12-19 16:02 ` [PATCH 2/2] matchbox-keyboard: use the gtk-immodules-cache.bbclass Laurentiu Palcu
1 sibling, 3 replies; 7+ messages in thread
From: Laurentiu Palcu @ 2012-12-19 16:02 UTC (permalink / raw)
To: openembedded-core
In order to support a RO rootfs, the cache generation during postinstall
has to be done on host. However, gtk-query-immodules application will
only be able to parse shared objects from the same ELF class.
In order not to have a native package for all the recipes providing
an input method, so we can generate the cache file natively, run
gtk-query-immodules through qemu emulator.
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
---
meta/classes/gtk-immodules-cache.bbclass | 22 +++++++++++++++++++++-
1 file changed, 21 insertions(+), 1 deletion(-)
diff --git a/meta/classes/gtk-immodules-cache.bbclass b/meta/classes/gtk-immodules-cache.bbclass
index 515d28b..d57dcae 100644
--- a/meta/classes/gtk-immodules-cache.bbclass
+++ b/meta/classes/gtk-immodules-cache.bbclass
@@ -2,9 +2,29 @@
#
# Usage: Set GTKIMMODULES_PACKAGES to the packages that needs to update the inputmethod modules
+DEPENDS =+ "qemu-native"
+
gtk_immodule_cache_postinst() {
if [ "x$D" != "x" ]; then
- exit 1
+EMULATOR=qemu-$(echo ${TARGET_ARCH}| \
+ sed -e 's/i[3-6]86/i386/' -e 's/x86[_-]64/x86_64/' \
+ -e 's/powerpc/ppc/')
+
+for maj_ver in 2 3; do
+ if [ -x $D${bindir}/gtk-query-immodules-$maj_ver.0 ]; then
+ IMFILES=$(ls $D${libdir}/gtk-$maj_ver.0/*/immodules/*.so)
+ DYNAMIC_LOADER=$D$(readelf -a $D${bindir}/gtk-query-immodules-$maj_ver.0 |\
+ grep "Requesting program interpreter"|sed -e 's/^.*\[.*: \(.*\)\]/\1/')
+ LIBRARY_PATH=$D${base_libdir}:$D${libdir}
+ $EMULATOR $DYNAMIC_LOADER --library-path $LIBRARY_PATH \
+ $D${bindir}/gtk-query-immodules-$maj_ver.0 $IMFILES > $D/etc/gtk-$maj_ver.0/gtk.immodules 2>/dev/null && \
+ sed -i -e "s:$D::" $D/etc/gtk-$maj_ver.0/gtk.immodules
+
+ [ $? -ne 0 ] && exit 1
+ fi
+done
+
+exit 0
fi
if [ ! -z `which gtk-query-immodules-2.0` ]; then
gtk-query-immodules-2.0 > /etc/gtk-2.0/gtk.immodules
--
1.7.9.5
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/2] matchbox-keyboard: use the gtk-immodules-cache.bbclass
2012-12-19 16:02 [PATCH 0/2] have input method modules cached at do-rootfs time Laurentiu Palcu
2012-12-19 16:02 ` [PATCH 1/2] gtk-immodules-cache.bbclass: allow for offline cache generation Laurentiu Palcu
@ 2012-12-19 16:02 ` Laurentiu Palcu
2012-12-19 17:35 ` Burton, Ross
1 sibling, 1 reply; 7+ messages in thread
From: Laurentiu Palcu @ 2012-12-19 16:02 UTC (permalink / raw)
To: openembedded-core
Since the class was already present, use it. Also, this will have the
postinstalls run on host, at do_rootfs time.
[YOCTO #3602]
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
---
.../matchbox-keyboard/matchbox-keyboard_git.bb | 18 ++----------------
1 file changed, 2 insertions(+), 16 deletions(-)
diff --git a/meta/recipes-sato/matchbox-keyboard/matchbox-keyboard_git.bb b/meta/recipes-sato/matchbox-keyboard/matchbox-keyboard_git.bb
index adde25b..a7091d2 100644
--- a/meta/recipes-sato/matchbox-keyboard/matchbox-keyboard_git.bb
+++ b/meta/recipes-sato/matchbox-keyboard/matchbox-keyboard_git.bb
@@ -22,7 +22,7 @@ SRC_URI = "git://git.yoctoproject.org/${BPN};protocol=git \
S = "${WORKDIR}/git"
-inherit autotools pkgconfig gettext
+inherit autotools pkgconfig gettext gtk-immodules-cache
EXTRA_OECONF = "--disable-cairo --enable-gtk-im --enable-applet"
@@ -49,18 +49,4 @@ do_install_append () {
rm -f ${D}${libdir}/matchbox-panel/*.la
}
-pkg_postinst_matchbox-keyboard-im () {
-if [ "x$D" != "x" ]; then
- exit 1
-fi
-
-gtk-query-immodules-2.0 > /etc/gtk-2.0/gtk.immodules
-}
-
-pkg_postrm_matchbox-keyboard-im () {
-if [ "x$D" != "x" ]; then
- exit 1
-fi
-
-gtk-query-immodules-2.0 > /etc/gtk-2.0/gtk.immodules
-}
+GTKIMMODULES_PACKAGES = "${PN}-im"
--
1.7.9.5
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 1/2] gtk-immodules-cache.bbclass: allow for offline cache generation
2012-12-19 16:02 ` [PATCH 1/2] gtk-immodules-cache.bbclass: allow for offline cache generation Laurentiu Palcu
@ 2012-12-19 16:06 ` Phil Blundell
2012-12-19 17:40 ` Burton, Ross
2012-12-19 19:09 ` [PATCH v2] " Laurentiu Palcu
2 siblings, 0 replies; 7+ messages in thread
From: Phil Blundell @ 2012-12-19 16:06 UTC (permalink / raw)
To: Laurentiu Palcu; +Cc: openembedded-core
On Wed, 2012-12-19 at 18:02 +0200, Laurentiu Palcu wrote:
> +EMULATOR=qemu-$(echo ${TARGET_ARCH}| \
> + sed -e 's/i[3-6]86/i386/' -e 's/x86[_-]64/x86_64/' \
> + -e 's/powerpc/ppc/')
Maybe you could use ${@qemu_target_binary()} for that.
p.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] matchbox-keyboard: use the gtk-immodules-cache.bbclass
2012-12-19 16:02 ` [PATCH 2/2] matchbox-keyboard: use the gtk-immodules-cache.bbclass Laurentiu Palcu
@ 2012-12-19 17:35 ` Burton, Ross
0 siblings, 0 replies; 7+ messages in thread
From: Burton, Ross @ 2012-12-19 17:35 UTC (permalink / raw)
To: Laurentiu Palcu; +Cc: openembedded-core
On 19 December 2012 16:02, Laurentiu Palcu <laurentiu.palcu@intel.com> wrote:
> Since the class was already present, use it. Also, this will have the
> postinstalls run on host, at do_rootfs time.
>
> [YOCTO #3602]
>
> Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Ross
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/2] gtk-immodules-cache.bbclass: allow for offline cache generation
2012-12-19 16:02 ` [PATCH 1/2] gtk-immodules-cache.bbclass: allow for offline cache generation Laurentiu Palcu
2012-12-19 16:06 ` Phil Blundell
@ 2012-12-19 17:40 ` Burton, Ross
2012-12-19 19:09 ` [PATCH v2] " Laurentiu Palcu
2 siblings, 0 replies; 7+ messages in thread
From: Burton, Ross @ 2012-12-19 17:40 UTC (permalink / raw)
To: Laurentiu Palcu; +Cc: openembedded-core
On 19 December 2012 16:02, Laurentiu Palcu <laurentiu.palcu@intel.com> wrote:
> + DYNAMIC_LOADER=$D$(readelf -a $D${bindir}/gtk-query-immodules-$maj_ver.0 |\
"readelf -l" means less output which is always good.
I'd like to see some of that logic separated out into a bbclass so it
can be easily re-used.
Ross
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v2] gtk-immodules-cache.bbclass: allow for offline cache generation
2012-12-19 16:02 ` [PATCH 1/2] gtk-immodules-cache.bbclass: allow for offline cache generation Laurentiu Palcu
2012-12-19 16:06 ` Phil Blundell
2012-12-19 17:40 ` Burton, Ross
@ 2012-12-19 19:09 ` Laurentiu Palcu
2 siblings, 0 replies; 7+ messages in thread
From: Laurentiu Palcu @ 2012-12-19 19:09 UTC (permalink / raw)
To: openembedded-core
In order to support a RO rootfs, the cache generation during postinstall
has to be done on host. However, gtk-query-immodules application will
only be able to parse shared objects from the same ELF class.
In order not to have a native package for all the recipes providing
an input method, so we can generate the cache file natively, run
gtk-query-immodules through qemu emulator.
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
---
Changes in v2:
* Used qemu_target_binary() function, in order to obtain the qemu binary
corresponding to the current target, as suggested by Phil (thank you,
I didn't know that function existed);
Thanks,
Laurentiu
meta/classes/gtk-immodules-cache.bbclass | 21 ++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)
diff --git a/meta/classes/gtk-immodules-cache.bbclass b/meta/classes/gtk-immodules-cache.bbclass
index 515d28b..72595ee 100644
--- a/meta/classes/gtk-immodules-cache.bbclass
+++ b/meta/classes/gtk-immodules-cache.bbclass
@@ -2,9 +2,28 @@
#
# Usage: Set GTKIMMODULES_PACKAGES to the packages that needs to update the inputmethod modules
+DEPENDS =+ "qemu-native"
+
+inherit qemu
+
gtk_immodule_cache_postinst() {
if [ "x$D" != "x" ]; then
- exit 1
+
+for maj_ver in 2 3; do
+ if [ -x $D${bindir}/gtk-query-immodules-$maj_ver.0 ]; then
+ IMFILES=$(ls $D${libdir}/gtk-$maj_ver.0/*/immodules/*.so)
+ DYNAMIC_LOADER=$D$(readelf -a $D${bindir}/gtk-query-immodules-$maj_ver.0 |\
+ grep "Requesting program interpreter"|sed -e 's/^.*\[.*: \(.*\)\]/\1/')
+ LIBRARY_PATH=$D${base_libdir}:$D${libdir}
+ ${@qemu_target_binary(d)} $DYNAMIC_LOADER --library-path $LIBRARY_PATH \
+ $D${bindir}/gtk-query-immodules-$maj_ver.0 $IMFILES > $D/etc/gtk-$maj_ver.0/gtk.immodules 2>/dev/null && \
+ sed -i -e "s:$D::" $D/etc/gtk-$maj_ver.0/gtk.immodules
+
+ [ $? -ne 0 ] && exit 1
+ fi
+done
+
+exit 0
fi
if [ ! -z `which gtk-query-immodules-2.0` ]; then
gtk-query-immodules-2.0 > /etc/gtk-2.0/gtk.immodules
--
1.7.9.5
^ permalink raw reply related [flat|nested] 7+ messages in thread
end of thread, other threads:[~2012-12-19 19:24 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-19 16:02 [PATCH 0/2] have input method modules cached at do-rootfs time Laurentiu Palcu
2012-12-19 16:02 ` [PATCH 1/2] gtk-immodules-cache.bbclass: allow for offline cache generation Laurentiu Palcu
2012-12-19 16:06 ` Phil Blundell
2012-12-19 17:40 ` Burton, Ross
2012-12-19 19:09 ` [PATCH v2] " Laurentiu Palcu
2012-12-19 16:02 ` [PATCH 2/2] matchbox-keyboard: use the gtk-immodules-cache.bbclass Laurentiu Palcu
2012-12-19 17:35 ` Burton, Ross
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.