From 29663cdbff0392f279b81447c2c7f4cade54c040 2016-06-19 08:11:17 From: drtyhlpr Date: 2016-06-19 08:11:17 Subject: [PATCH] Fixed: DEFLOCAL now works with MINBASE, author added on request --- diff --git a/README.md b/README.md index 3179047..2476850 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ Set system host name. It's recommended that the host name is unique in the corre Set system `root` password. The same password is used for the created user `pi`. It's **STRONGLY** recommended that you choose a custom password. ##### `DEFLOCAL`="en_US.UTF-8" -Set default system locale. This setting can also be changed inside the running OS using the `dpkg-reconfigure locales` command. The script variant `minbase` (ENABLE_MINBASE=true) doesn't install `locales`. +Set default system locale. This setting can also be changed inside the running OS using the `dpkg-reconfigure locales` command. Please note that on using this parameter the script will automatically install the required packages `locales`, `keyboard-configuration` and `console-setup`. ##### `TIMEZONE`="Europe/Berlin" Set default system timezone. All available timezones can be found in the `/usr/share/zoneinfo/` directory. This setting can also be changed inside the running OS using the `dpkg-reconfigure tzdata` command. diff --git a/bootstrap.d/12-locale.sh b/bootstrap.d/12-locale.sh index bd1edf4..bb60178 100644 --- a/bootstrap.d/12-locale.sh +++ b/bootstrap.d/12-locale.sh @@ -10,7 +10,7 @@ echo ${TIMEZONE} > "${ETCDIR}/timezone" chroot_exec dpkg-reconfigure -f noninteractive tzdata # Install and setup default locale and keyboard configuration -if [ "$ENABLE_MINBASE" = false ] ; then +if [ $(echo "$APT_INCLUDES" | grep ",locales") ] ; 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 @@ -52,7 +52,7 @@ if [ "$ENABLE_MINBASE" = false ] ; then ;; esac chroot_exec dpkg-reconfigure -f noninteractive console-setup -else # ENABLE_MINBASE=true +else # (no locales were installed) # Install POSIX default locale install_readonly files/locales/locale "${ETCDIR}/default/locale" fi diff --git a/rpi2-gen-image.sh b/rpi2-gen-image.sh index fad70cf..5a4d2d3 100755 --- a/rpi2-gen-image.sh +++ b/rpi2-gen-image.sh @@ -1,7 +1,7 @@ #!/bin/sh ######################################################################## -# rpi2-gen-image.sh ver2a 12/2015 +# rpi2-gen-image.sh 2015-2016 # # Advanced debian "jessie" bootstrap script for RPi2 # @@ -10,9 +10,9 @@ # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # -# some parts based on rpi2-build-image: -# Copyright (C) 2015 Ryan Finnie -# Copyright (C) 2015 Luca Falavigna +# Copyright (C) 2015 Jan Wagner +# +# Big thanks for patches and enhancements by 10+ github contributors! ######################################################################## # Are we running as root? @@ -265,7 +265,7 @@ set -x trap cleanup 0 1 2 3 6 # Add required packages for the minbase installation -if [ "$ENABLE_MINBASE" = true ] ; then +if [ "$ENABLE_MINBASE" = true ] && [ "$DEFLOCAL" == "en_US.UTF-8" ] ; then APT_INCLUDES="${APT_INCLUDES},vim-tiny,netbase,net-tools,ifupdown" else APT_INCLUDES="${APT_INCLUDES},locales,keyboard-configuration,console-setup"