[lxc-devel] [PATCH 1/4] lxc-ubuntu: Always create the needed locales

Serge Hallyn serge.hallyn at canonical.com
Thu Nov 29 14:44:12 UTC 2012


Quoting Stéphane Graber (stgraber at ubuntu.com):
> 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 at ubuntu.com>

Acked-by: Serge E. Hallyn <serge.hallyn at ubuntu.com>

> ---
>  templates/lxc-ubuntu.in | 18 +++++++++---------
>  1 file changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/templates/lxc-ubuntu.in b/templates/lxc-ubuntu.in
> index 90021fa..c9d4649 100644
> --- a/templates/lxc-ubuntu.in
> +++ b/templates/lxc-ubuntu.in
> @@ -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
>  
> -- 
> 1.8.0
> 
> 
> ------------------------------------------------------------------------------
> Keep yourself connected to Go Parallel: 
> INSIGHTS What's next for parallel hardware, programming and related areas?
> Interviews and blogs by thought leaders keep you ahead of the curve.
> http://goparallel.sourceforge.net
> _______________________________________________
> Lxc-devel mailing list
> Lxc-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/lxc-devel




More information about the lxc-devel mailing list