All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] fix IMAGE_LINGUAS did not support multilib correctly
@ 2015-12-10 10:41 Hongxu Jia
  2015-12-10 10:41 ` [PATCH 1/1] image/multilib bbclass: install multilib and non-multilib language pkgs for image recipes Hongxu Jia
  2016-01-14  6:48 ` [PATCH 0/1] fix IMAGE_LINGUAS did not support multilib correctly Hongxu Jia
  0 siblings, 2 replies; 5+ messages in thread
From: Hongxu Jia @ 2015-12-10 10:41 UTC (permalink / raw)
  To: openembedded-core, ross.burton

Test steps:

1. Make use of service in meta-skeleton to test the issue.
   The app invoke setlocale(LC_CTYPE, "en_US.UTF-8") in C.

--- a/meta-skeleton/recipes-skeleton/service/service/skeleton_test.c
+++ b/meta-skeleton/recipes-skeleton/service/service/skeleton_test.c
@@ -1,12 +1,13 @@
-#include <unistd.h>
-
-/* This demo does nothing except for testing /etc/init.d/skeleton */
+#include <locale.h>
+#include <stdio.h>
+#include <errno.h>
+#include <string.h>
 
 int main(int argc, char *argv[])
 {
-       daemon(0, 0);
-       while (1) {
-               sleep(1);
-       }
-       return 0;
+    char *p = setlocale (LC_CTYPE, "en_US.UTF-8");
+    if (p == NULL)
+        printf("setlocale failed: %s\n", strerror(errno));
+    else
+        printf("p %s\n", p);
 }

--- a/meta-skeleton/recipes-skeleton/service/service_0.1.bb
+++ b/meta-skeleton/recipes-skeleton/service/service_0.1.bb
@@ -1,4 +1,4 @@
-SUMMARY = "The canonical example of init scripts"
+SUMMARY = "The example to test multilib of setlocale"
 SECTION = "base"
 LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://${WORKDIR}/COPYRIGHT;md5=349c872e0066155e1818b786938876a4"
@@ -8,24 +8,14 @@ SRC_URI = "file://skeleton \
           file://COPYRIGHT \
           "
 
+FILES_${PN} += "${libdir}/setlocale"
+
 do_compile () {
-       ${CC} ${WORKDIR}/skeleton_test.c -o ${WORKDIR}/skeleton-test
+       ${CC} ${WORKDIR}/skeleton_test.c -o ${WORKDIR}/setlocale
 }
 
 do_install () {
-       install -d ${D}${sysconfdir}/init.d
-       cat ${WORKDIR}/skeleton | \
-         sed -e 's,/etc,${sysconfdir},g' \
-             -e 's,/usr/sbin,${sbindir},g' \
-             -e 's,/var,${localstatedir},g' \
-             -e 's,/usr/bin,${bindir},g' \
-             -e 's,/usr,${prefix},g' > ${D}${sysconfdir}/init.d/skeleton
-       chmod a+x ${D}${sysconfdir}/init.d/skeleton
-
-       install -d ${D}${sbindir}
-       install -m 0755 ${WORKDIR}/skeleton-test ${D}${sbindir}/
+       install -d ${D}${libdir}
+       install -m 0755 ${WORKDIR}/setlocale ${D}${libdir}/
 }
 
-RDEPENDS_${PN} = "initscripts"
-
-CONFFILES_${PN} += "${sysconfdir}/init.d/skeleton"


2. On qemux86-64, enable multilib, add non-multilib and
   multilib service to image, assign 'en-us' to IMAGE_LINGUAS
vim local.conf
...
MACHINE ?= "qemux86-64"

require conf/multilib.conf
MULTILIBS = "multilib:lib32"
DEFAULTTUNE_virtclass-multilib-lib32 = "core2-32"

IMAGE_INSTALL_append = " file service lib32-service"
IMAGE_LINGUAS_append = " en-us"
...

vim bblayers.conf
...
BBLAYERS ?= " \ 
  /buildarea/raid0/hjia/poky/meta \
  /buildarea/raid0/hjia/poky/meta-yocto \
  /buildarea/raid0/hjia/poky/meta-skeleton \
  "
...

2. Build non-multilib image
$ bitbake core-image-minimal

