From 0f541e331323cc18e30a219650b16a1488a0a137 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=89=E5=BC=A0=E7=BA=B8?= Date: Fri, 22 May 2015 21:26:35 +0800 Subject: [PATCH] Update lxc-debian.in MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix "bash: warning: setlocale: LC_ALL: cannot change locale" Signed-off-by: Acked-by: Stéphane Graber --- templates/lxc-debian.in | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/templates/lxc-debian.in b/templates/lxc-debian.in index 936b3645a..29d4d448d 100644 --- a/templates/lxc-debian.in +++ b/templates/lxc-debian.in @@ -97,12 +97,18 @@ EOF # reconfigure some services if [ -z "$LANG" ]; then + cat >> $rootfs/etc/locale.gen << EOF +en_US.UTF-8 UTF-8 +EOF chroot $rootfs locale-gen en_US.UTF-8 UTF-8 chroot $rootfs update-locale LANG=en_US.UTF-8 else encoding=$(echo $LANG | cut -d. -f2) chroot $rootfs sed -e "s/^# \(${LANG} ${encoding}\)/\1/" \ -i /etc/locale.gen 2> /dev/null + cat >> $rootfs/etc/locale.gen << EOF +$LANG $encoding +EOF chroot $rootfs locale-gen $LANG $encoding chroot $rootfs update-locale LANG=$LANG fi