]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
lxc-ubuntu: Always create the needed locales
authorStéphane Graber <stgraber@ubuntu.com>
Wed, 28 Nov 2012 23:29:55 +0000 (18:29 -0500)
committerStéphane Graber <stgraber@ubuntu.com>
Thu, 29 Nov 2012 15:26:20 +0000 (10:26 -0500)
Move some old code from the trim() function into the main configure_ubuntu
function so that we always create a locale in the container.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
templates/lxc-ubuntu.in

index 90021fa8e240851503e41ca5cf48b9b6f2c048f6..c9d464987695984946f6b1d242f9ec89d92ce0e3 100644 (file)
@@ -80,6 +80,15 @@ EOF
         echo "ubuntu:ubuntu" | chroot $rootfs chpasswd
     fi
 
+    # make sure we have the current locale defined in the container
+    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
+
     return 0
 }
 
@@ -431,15 +440,6 @@ EOF
 # /lib/init/fstab: cleared out for bare-bones lxc
 EOF
 
-    # reconfigure some services
-    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 ondemand remove