public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH v3 0/1] Set default locale in /etc/locale.conf
@ 2022-10-25 10:26 T. Schaffner
  2022-10-25 10:26 ` [PATCH v3 1/1] " T. Schaffner
  2022-11-03  8:54 ` [PATCH v3 0/1] " Anton Mikanovich
  0 siblings, 2 replies; 3+ messages in thread
From: T. Schaffner @ 2022-10-25 10:26 UTC (permalink / raw)
  To: isar-users
  Cc: henning.schild, felix.moessbauer, jan.kiszka, florian.bezdeka,
	ubely, Tobias Schaffner

From: Tobias Schaffner <tobias.schaffner@siemens.com>

Changes since v2:
- Resend patch with correct formatting

Changes since v1:
- Debian started packaging systemd-firstboot with version 251. Only create
  /etc/locale.conf with systemd v251 or higher.
- Symlink to /etc/default/locale as it has the same format and we do not want to
  maintain two different files.

Tobias Schaffner (1):
  Set default locale in /etc/locale.conf

 meta/classes/image-locales-extension.bbclass | 8 ++++++++
 1 file changed, 8 insertions(+)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH v3 1/1] Set default locale in /etc/locale.conf
  2022-10-25 10:26 [PATCH v3 0/1] Set default locale in /etc/locale.conf T. Schaffner
@ 2022-10-25 10:26 ` T. Schaffner
  2022-11-03  8:54 ` [PATCH v3 0/1] " Anton Mikanovich
  1 sibling, 0 replies; 3+ messages in thread
From: T. Schaffner @ 2022-10-25 10:26 UTC (permalink / raw)
  To: isar-users
  Cc: henning.schild, felix.moessbauer, jan.kiszka, florian.bezdeka,
	ubely, Tobias Schaffner

From: Tobias Schaffner <tobias.schaffner@siemens.com>

Debian bookworm introduced systemd-firstboot [1] which asks the user to
configure some basic settings like hostname, timezone or locale if not already
configured.

It asks the user interactively to select a locale on first boot as we do not
have it set in /etc/locale.conf [2].

/etc/locale.conf has the same format as /etc/default/locale.

Symlink /etc/locale.conf to /etc/default/locale for bookworm images to allow
booting without user interaction.

[1] https://www.freedesktop.org/software/systemd/man/systemd-firstboot.html
[2] https://man7.org/linux/man-pages/man5/locale.conf.5.html

Signed-off-by: Tobias Schaffner <tobias.schaffner@siemens.com>
---
 meta/classes/image-locales-extension.bbclass | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/meta/classes/image-locales-extension.bbclass b/meta/classes/image-locales-extension.bbclass
index 2db6d4a..9def316 100644
--- a/meta/classes/image-locales-extension.bbclass
+++ b/meta/classes/image-locales-extension.bbclass
@@ -82,6 +82,14 @@ __EOF__
             debconf-set-selections /tmp/locale.debconf
             rm -f '/tmp/locale.debconf'
 
+            SYSTEMD_VERSION=$(dpkg-query \
+                --showformat='${source:Upstream-Version}' \
+                --show systemd || echo "0" )
+
+            if dpkg --compare-versions "$SYSTEMD_VERSION" "ge" "251"; then
+                ln -s /etc/default/locale /etc/locale.conf
+            fi
+
             echo 'reconfigure locales'
             dpkg-reconfigure -f noninteractive locales
 
-- 
2.34.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v3 0/1] Set default locale in /etc/locale.conf
  2022-10-25 10:26 [PATCH v3 0/1] Set default locale in /etc/locale.conf T. Schaffner
  2022-10-25 10:26 ` [PATCH v3 1/1] " T. Schaffner
@ 2022-11-03  8:54 ` Anton Mikanovich
  1 sibling, 0 replies; 3+ messages in thread
From: Anton Mikanovich @ 2022-11-03  8:54 UTC (permalink / raw)
  To: T. Schaffner, isar-users
  Cc: henning.schild, felix.moessbauer, jan.kiszka, florian.bezdeka, ubely

25.10.2022 13:26, T. Schaffner wrote:
> From: Tobias Schaffner <tobias.schaffner@siemens.com>
>
> Changes since v2:
> - Resend patch with correct formatting
>
> Changes since v1:
> - Debian started packaging systemd-firstboot with version 251. Only create
>    /etc/locale.conf with systemd v251 or higher.
> - Symlink to /etc/default/locale as it has the same format and we do not want to
>    maintain two different files.
>
> Tobias Schaffner (1):
>    Set default locale in /etc/locale.conf
>
>   meta/classes/image-locales-extension.bbclass | 8 ++++++++
>   1 file changed, 8 insertions(+)
>
Applied to next, thanks.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-11-03  8:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-25 10:26 [PATCH v3 0/1] Set default locale in /etc/locale.conf T. Schaffner
2022-10-25 10:26 ` [PATCH v3 1/1] " T. Schaffner
2022-11-03  8:54 ` [PATCH v3 0/1] " Anton Mikanovich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox