Comment 7 for bug 2038945

Revision history for this message
Steve Langasek (vorlon) wrote :

Two pieces to this. The raspi images are generated with ubuntu-image rather than the legacy livecd-rootfs code; but the legacy livecd-rootfs code includes this fixup in live-build/auto/build:

        case $PROJECT:${SUBPROJECT:-} in
                ubuntu-server:*|ubuntu-cpc:*|ubuntu:desktop-preinstalled|ubuntu-
wsl:*)
                        # Set locale to C.UTF-8 by default. We should
                        # probably do this for all images early in the
                        # 18.10 cycle but for now just do it for
                        # server and cpc products.
                        echo "LANG=C.UTF-8" > chroot/etc/default/locale
                        ;;
        esac

Instead, the Pi image has:

$ cat /mnt/etc/default/locale
# File generated by update-locale
$

So there is no default locale set.

This is wrong, because when there is no locale set in the environment, glibc defaults to C instead of C.UTF-8 and we do not want to ever anywhere be using ASCII as our default character set instead of UTF-8. (I *think* this is still the meaning of 'POSIX' as a locale in glibc. If 'POSIX' does now map to C.UTF-8, then it's not actually wrong but as we don't know that's the case and haven't de-configured the other images, we should for the time being assume glibc is wrong and make sure our images enforce the intended default.)

It is also wrong that, when no locale is configured in the target, cloud-init decides the default should be en_US.UTF-8. cloud-init should ALSO default to C.UTF-8, which is statically available in our glibc package, instead of generating an en_US.UTF-8 locale.