diff --git a/deploy-workbench.sh b/deploy-workbench.sh index d96afa3..6995ec4 100755 --- a/deploy-workbench.sh +++ b/deploy-workbench.sh @@ -253,6 +253,27 @@ END2 END )" + +# thanks https://wiki.debian.org/Keyboard +chroot_kbd_conf_str="$(cat< /etc/default/keyboard < /etc/locale.gen +# Generate the locale +locale-gen +# feeds /etc/default/locale for the shell env var +update-locale LANG=${LANG} LC_ALL=${LANG} # this is a high level command that does locale-gen and update-locale altogether -dpkg-reconfigure --frontend=noninteractive locales +# but it is too interactive +#dpkg-reconfigure --frontend=noninteractive locales # DEBUG locale -a @@ -387,6 +416,9 @@ apt-get install -y --no-install-recommends \ < /dev/null ${chroot_netdns_conf_str} +CUSTOM_LANG=${CUSTOM_LANG} +${chroot_kbd_conf_str} +chroot_kbd_conf # Set up root user # this is the root password @@ -406,7 +438,19 @@ CHROOT } prepare_chroot_env() { - LANG="${CUSTOM_LANG:-es_ES.UTF-8}" + CUSTOM_LANG="${CUSTOM_LANG:-es}" + case "${CUSTOM_LANG}" in + es) + export LANG="es_ES.UTF-8" + export MYLOCALE="${LANG} UTF-8" + ;; + en) + export LANG="en_US.UTF-8" + ;; + *) + echo "ERROR: CUSTOM_LANG not supported. Available: es" + exit 1 + esac # version of debian the bootstrap is going to build # if no VERSION_CODENAME is specified we assume that the bootstrap is going to # be build with the same version of debian being executed because some files @@ -430,6 +474,7 @@ prepare_chroot_env() { prepare_app } + # thanks https://willhaley.com/blog/custom-debian-live-environment/ install_requirements() { # Install requirements