aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Knecht <vincent.knecht@mailoo.org>2016-02-20 13:54:44 +0100
committerVincent Knecht <vincent.knecht@mailoo.org>2016-02-20 13:54:44 +0100
commitefb801e4d1169ae571c8100411796a41407f7bf0 (patch)
tree47d52837788a075c152a7979f10d6f9c78f9c4c7
parent8ff1a20fef99593f37c82382fe5c29af91638328 (diff)
downloadrpi2-gen-image-efb801e4d1169ae571c8100411796a41407f7bf0.tar.gz
rpi2-gen-image-efb801e4d1169ae571c8100411796a41407f7bf0.tar.bz2
rpi2-gen-image-efb801e4d1169ae571c8100411796a41407f7bf0.zip
- Moved locales configuration after "apt-get upgrade" sequence to work around
"dpkg-reconfigure locales" bug overwriting previous config - Added debconf selections for locales settings, might be useful when bug mentioned gets fixed - Added 'update-locale' command to actually set up /etc/default/locale - Generate en_US.UTF-8 in any case, as per Debian Refence Manual recommendation
-rwxr-xr-xrpi2-gen-image.sh24
1 files changed, 18 insertions, 6 deletions
diff --git a/rpi2-gen-image.sh b/rpi2-gen-image.sh
index 3c80bf3..637fa37 100755
--- a/rpi2-gen-image.sh
+++ b/rpi2-gen-image.sh
@@ -218,12 +218,6 @@ EOM
echo ${TIMEZONE} >$R/etc/timezone
LANG=C chroot $R dpkg-reconfigure -f noninteractive tzdata
-# Set up default locales to "en_US.UTF-8" default
-if [ "$ENABLE_MINBASE" = false ] ; then
- LANG=C chroot $R sed -i "/${DEFLOCAL}/s/^#//" /etc/locale.gen
- LANG=C chroot $R locale-gen ${DEFLOCAL}
-fi
-
# Upgrade collabora package index and install collabora keyring
echo "deb https://repositories.collabora.co.uk/debian ${RELEASE} rpi2" >$R/etc/apt/sources.list
LANG=C chroot $R apt-get -qq -y update
@@ -247,6 +241,24 @@ EOM
LANG=C chroot $R apt-get -qq -y update
LANG=C chroot $R apt-get -qq -y -u dist-upgrade
+# Set up default locales to "en_US.UTF-8" default
+if [ "$ENABLE_MINBASE" = false ] ; then
+ # Set locale choice in debconf db, even though dpkg-reconfigure ignores and overwrites them due to some bug
+ # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=684134 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=685957
+ # ... so we have to set locales manually
+ if [ "$DEFLOCAL" = "en_US.UTF-8" ] ; then
+ LANG=C chroot $R echo "locales locales/locales_to_be_generated multiselect ${DEFLOCAL} UTF-8" | debconf-set-selections
+ else
+ # en_US.UTF-8 should be available anyway : https://www.debian.org/doc/manuals/debian-reference/ch08.en.html#_the_reconfiguration_of_the_locale
+ LANG=C chroot $R echo "locales locales/locales_to_be_generated multiselect en_US.UTF-8 UTF-8, ${DEFLOCAL} UTF-8" | debconf-set-selections
+ LANG=C chroot $R sed -i "/en_US.UTF-8/s/^#//" /etc/locale.gen
+ fi
+ LANG=C chroot $R sed -i "/${DEFLOCAL}/s/^#//" /etc/locale.gen
+ LANG=C chroot $R echo "locales locales/default_environment_locale select ${DEFLOCAL}" | debconf-set-selections
+ LANG=C chroot $R locale-gen
+ LANG=C chroot $R update-locale LANG=${DEFLOCAL}
+fi
+
# Kernel installation
# Install flash-kernel last so it doesn't try (and fail) to detect the platform in the chroot
LANG=C chroot $R apt-get -qq -y --no-install-recommends install linux-image-3.18.0-trunk-rpi2