]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
generate locales on debian
authorDaniel Lezcano <daniel.lezcano@free.fr>
Mon, 7 Jun 2010 09:33:55 +0000 (11:33 +0200)
committerDaniel Lezcano <dlezcano@fr.ibm.com>
Mon, 7 Jun 2010 09:33:55 +0000 (11:33 +0200)
Let's do like the ubuntu template and generate locales automatically.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
templates/lxc-debian.in

index 5a6f5532b1da9d646b0cc54034d47f6ae7a554a5..e3c88836635dc0cf487a1b4cf951345a8e826503 100644 (file)
@@ -13,7 +13,7 @@
 
 # This library is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 # Lesser General Public License for more details.
 
 # You should have received a copy of the GNU Lesser General Public
@@ -64,7 +64,13 @@ $hostname
 EOF
 
     # reconfigure some services
-    chroot $rootfs locale-gen en_US.UTF-8
+    if [ -z "$LANG" ]; then
+       chroot $rootfs locale-gen en_US.UTF-8
+       chroot $rootfs update-locale LANG=en_US.UTF-8
+    else
+       chroot $rootfs locale-gen $LANG
+       chroot $rootfs update-locale LANG=$LANG
+    fi
 
     # remove pointless services in a container
     chroot $rootfs /usr/sbin/update-rc.d -f umountfs remove