diff --git a/factory/templates/locale.conf.in b/factory/templates/locale.conf.in
new file mode 100644
index 0000000000..af93d043ec
--- /dev/null
+++ b/factory/templates/locale.conf.in
@@ -0,0 +1,3 @@
+# This is the fallback locale configuration provided by systemd.
+
+LANG="{{ SYSTEMD_DEFAULT_LOCALE }}"
diff --git a/factory/templates/meson.build b/factory/templates/meson.build
new file mode 100644
index 0000000000..821f176a74
--- /dev/null
+++ b/factory/templates/meson.build
@@ -0,0 +1,11 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+factory_etc_dir = factorydir / 'etc'
+
+custom_target(
+ 'locale.conf',
+ input : 'locale.conf.in',
+ output : 'locale.conf',
+ command : [meson_render_jinja2, config_h, '@INPUT@', '@OUTPUT@'],
+ install : true,
+ install_dir : factory_etc_dir)
diff --git a/man/locale.conf.xml b/man/locale.conf.xml
index b24ad9cf2e..df19f1a435 100644
--- a/man/locale.conf.xml
+++ b/man/locale.conf.xml
@@ -32,7 +32,8 @@
The basic file format of locale.conf is
a newline-separated list of environment-like shell-compatible
- variable assignments. It is possible to source the configuration
+ variable assignments, ignoring comments and empty lines.
+ It is possible to source the configuration
from shell scripts, however, beyond mere variable assignments, no
shell features are supported, allowing applications to read the
file without implementing a shell compatible execution
@@ -64,14 +65,14 @@
might be checked for locale configuration as well, however only as
fallback.
- /etc/locale.conf is usually created and updated
+ /etc/locale.conf can be updated
using
systemd-localed.service8.
localectl1
may be used to alter the settings in this file during runtime from
the command line. Use
systemd-firstboot1
- to initialize them on mounted (but not booted) system images.
+ to customize them on mounted (but not booted) system images.
@@ -107,7 +108,9 @@
/etc/locale.conf:
- LANG=de_DE.UTF-8
+ # Custom settings
+
+LANG=de_DE.UTF-8
LC_MESSAGES=en_US.UTF-8
diff --git a/meson.build b/meson.build
index 93c0cdd230..2665024426 100644
--- a/meson.build
+++ b/meson.build
@@ -3711,6 +3711,7 @@ subdir('docs/var-log')
install_subdir('factory/etc',
install_dir : factorydir)
+subdir('factory/templates')
if install_sysconfdir
install_data('xorg/50-systemd-user.sh',
diff --git a/tmpfiles.d/etc.conf.in b/tmpfiles.d/etc.conf.in
index ebdc699c26..2fdd498da5 100644
--- a/tmpfiles.d/etc.conf.in
+++ b/tmpfiles.d/etc.conf.in
@@ -12,6 +12,7 @@ L+ /etc/mtab - - - - ../proc/self/mounts
{% if HAVE_SMACK_RUN_LABEL %}
t /etc/mtab - - - - security.SMACK64=_
{% endif %}
+C! /etc/locale.conf - - - -
C! /etc/nsswitch.conf - - - -
{% if HAVE_PAM %}
C! /etc/pam.d - - - -