@@ -727,3 +727,23 @@ Changes in next
This was never documented and never had practical relevance. `oci-archive` is
the useful OCI image format that can be imported, e.g., by podman.
+
+### Configure Locale Exports Using LOCALE_DEFAULT
+
+The LOCALE_DEFAULT variable is now used to export LANG, LANGUAGE, and LC_ALL
+in the rootfs.bbclass, replacing the previous hardcoded "C" values. It is
+weakly assigned a default value of "C". This value can be overridden by image
+recipes via the image-locales-extension class (inherited by the image class),
+for example, to set it to "en_US.UTF-8".
+
+This enables configuring the default locale and keyboard layout at build time.
+Additionally, if console-setup is installed in the rootfs during the build, it
+will be configured based on the locale exports.
+
+To set a locale other than "C" or "en_US.UTF-8" (generated by default), define
+the following variables in your image recipe. For example, to use German, add:
+
+```
+LOCALE_GEN = "de_DE.UTF-8 UTF-8\n"
+LOCALE_DEFAULT = "de_DE.UTF-8"
+```
@@ -30,9 +30,10 @@ ROOTFS_STUBS_DIR = "/usr/local/isar-sbin"
export E = "${@ isar_export_proxies(d)}"
export DEBIAN_FRONTEND = "noninteractive"
# To avoid Perl locale warnings:
-export LANG = "C"
-export LANGUAGE = "C"
-export LC_ALL = "C"
+LOCALE_DEFAULT ??= "C"
+export LANG = "${LOCALE_DEFAULT}"
+export LANGUAGE = "${LOCALE_DEFAULT}"
+export LC_ALL = "${LOCALE_DEFAULT}"
rootfs_do_mounts[weight] = "3"
rootfs_do_mounts() {
Some packages, such as console-setup, fail to set a valid CHARMAP according to the locale. For example, image-locales-extension.bbclass sets the default locale to "en_US.UTF-8". However, rootfs.bbclass was exporting hardcoded locale values as "C". Because of this, when console-setup is installed in non-interactive mode during image creation, it sets the CHARMAP based on the "C" locale, causing a configuration mismatch. Set LOCALE_DEFAULT to "C" by default in rootfs.bbclass so it can be overridden by image-locales-extension.bbclass with "en_US.UTF-8", enabling proper CHARMAP setup in console-setup. Signed-off-by: Badrikesh Prusty <badrikesh.prusty@siemens.com> --- RECIPE-API-CHANGELOG.md | 20 ++++++++++++++++++++ meta/classes/rootfs.bbclass | 7 ++++--- 2 files changed, 24 insertions(+), 3 deletions(-)