From: "'Felix Moessbauer' via isar-users" <isar-users@googlegroups.com>
To: isar-users@googlegroups.com
Cc: jan.kiszka@siemens.com, Felix Moessbauer <felix.moessbauer@siemens.com>
Subject: [PATCH 3/4] fix(rootfs): only set custom locale in image recipe
Date: Tue, 15 Sep 2026 11:32:57 +0200 [thread overview]
Message-ID: <20260915093258.1818604-4-felix.moessbauer@siemens.com> (raw)
In-Reply-To: <20260915093258.1818604-1-felix.moessbauer@siemens.com>
In a16ca927 it was discovered, that the package maintainer scripts
behave differently depending on the exported locale during package
installation. This was adressed by always setting the desired locale
during rootfs install. However, as this change was applied in the rootfs
class, it also affected all other chroots, reducing the sstate cache
hits and resulting in unintended side effects (like inconsistencies
between the exported locale and the available locales in that rootfs).
We fix this by only overwriting the locale settings if the
image-locale-extension class is inherited. By that, the locale
changes only affect the image rootfs.
Fixes: a16ca927 ("rootfs: use LOCALE_DEFAULT with default "C" ...")
Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
---
meta/classes-recipe/image-locales-extension.bbclass | 5 +++++
meta/classes-recipe/rootfs.bbclass | 7 +++----
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/meta/classes-recipe/image-locales-extension.bbclass b/meta/classes-recipe/image-locales-extension.bbclass
index c03f34c0..66f3ac8c 100644
--- a/meta/classes-recipe/image-locales-extension.bbclass
+++ b/meta/classes-recipe/image-locales-extension.bbclass
@@ -9,6 +9,11 @@
LOCALE_GEN ?= "en_US.UTF-8 UTF-8\n\
en_US ISO-8859-1\n"
LOCALE_DEFAULT ?= "en_US.UTF-8"
+# set locale used during package installation, which is visible to
+# maintainer scripts (e.g. used in console-setup)
+export LANG = "${LOCALE_DEFAULT}"
+export LANGUAGE = "${LOCALE_DEFAULT}"
+export LC_ALL = "${LOCALE_DEFAULT}"
def get_locale_gen(d, sep='\n'):
locale_gen = d.getVar("LOCALE_GEN") or ""
diff --git a/meta/classes-recipe/rootfs.bbclass b/meta/classes-recipe/rootfs.bbclass
index d3b0d471..bbaafa01 100644
--- a/meta/classes-recipe/rootfs.bbclass
+++ b/meta/classes-recipe/rootfs.bbclass
@@ -93,10 +93,9 @@ def get_rootfs_distro(d):
export E = "${@ isar_export_proxies(d)}"
export DEBIAN_FRONTEND = "noninteractive"
# To avoid Perl locale warnings:
-LOCALE_DEFAULT ??= "C"
-export LANG = "${LOCALE_DEFAULT}"
-export LANGUAGE = "${LOCALE_DEFAULT}"
-export LC_ALL = "${LOCALE_DEFAULT}"
+export LANG ??= "C"
+export LANGUAGE ??= "C"
+export LC_ALL ??= "C"
# Execute a command against a rootfs and with isar-apt bind-mounted.
# Additional mounts may be specified using --bind <source> <target> and a
--
2.55.0
--
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/20260915093258.1818604-4-felix.moessbauer%40siemens.com.
next prev parent reply other threads:[~2026-09-15 9:33 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-15 9:32 [PATCH 0/4] Rework locale generation 'Felix Moessbauer' via isar-users
2026-09-15 9:32 ` [PATCH 1/4] testsuite: add test for " 'Felix Moessbauer' via isar-users
2026-09-15 9:32 ` [PATCH 2/4] bootstrap: avoid leading space in locale config 'Felix Moessbauer' via isar-users
2026-09-15 9:32 ` 'Felix Moessbauer' via isar-users [this message]
2026-09-15 9:32 ` [PATCH 4/4] rootfs: manually purge locales instead of using localepurge 'Felix Moessbauer' via isar-users
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260915093258.1818604-4-felix.moessbauer@siemens.com \
--to=isar-users@googlegroups.com \
--cc=felix.moessbauer@siemens.com \
--cc=jan.kiszka@siemens.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox