##// END OF EJS Templates
Merge pull request #193 from JensKapitza/patch-1...
drtyhlpr -
r619:0938b973b76a Fusion
parent child
Show More
@@ -1,66 +1,66
1 1 #
2 2 # Setup Locales and keyboard settings
3 3 #
4 4
5 5 # Load utility functions
6 6 . ./functions.sh
7 7
8 8 # Install and setup timezone
9 9 echo "${TIMEZONE}" > "${ETC_DIR}/timezone"
10 10 if [ -f "${ETC_DIR}/localtime" ]; then
11 11 # 1. If 11-apt.sh upgrades the package 'tzdata', '/etc/localtime' was created
12 12 # because 'dpkg-reconfigure -f noninteractive tzdata' was executed by apt-get.
13 13 # 2. If '/etc/localtime' exists, our execution of 'dpkg-reconfigure -f noninteractive tzdata'
14 14 # will ignore the our timezone set in '/etc/timezone'.
15 15 # 3. Removing /etc/localtime will solve this.
16 16 rm -f "${ETC_DIR}/localtime"
17 17 fi
18 18 chroot_exec dpkg-reconfigure -f noninteractive tzdata
19 19
20 20 # Install and setup default locale and keyboard configuration
21 21 if [ "$(echo "$APT_INCLUDES" | grep ",locales")" ] ; then
22 22 # Set locale choice in debconf db, even though dpkg-reconfigure ignores and overwrites them due to some bug
23 23 # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=684134 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=685957
24 24 # ... so we have to set locales manually
25 25 if [ "$DEFLOCAL" = "en_US.UTF-8" ] ; then
26 chroot_exec echo "locales locales/locales_to_be_generated multiselect ${DEFLOCAL} UTF-8" | debconf-set-selections
26 chroot_exec echo "locales locales/locales_to_be_generated multiselect ${DEFLOCAL} UTF-8 | debconf-set-selections"
27 27 else
28 28 # en_US.UTF-8 should be available anyway : https://www.debian.org/doc/manuals/debian-reference/ch08.en.html#_the_reconfiguration_of_the_locale
29 chroot_exec echo "locales locales/locales_to_be_generated multiselect en_US.UTF-8 UTF-8, ${DEFLOCAL} UTF-8" | debconf-set-selections
29 chroot_exec echo "locales locales/locales_to_be_generated multiselect en_US.UTF-8 UTF-8, ${DEFLOCAL} UTF-8 | debconf-set-selections"
30 30 sed -i "/en_US.UTF-8/s/^#//" "${ETC_DIR}/locale.gen"
31 31 fi
32 32
33 33 sed -i "/${DEFLOCAL}/s/^#//" "${ETC_DIR}/locale.gen"
34 chroot_exec echo "locales locales/default_environment_locale select ${DEFLOCAL}" | debconf-set-selections
34 chroot_exec echo "locales locales/default_environment_locale select ${DEFLOCAL} | debconf-set-selections"
35 35 chroot_exec locale-gen
36 36 chroot_exec update-locale LANG="${DEFLOCAL}"
37 37
38 38 # Install and setup default keyboard configuration
39 39 if [ "$XKB_MODEL" != "" ] ; then
40 40 sed -i "s/^XKBMODEL.*/XKBMODEL=\"${XKB_MODEL}\"/" "${ETC_DIR}/default/keyboard"
41 41 fi
42 42 if [ "$XKB_LAYOUT" != "" ] ; then
43 43 sed -i "s/^XKBLAYOUT.*/XKBLAYOUT=\"${XKB_LAYOUT}\"/" "${ETC_DIR}/default/keyboard"
44 44 fi
45 45 if [ "$XKB_VARIANT" != "" ] ; then
46 46 sed -i "s/^XKBVARIANT.*/XKBVARIANT=\"${XKB_VARIANT}\"/" "${ETC_DIR}/default/keyboard"
47 47 fi
48 48 if [ "$XKB_OPTIONS" != "" ] ; then
49 49 sed -i "s/^XKBOPTIONS.*/XKBOPTIONS=\"${XKB_OPTIONS}\"/" "${ETC_DIR}/default/keyboard"
50 50 fi
51 51 chroot_exec dpkg-reconfigure -f noninteractive keyboard-configuration
52 52
53 53 # Install and setup font console
54 54 case "${DEFLOCAL}" in
55 55 *UTF-8)
56 56 sed -i 's/^CHARMAP.*/CHARMAP="UTF-8"/' "${ETC_DIR}/default/console-setup"
57 57 ;;
58 58 *)
59 59 sed -i 's/^CHARMAP.*/CHARMAP="guess"/' "${ETC_DIR}/default/console-setup"
60 60 ;;
61 61 esac
62 62 chroot_exec dpkg-reconfigure -f noninteractive console-setup
63 63 else # (no locales were installed)
64 64 # Install POSIX default locale
65 65 install_readonly files/locales/locale "${ETC_DIR}/default/locale"
66 66 fi
General Comments 0
Vous devez vous connecter pour laisser un commentaire. Se connecter maintenant