[yocto] Howto generate a Yocto image with spanish full-support by default

Alexander Kanavin alexander.kanavin at linux.intel.com
Fri Feb 16 05:30:42 PST 2018


On 02/16/2018 02:17 PM, Iván Castell wrote:
> After a lot of tests, I have been able to fix this creating these two files:
> 
>      $ cat /etc/locale.conf
>      LANG=es_ES.UTF-8
>      LANGUAGE=es:en
> 
>      $ cat /etc/profile.d/locale.sh
>      LC_ALL=es_ES
>      LANG=es_ES
>      LANGUAGE=es_ES
> 
> After rebooting, I get this localectl settings:
> 
>      # localectl
>     System Locale: LANG=es_ES.UTF-8
>                    LANGUAGE=es:en
>         VC Keymap: ES
>        X11 Layout: es
>         X11 Model: pc105
>       X11 Options: terminate:ctrl_alt_bksp
> 
> And the 'Ñ' key works as expected:
> 
>      root at iwill:~# ñññññ
> 
> I don't know how to fix this issue without having to make manual changes 
> to the generated image.
> I would like the generated image with Spanish support available once the 
> .wic image is burned into my USB memory stick.
> 
> Is that posible? How should be managed?

POSIX specifies only how locale settings are determined per-process 
(from LANG and LC_* env vars). It says nothing about how those variables 
should be set in the first place. And so every system comes up with its 
own way to do it. locale.conf is systemd-specific, and won't work with 
initv. profile.d stuff has effect only in interactive login shells and 
does nothing for GUI apps. Also, both of these are system-wide and won't 
work if users want to choose their own settngs. And so on.

Anyway, Yocto does not try to come up with any kind of solution for 
this. You need to determine the context and use cases where you need the 
locales to work, and then implement their setting accordingly. If you 
just want a single global setting, then probably a trivial recipe that 
installs /etc/locale.conf will work.

Side note: do not set LC_ALL, it's a bad idea. LANG is sufficient.

Alex



More information about the yocto mailing list