]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
Update lxc-debian.in
author有张纸 <fanyeren@gmail.com>
Fri, 22 May 2015 13:26:35 +0000 (21:26 +0800)
committerStéphane Graber <stgraber@ubuntu.com>
Tue, 26 May 2015 14:59:16 +0000 (10:59 -0400)
fix "bash: warning: setlocale: LC_ALL: cannot change locale"

Signed-off-by: <feng xiahou xiahoufeng@yahoo.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
templates/lxc-debian.in

index 936b3645a2c79f19bbf08d549efd611f8052b952..29d4d448def6c2aa3e29b0ff0402c98f39bdf633 100644 (file)
@@ -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