This file is indexed.

/lib/live/config/004-locales is in live-config 3.0~a22-1ubuntu1.

This file is owned by root:root, with mode 0o755.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
#!/bin/sh

## live-config(7) - System Configuration Scripts
## Copyright (C) 2006-2011 Daniel Baumann <daniel@debian.org>
##
## live-config comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
## This is free software, and you are welcome to redistribute it
## under certain conditions; see COPYING for details.


Locales ()
{
	# Checking if package is installed or already configured
	if [ ! -e /var/lib/dpkg/info/locales.list ] || \
	   [ -e /var/lib/live/config/locales ]
	then
		return
	fi

	echo -n " locales"

	for _PARAMETER in ${_CMDLINE}
	do
		case "${_PARAMETER}" in
			live-config.locales=*|locales=*)
				LIVE_LOCALES="${_PARAMETER#*locales=}"
				;;
		esac
	done

	Configure_locales
}

Configure_locales ()
{
	if [ -e /etc/default/locale ]
	then
		# use rootfs configured locale
		_LOCALE="$(grep -s 'LANG=' /etc/default/locale | sed s/'LANG='// | tr -d '"' )"
	fi

	if [ -n "${LIVE_LOCALES}" ]
	then
		_LOCALE="${LIVE_LOCALES}"
		_SET_LOCALE="true"
	fi

	if [ -z "${_LOCALE}" ]
	then
		# Set a default one
		_LOCALE="en_US.UTF-8"
		_SET_LOCALE="true"
	fi

	_LANGUAGE="$(echo $locale | cut -d. -f1)"
	export _LANGUAGE

	if [ -z "${_SET_LOCALE}" ]
	then
		# Actually, we should check here if the locale is generated
		return
	fi

	if echo "${_LOCALE}" | grep -sqE '^[[:lower:]]{2}$'
	then
		# input is like "locale=ch", so we will convert and setup also the keyboard if not already set
		if [ -z "${_KEYBOARD}" ]
		then
			_KEYBOARD="${_LOCALE}"
			export _KEYBOARD
		fi

		_LOCALE_UP=$(echo "${_LOCALE}" | tr '[a-z]' '[A-Z]')
		_LOCALE="${_LOCALE}_${_LOCALE_UP}.UTF-8"
	fi

	LANG=
	_LANGUAGE="$(echo ${_LOCALE} | cut -d. -f1)"
	eval $(awk '/^'"${_LOCALE}"'/ { print "LANG=" $1 " codepage=" $2; exit; }' /usr/share/i18n/SUPPORTED)

	if [ -z "${LANG}" ]
	then
		# Try and fallback to another codepage for this language.
		eval $(awk '/^'"${_LANGUAGE}"'/ { print "LANG=" $1 " codepage=" $2; exit; }' /usr/share/i18n/SUPPORTED)

		if [ -n "${LANG}" ]
		then
			echo "Choosing locale '${LANG}' as '${_LOCALE}' is unsupported."
		fi
	fi

	if [ -z "${LANG}" ]
	then
		echo "Locale '${_LOCALE}' is unsupported."
		_CODEPAGE="UTF-8"
		_LANGUAGE="en_US"
		_LOCALE="${_LANGUAGE}.${_CODEPAGE}"
		LANG="${_LANGUAGE}.${_CODEPAGE}"
	fi

	printf 'LANG="%s"\n' "${LANG}" > /etc/default/locale
	if [ -f /etc/locale.gen ]; then
		sed -i -e "s|# ${LANG} ${_CODEPAGE}|${LANG} ${_CODEPAGE}|" /etc/locale.gen
	fi

	locale-gen --keep-existing > /dev/null 2>&1

	# Creating state file
	touch /var/lib/live/config/locales
}

Locales