From ddf2a40ee91694dc0f8006cfbc9844acd4f36a68 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Tue, 15 Oct 2013 10:51:52 +0200 Subject: [PATCH] Support $DEFAULT_LOCALES to enable specified locales as default Defaults to en_US.UTF-8 --- chroot-script | 10 +++++++++- config | 4 ++++ grml-debootstrap | 2 ++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/chroot-script b/chroot-script index cf99596..6d01a89 100755 --- a/chroot-script +++ b/chroot-script @@ -428,6 +428,14 @@ EOF } # }}} +# set default locales {{{ +default_locales() { + if [ -n "$DEFAULT_LOCALES" ] ; then + update-locale LANG="$DEFAULT_LOCALES" + fi +} +# }}} + # adjust timezone {{{ timezone() { if [ -n "$TIMEZONE" ] ; then @@ -608,7 +616,7 @@ trap signal_handler HUP INT QUIT TERM for i in chrootmirror grmlrepos backportrepos kernelimg_conf \ kernel packages extrapackages reconfigure hosts interfaces \ - timezone fstab hostname initrd grub_install passwords \ + default_locales timezone fstab hostname initrd grub_install passwords \ custom_scripts upgrade_system remove_apt_cache services \ remove_chrootmirror; do if stage $i ; then diff --git a/config b/config index 3ae4cf6..8cec882 100644 --- a/config +++ b/config @@ -175,6 +175,10 @@ # Default: 'yes' # LOCALES='no' +# locales that should be used as default. +# Default: 'en_US.UTF-8' +# DEFAULT_LOCALES='en_US.UTF-8' + # Use /usr/share/zoneinfo/$TIMEZONE for /etc/localtime. # Default: 'Europe/Vienna' # TIMEZONE='Europe/Vienna' diff --git a/grml-debootstrap b/grml-debootstrap index 0068542..a613c93 100755 --- a/grml-debootstrap +++ b/grml-debootstrap @@ -19,6 +19,7 @@ CONFFILES='/etc/debootstrap' DEBCONF='yes' DEBIAN_FRONTEND='noninteractive' DEBOOTSTRAP='debootstrap' +DEFAULT_LOCALES='en_US.UTF-8' EXTRAPACKAGES='yes' FALLBACK_MIRROR='http://http.debian.net/debian' FORCE='' @@ -1100,6 +1101,7 @@ preparechroot() { [ -n "$DEBCONF" ] && echo "DEBCONF=\"$DEBCONF\"" >> $CHROOT_VARIABLES [ -n "$DEBIAN_FRONTEND" ] && echo "DEBIAN_FRONTEND=\"$DEBIAN_FRONTEND\"" >> $CHROOT_VARIABLES [ -n "$DEBOOTSTRAP" ] && echo "DEBOOTSTRAP=\"$DEBOOTSTRAP\"" >> $CHROOT_VARIABLES + [ -n "$DEFAULT_LOCALES" ] && echo "DEFAULT_LOCALES=\"$DEFAULT_LOCALES\"" >> $CHROOT_VARIABLES [ -n "$EXTRAPACKAGES" ] && echo "EXTRAPACKAGES=\"$EXTRAPACKAGES\"" >> $CHROOT_VARIABLES [ -n "$FALLBACK_MIRROR" ] && echo "FALLBACK_MIRROR=\"$FALLBACK_MIRROR\"" >> $CHROOT_VARIABLES [ -n "$FORCE" ] && echo "FORCE=\"$FORCE\"" >> $CHROOT_VARIABLES -- 2.1.4