3. Run qemu
$ runqemu qemux86-64 core-image-minimal slirp nographic

4. In qemu, invoke multilib /usr/lib/setlocale and non-multilib
   /usr/lib64/setlocale success

root@qemux86-64:~# file /usr/lib/setlocale 
/usr/lib/setlocale: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=0caa404112fe8963dd1418757fc4bdee0cab272d, stripped
root@qemux86-64:~# /usr/lib/setlocale 
p en_US.UTF-8

root@qemux86-64:~# file /usr/lib64/setlocale  
/usr/lib64/setlocale: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=b8c88222213ffbd4603b34337b3db71aba43c968, stripped
root@qemux86-64:~# 
root@qemux86-64:~# /usr/lib64/setlocale
p en_US.UTF-8

5. Both locale-base-en-us and lib32-locale-base-en-us installed
root@qemux86-64:~# ls /usr/lib64/locale/en_US/
LC_ADDRESS         LC_CTYPE           LC_MEASUREMENT     LC_MONETARY        LC_NUMERIC         LC_TELEPHONE
LC_COLLATE         LC_IDENTIFICATION  LC_MESSAGES

root@qemux86-64:~# ls /usr/lib/locale/en_US/
LC_ADDRESS         LC_CTYPE           LC_MEASUREMENT     LC_MONETARY        LC_NUMERIC         LC_TELEPHONE
LC_COLLATE         LC_IDENTIFICATION  LC_MESSAGES

6. Build multilib image
$ bitbake lib32-core-image-minimal

7. Run qemu
$ runqemu qemux86-64 lib32-core-image-minimal slirp nographic

8. Both locale-base-en-us and lib32-locale-base-en-us installed
root@qemux86-64:~# ls /usr/lib64/locale/en_US/
LC_ADDRESS         LC_CTYPE           LC_MEASUREMENT     LC_MONETARY        LC_NUMERIC         LC_TELEPHONE
LC_COLLATE         LC_IDENTIFICATION  LC_MESSAGES

root@qemux86-64:~# ls /usr/lib/locale/en_US/
LC_ADDRESS         LC_CTYPE           LC_MEASUREMENT     LC_MONETARY        LC_NUMERIC         LC_TELEPHONE
LC_COLLATE         LC_IDENTIFICATION  LC_MESSAGES

9. Disable multilib and build core-image-minimal
   only locale-base-en-us is installed

root@qemux86-64:~# /usr/lib/setlocale 
p en_US.UTF-8

root@qemux86-64:~# file /usr/lib/setlocale
/usr/lib/setlocale: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=bc6d1a23619ad5629f8e064ce8e426d5d8b20434, stripped

root@qemux86-64:~# ls /usr/lib/locale/en_US/
LC_ADDRESS         LC_CTYPE           LC_MEASUREMENT     LC_MONETARY        LC_NUMERIC         LC_TELEPHONE
LC_COLLATE         LC_IDENTIFICATION  LC_MESSAGES        LC_NAME            LC_PAPER           LC_TIME

//Hongxu

The following changes since commit 5e3e2e0cbb0a49986f4653e64c4c8d2b5461645e:

  poky.conf: Bump for 2.1 development (2015-12-10 00:13:13 +0000)

are available in the git repository at:

  git://git.pokylinux.org/poky-contrib hongxu/fix-locale
  http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=hongxu/fix-locale

Hongxu Jia (1):
  image/multilib bbclass: install multilib and non-multilib language
    pkgs for image recipes

 meta/classes/image.bbclass    | 20 +++++++++++++++++++-
 meta/classes/multilib.bbclass |  9 +++++++++
 2 files changed, 28 insertions(+), 1 deletion(-)

-- 
1.9.1



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-01-14  7:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-10 10:41 [PATCH 0/1] fix IMAGE_LINGUAS did not support multilib correctly Hongxu Jia
2015-12-10 10:41 ` [PATCH 1/1] image/multilib bbclass: install multilib and non-multilib language pkgs for image recipes Hongxu Jia
2016-01-14  6:54   ` Robert Yang
2016-01-14  7:08     ` Hongxu Jia
2016-01-14  6:48 ` [PATCH 0/1] fix IMAGE_LINGUAS did not support multilib correctly Hongxu Jia

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.