Skip to contentSkip to conversation

classes: image: Set empty weak default IMAGE_LINGUAS

PATCH Superseded Alex Kiernan 2 participants 4 messages Jan 2, 2023 – Jan 3, 2023

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 classes: image: Set empty weak default IMAGE_LINGUAS

This is already set in default-distrovars.inc and so this assignment will almost never succeed. Rather than leaving it to confuse, set an empty weak default.

---

 meta/classes-recipe/image.bbclass | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
meta/classes-recipe/image.bbclass +1 -2
index e387645503ad..d4bf02784ab0 100644
@@ -182,8 +182,7 @@ python () {
 
 IMAGE_POSTPROCESS_COMMAND ?= ""
 
-# some default locales
-IMAGE_LINGUAS ?= "de-de fr-fr en-gb"
+IMAGE_LINGUAS ??= ""
 
 LINGUAS_INSTALL ?= "${@" ".join(map(lambda s: "locale-base-%s" % s, d.getVar('IMAGE_LINGUAS').split()))}"
 
Signature · 1 line
2.39.0
#1 lore raw

PATCH 2/2 default-distrovars: Include "c" in IMAGE_LINGUAS for glibc

glibc 2.35 introduced C.UTF-8, we should include this by default.

---

 meta/conf/distro/include/default-distrovars.inc | 2 ++
 1 file changed, 2 insertions(+)
meta/conf/distro/include/default-distrovars.inc +2 -0
index abf48f79f08a..5324bd543d22 100644
@@ -5,6 +5,8 @@ KERNEL_CONSOLE ?= "ttyS0"
 KEEPUIMAGE ??= "yes"
 
 IMAGE_LINGUAS ?= "en-us en-gb"
+IMAGE_LINGUAS:libc-glibc ?= "c en-us en-gb"
+
 ENABLE_BINARY_LOCALE_GENERATION ?= "1"
 LOCALE_UTF8_ONLY ?= "0"
 LOCALE_UTF8_IS_DEFAULT ?= "1"
Signature · 1 line
2.39.0
#2 lore raw

Re: [OE-Core][PATCH 2/2] default-distrovars: Include "c" in IMAGE_LINGUAS for glibc

Quoted 13 lines · Alex Kiernan

glibc 2.35 introduced C.UTF-8, we should include this by default.

---

 meta/conf/distro/include/default-distrovars.inc | 2 ++
 1 file changed, 2 insertions(+)
meta/conf/distro/include/default-distrovars.inc +0 -0
index abf48f79f08a..5324bd543d22 100644

meta/conf/distro/include/default-distrovars.inc KERNEL_CONSOLE ?= "ttyS0" · line 12

Quoted 8 lines
meta/conf/distro/include/default-distrovars.inc +2 -0
@@ -5,6 +5,8 @@ KERNEL_CONSOLE ?= "ttyS0"
 KEEPUIMAGE ??= "yes"
 
 IMAGE_LINGUAS ?= "en-us en-gb"
+IMAGE_LINGUAS:libc-glibc ?= "c en-us en-gb"
+
 ENABLE_BINARY_LOCALE_GENERATION ?= "1"
 LOCALE_UTF8_ONLY ?= "0"
 LOCALE_UTF8_IS_DEFAULT ?= "1"

I suspect this will catch people out since if someone does:

IMAGE_LINGUAS = "xxx"

then it won't work for glibc due to the override. I suspect what we need will be more like:

DEFAULT_IMAGE_LINGUAS = "en-us en-gb" DEFAULT_IMAGE_LINGUAS:libc-glibc = "c en-us en-gb" IMAGE_LINGUAS ?= "${DEFAULT_IMAGE_LINGUAS}"

?

Cheers,

Richard

#3 lore raw

Re: [OE-Core][PATCH 2/2] default-distrovars: Include "c" in IMAGE_LINGUAS for glibc

Quoted 28 lines · Richard Purdie
Quoted 13 lines · Alex Kiernan

glibc 2.35 introduced C.UTF-8, we should include this by default.

---

 meta/conf/distro/include/default-distrovars.inc | 2 ++
 1 file changed, 2 insertions(+)
meta/conf/distro/include/default-distrovars.inc +0 -0
index abf48f79f08a..5324bd543d22 100644

meta/conf/distro/include/default-distrovars.inc KERNEL_CONSOLE ?= "ttyS0" · line 12

Quoted 8 lines
meta/conf/distro/include/default-distrovars.inc +2 -0
@@ -5,6 +5,8 @@ KERNEL_CONSOLE ?= "ttyS0"
 KEEPUIMAGE ??= "yes"
 
 IMAGE_LINGUAS ?= "en-us en-gb"
+IMAGE_LINGUAS:libc-glibc ?= "c en-us en-gb"
+
 ENABLE_BINARY_LOCALE_GENERATION ?= "1"
 LOCALE_UTF8_ONLY ?= "0"
 LOCALE_UTF8_IS_DEFAULT ?= "1"

I suspect this will catch people out since if someone does:

IMAGE_LINGUAS = "xxx"

Quoted 8 lines

then it won't work for glibc due to the override. I suspect what we need will be more like:

DEFAULT_IMAGE_LINGUAS = "en-us en-gb" DEFAULT_IMAGE_LINGUAS:libc-glibc = "c en-us en-gb" IMAGE_LINGUAS ?= "${DEFAULT_IMAGE_LINGUAS}"

?

I was slightly surprised when it did appear to work,expecting the override to win - but I guess that's possibly because I've set it in local.conf and not an image recipe:

#
# $IMAGE_LINGUAS [4 operations]
# set /home/alexk/poky/build/conf/local.conf:303
# ""
# set? /home/alexk/poky/meta/conf/distro/include/default-distrovars.inc:7
# "en-us en-gb"
# set /home/alexk/poky/meta/conf/documentation.conf:218
# [doc] "Specifies the list of locales to install into the image
during the root filesystem construction process."
# override[libc-glibc]:set?
/home/alexk/poky/meta/conf/distro/include/default-distrovars.inc:8
# "c en-us en-gb"

# pre-expansion value:
#   ""
IMAGE_LINGUAS=""

But the DEFAULT_IMAGE_LINGUAS is much more obvious and for some reason simply didn't occur when I wrote this! I'll send a v2.

Signature · 1 line
Alex Kiernan