blob: 250f39a8704eaed3cd84e69f8fac71b2c156ea24 (
plain)
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
|
#!/bin/bash
source $(cd $(dirname ${BASH_SOURCE[0]}) ; pwd)/session-common.sh.inc
readonly TIMEOUT=30
readonly H=15
readonly W=42
readonly N_ITEMS=10
readonly LANG_TITLE="System language selection"
readonly LANG_PROMPT="Choose your language:"
readonly LANG_DEFAULT='en_US.UTF-8'
readonly KEYMAP_TITLE="System keymap selection"
readonly KEYMAP_PROMPT="Choose your keymap:"
readonly KEYMAP_DEFAULT='us'
readonly SESSION_TITLE="Launch installer or command-line"
readonly SESSION_PROMPT="Would you like to start the installer, or drop onto the command line?"
readonly -a LANGUAGES=( $(cat "${WIZARD_DIR}"/LANGUAGES) )
readonly -a ESPERANTO_LANG_PACKS=( 'iceweasel-l10n-es-eo' )
readonly -a SPANISH_LANG_PACKS=( 'iceweasel-l10n-es-ar' 'icedove-l10n-es-ar'
'iceweasel-l10n-es-cl'
'iceweasel-l10n-es-es' 'icedove-l10n-es-es'
'iceweasel-l10n-es-mx' )
readonly -a FRENCH_LANG_PACKS=( 'iceweasel-l10n-fr' 'icedove-l10n-fr' )
readonly -a GALEGO_LANG_PACKS=( 'iceweasel-l10n-gl' 'icedove-l10n-gl' )
readonly -a ITALIAN_LANG_PACKS=( 'iceweasel-l10n-it' 'icedove-l10n-it' )
readonly -a POLISH_LANG_PACKS=( 'iceweasel-l10n-pl' 'icedove-l10n-pl' )
readonly -a PORTUGUESE_LANG_PACKS=( 'iceweasel-l10n-pt-br' 'icedove-l10n-pt-br' )
readonly -a KEYMAPS=( $(cat "${WIZARD_DIR}"/KEYMAPS_X) )
readonly -a ALL_SESSIONS=( 'live' "Live desktop" \
'calamares' "GUI installer" \
'wizard' "TUI installer" \
'cli' "Command line" )
case "$DESKTOP_SESSION" in # per .bash_profile
'lxde') readonly SESSIONS=( "${ALL_SESSIONS[@]}" ) ; readonly SESSION_DEFAULT='live' ;;
'mini') readonly SESSIONS=( "${ALL_SESSIONS[@]:2}" ) ; readonly SESSION_DEFAULT='calamares' ;;
* ) readonly SESSIONS=( "${ALL_SESSIONS[@]:4}" ) ; readonly SESSION_DEFAULT='cli' ;;
esac
## prompt for language if not already selected ##
Language=$(GetStateVar 'LANG')
if [[ "${Language}" == '_UNDEFINED_' ]]
then Language=$( InitDlg "$LANG_TITLE" "$LANG_PROMPT" $LANG_DEFAULT "${LANGUAGES[@]}" )
[[ "${Language}" == "" ]] && Language=$LANG_DEFAULT
logger "$0: selected language='${Language}'"
# inject language packs into the install wizard package set
Lang=${Language/_*/}
case ${Lang} in
'eo') echo "${ESPERANTO_LANG_PACKS[@]}" >> "${WIZARD_DIR}"/packages ;;
'fr') echo "${FRENCH_LANG_PACKS[@]}" >> "${WIZARD_DIR}"/packages ;;
'gl') echo "${GALEGO_LANG_PACKS[@]}" >> "${WIZARD_DIR}"/packages ;;
'it') echo "${ITALIAN_LANG_PACKS[@]}" >> "${WIZARD_DIR}"/packages ;;
'pl') echo "${POLISH_LANG_PACKS[@]}" >> "${WIZARD_DIR}"/packages ;;
'pt') echo "${PORTUGUESE_LANG_PACKS[@]}" >> "${WIZARD_DIR}"/packages ;;
'es') echo "${SPANISH_LANG_PACKS[@]}" >> "${WIZARD_DIR}"/packages ;;
esac
# prepare locale
echo "LANG=${Language}" > /etc/locale.conf
SetStateVar 'LANG' ${Language}
# prepare installer translations
TrKey=$( [[ "${TRANSLATIONS}" =~ " ${Lang} " ]] && echo ${Lang} || echo 'en' )
SetStateVar 'TR_KEY' ${TrKey}
fi
## prompt for X11 keymap if not already selected ##
Keymap=$(GetStateVar 'XKBMAP')
if [[ "${Keymap}" == '_UNDEFINED_' ]]
then Keymap=$( InitDlg "$KEYMAP_TITLE" "$KEYMAP_PROMPT" $KEYMAP_DEFAULT "${KEYMAPS[@]}" )
[[ "${Keymap}" == "" ]] && Keymap=$KEYMAP_DEFAULT
logger "$0: selected keymap='${Keymap}'"
# set keymap
setxkbmap ${Keymap} 2> /dev/null
SetStateVar 'XKBMAP' ${Keymap}
fi
## prompt to launch installer or CLI ##
Session=$(GetStateVar 'SESSION')
if [[ "${Session}" == '_UNDEFINED_' ]]
then Session=$( InitDlg "$SESSION_TITLE" "$SESSION_PROMPT" $SESSION_DEFAULT "${SESSIONS[@]}" )
[[ "${Session}" == "" ]] && Session=$SESSION_DEFAULT
logger "$0: selected interface='${Session}'"
# set installer interface
SetStateVar 'SESSION' ${Session}
fi
clear
|