[ISO] Lots of locales generated (UEFI)
Created by: aadityabagga
Hi,
Today I built an ISO with manjaro-tools, version 0.9.7.1, and ran it on my actual pc. What I noticed that lots of locale's were being generated while running the livecd script when booting up; I pressed Ctrl^C lots of times and after a while it stopped.
In the booted system, I looked at /etc/locale.gen
, and indeed lots of lines were commented out:
$ cat /etc/locale.gen
# Configuration file for locale-gen
#
# lists of locales that are to be generated by the locale-gen command.
#
# Each line is of the form:
#
# <locale> <charset>
#
# where <locale> is one of the locales given in /usr/share/i18n/locales
# and <charset> is one of the character sets listed in /usr/share/i18n/charmaps
#
# Examples:
# en_US ISO-8859-1
en_US.UTF-8 UTF-8
# de_DE ISO-8859-1
# de_DE@euro ISO-8859-15
#
# The locale-gen command will generate all the locales,
# placing them in /usr/lib/locale.
#
# A list of supported locales is included in this file.
# Uncomment the ones you need.
#
aa_DJ.UTF-8 UTF-8
#aa_DJ ISO-8859-1
aa_ER UTF-8
aa_ER@saaho UTF-8
aa_ET UTF-8
af_ZA.UTF-8 UTF-8
#af_ZA ISO-8859-1
ak_GH UTF-8
am_ET UTF-8
an_ES.UTF-8 UTF-8
#an_ES ISO-8859-15
anp_IN UTF-8
ar_AE.UTF-8 UTF-8
#ar_AE ISO-8859-6
ar_BH.UTF-8 UTF-8
#ar_BH ISO-8859-6
ar_DZ.UTF-8 UTF-8
#ar_DZ ISO-8859-6
ar_EG.UTF-8 UTF-8
#ar_EG ISO-8859-6
ar_IN UTF-8
ar_IQ.UTF-8 UTF-8
#ar_IQ ISO-8859-6
ar_JO.UTF-8 UTF-8
#ar_JO ISO-8859-6
ar_KW.UTF-8 UTF-8
#ar_KW ISO-8859-6
ar_LB.UTF-8 UTF-8
#ar_LB ISO-8859-6
ar_LY.UTF-8 UTF-8
#ar_LY ISO-8859-6
ar_MA.UTF-8 UTF-8
#ar_MA ISO-8859-6
ar_OM.UTF-8 UTF-8
#ar_OM ISO-8859-6
ar_QA.UTF-8 UTF-8
#ar_QA ISO-8859-6
ar_SA.UTF-8 UTF-8
#ar_SA ISO-8859-6
ar_SD.UTF-8 UTF-8
#ar_SD ISO-8859-6
ar_SS UTF-8
ar_SY.UTF-8 UTF-8
#ar_SY ISO-8859-6
ar_TN.UTF-8 UTF-8
#ar_TN ISO-8859-6
ar_YE.UTF-8 UTF-8
#ar_YE ISO-8859-6
ayc_PE UTF-8
az_AZ UTF-8
as_IN UTF-8
ast_ES.UTF-8 UTF-8
#ast_ES ISO-8859-15
be_BY.UTF-8 UTF-8
#be_BY CP1251
be_BY@latin UTF-8
bem_ZM UTF-8
ber_DZ UTF-8
ber_MA UTF-8
bg_BG.UTF-8 UTF-8
#bg_BG CP1251
bh_IN.UTF-8 UTF-8
bho_IN UTF-8
bn_BD UTF-8
bn_IN UTF-8
bo_CN UTF-8
bo_IN UTF-8
br_FR.UTF-8 UTF-8
#br_FR ISO-8859-1
#br_FR@euro ISO-8859-15
brx_IN UTF-8
bs_BA.UTF-8 UTF-8
#bs_BA ISO-8859-2
byn_ER UTF-8
....
....
Then I looked at /opt/livecd/util-livecd.sh
, and found the following code:
configure_language(){
# hack to be able to set the locale on bootup
local LOCALE=$(get_country)
local KEYMAP=$(get_keyboard)
local KBLAYOUT=$(get_layout)
# local FALLBACK="en_US"
local TLANG=${LOCALE%.*}
# this is needed for efi, it doesn't set any cmdline
[[ -z "$LOCALE" ]] && LOCALE="en_US"
[[ -z "$KEYMAP" ]] && KEYMAP="us"
[[ -z "$KBLAYOUT" ]] && KBLAYOUT="us"
sed -i -r "s/#(${TLANG}.*UTF-8)/\1/g" $1/etc/locale.gen
# sed -i -r "s/#(${FALLBACK}.*UTF-8)/\1/g" $1/etc/locale.gen
echo "LANG=${LOCALE}.UTF-8" >> $1/etc/environment
if [[ -f $1/usr/bin/openrc ]]; then
sed -i "s/keymap=.*/keymap=\"${KEYMAP}\"/" $1/etc/conf.d/keymaps
fi
echo "KEYMAP=${KEYMAP}" > $1/etc/vconsole.conf
echo "LANG=${LOCALE}.UTF-8" > $1/etc/locale.conf
write_x11_config $1
# echo "LANGUAGE=${LOCALE}:${FALLBACK}" >> $1/etc/locale.conf
loadkeys "${KEYMAP}"
}
Maybe the sed
used above is incorrect in some way...
Another idea may be to change the setting of variables are they have been initialized, ie, from:
local LOCALE=$(get_country)
local KEYMAP=$(get_keyboard)
local KBLAYOUT=$(get_layout)
# local FALLBACK="en_US"
local TLANG=${LOCALE%.*}
# this is needed for efi, it doesn't set any cmdline
[[ -z "$LOCALE" ]] && LOCALE="en_US"
[[ -z "$KEYMAP" ]] && KEYMAP="us"
[[ -z "$KBLAYOUT" ]] && KBLAYOUT="us"
to
local LOCALE=$(get_country)
local KEYMAP=$(get_keyboard)
local KBLAYOUT=$(get_layout)
# this is needed for efi, it doesn't set any cmdline
[[ -z "$LOCALE" ]] && LOCALE="en_US"
[[ -z "$KEYMAP" ]] && KEYMAP="us"
[[ -z "$KBLAYOUT" ]] && KBLAYOUT="us"
# local FALLBACK="en_US"
local TLANG=${LOCALE%.*}
My system is running in Hybrid UEFI mode, so that may have something to do with it. I did not have this bug with the 0.8.12 release which was made with manjaroiso.