From: 有张纸 Date: Wed, 1 Jul 2015 15:39:08 +0000 (+0800) Subject: debian template: reconfigure locales X-Git-Tag: lxc-1.1.3~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=063537f6db6b25c6bd8c9b20fc5b1b6e4e72aed4;p=thirdparty%2Flxc.git debian template: reconfigure locales Signed-off-by: feng xiahou --- diff --git a/templates/lxc-debian.in b/templates/lxc-debian.in index 517fd8098..6628fc924 100644 --- a/templates/lxc-debian.in +++ b/templates/lxc-debian.in @@ -97,22 +97,6 @@ $hostname 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 # remove pointless services in a container chroot $rootfs /usr/sbin/update-rc.d -f checkroot.sh disable @@ -409,6 +393,25 @@ EOF # Re-enable service startup rm ${rootfs}/usr/sbin/policy-rc.d + + # reconfigure locales + 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 + # end } clean()