home · contact · privacy
Declare (most basic) locale.
authorPlom Heller <plom@plomlompom.com>
Wed, 2 Sep 2026 19:40:24 +0000 (21:40 +0200)
committerPlom Heller <plom@plomlompom.com>
Wed, 2 Sep 2026 19:40:24 +0000 (21:40 +0200)
start_root.sh

index ceea52f371d07b70e78257c1a77bf3bcd2122ed1..ecd4d11475bc2adfd930c48eefa929bfa90c782c 100755 (executable)
@@ -4,10 +4,12 @@ cd "$(dirname "$0")" || exit
 
 # constants unlikely to change
 FNAME_START_HOME=start_home.sh
+PATH_DEFAULT_LOCALE=/etc/default/locale
 PATH_SYSCTL_PRINTK=/etc/sysctl.d/60-printk-console.conf
 PATH_TLP_THRESH_CONF=/etc/tlp.conf.d/60-thresholds.conf
 
 # constants we might want to change at some point
+LOCALE=C.UTF-8
 TO_INSTALL="man-db ntpsec-ntpdate sudo sway tlp vim"
 USERNAME=plom
 PRINTK_LEVELS="4 4 1 7"
@@ -21,6 +23,12 @@ msg 'Ensuring packages: %s' "${TO_INSTALL}"
 apt-get -y update
 apt-get -y install ${TO_INSTALL}
 
+# C.UTF-8 is built into glibc itself (unlike e.g. en_US.UTF-8), so no
+# "locales" package / locale-gen is needed to make it available — writing
+# it here is enough for it to apply system-wide from the next login on.
+msg 'Setting system locale to %s …' "${LOCALE}"
+printf 'LANG=%s\n' "${LOCALE}" >| "${PATH_DEFAULT_LOCALE}"
+
 msg 'Quieting routine kernel messages on the console …'
 printf 'kernel.printk = %s\n' "${PRINTK_LEVELS}" >| "${PATH_SYSCTL_PRINTK}"
 sysctl -p "${PATH_SYSCTL_PRINTK}"