From b0cc9f7dbdada6913c6ff50b29a5ae09ad954bf1 Mon Sep 17 00:00:00 2001 From: /rootzoll Date: Wed, 2 Oct 2024 10:56:49 +0200 Subject: [PATCH] #4566 Fixing Locale (#4770) * set locale for all systems to US english & remove old bullseye sources * enable the english US locales --- build_sdcard.sh | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/build_sdcard.sh b/build_sdcard.sh index c75779f3a..c6266b8bf 100644 --- a/build_sdcard.sh +++ b/build_sdcard.sh @@ -10,6 +10,13 @@ # setup fresh SD card with image above - login via SSH and run this script: ########################################################################## +# set locale to en_US.UTF-8 on system & activate for this script +sed -i "s/^# en_US.UTF-8 UTF-8.*/en_US.UTF-8 UTF-8/g" /etc/locale.gen +sed -i "s/^# en_US ISO-8859-1.*/en_US ISO-8859-1/g" /etc/locale.gen +locale-gen en_US.UTF-8 en_US ISO-8859-1 +update-locale LANG=en_US.UTF-8 +source /etc/default/locale + defaultRepo="raspiblitz" # user that hosts a `raspiblitz` repo defaultBranch="v1.11" # latest version branch @@ -324,24 +331,6 @@ if [ ${isDebianInHosts} -eq 0 ]; then systemctl restart networking fi -# FIXING LOCALES -# https://github.com/rootzoll/raspiblitz/issues/138 -# https://daker.me/2014/10/how-to-fix-perl-warning-setting-locale-failed-in-raspbian.html -# https://stackoverflow.com/questions/38188762/generate-all-locales-in-a-docker-image -if [ "${cpu}" = "aarch64" ] && { [ "${baseimage}" = "raspios_arm64" ] || [ "${baseimage}" = "debian" ]; }; then - echo -e "\n*** FIXING LOCALES FOR BUILD ***" - sed -i "s/^# en_US.UTF-8 UTF-8.*/en_US.UTF-8 UTF-8/g" /etc/locale.gen - sed -i "s/^# en_US ISO-8859-1.*/en_US ISO-8859-1/g" /etc/locale.gen - locale-gen - export LC_ALL=C - export LANGUAGE=en_US.UTF-8 - export LANG=en_US.UTF-8 - if [ ! -f /etc/apt/sources.list.d/raspi.list ]; then - echo "# Add the archive.raspberrypi.org/debian/ to the sources.list" - echo "deb http://archive.raspberrypi.org/debian/ bullseye main" | tee /etc/apt/sources.list.d/raspi.list - fi -fi - echo "*** Remove unnecessary packages ***" unnecessary_packages=(libreoffice* oracle-java* chromium-browser nuscratch scratch sonic-pi plymouth python2 vlc* cups) for pkg in "${unnecessary_packages[@]}"; do