##// END OF EJS Templates
code cleanup and even more spliting
code cleanup and even more spliting

Fichier de la dernière révision:

r70:94ac6dc790aa
r70:94ac6dc790aa
Show More
12-locale.sh
58 lines | 2.3 KiB | application/x-sh | BashLexer
Filip Pytloun
Refactor: split bootstrap actions and allow custom
r56 #
Jan Wagner
spliting more files, fix-uboot, fix-fbturbo, fix-locale
r67 # Setup Locales and keyboard settings
Filip Pytloun
Refactor: split bootstrap actions and allow custom
r56 #
Jan Wagner
spliting more files, fix-uboot, fix-fbturbo, fix-locale
r67 # Load utility functions
Filip Pytloun
Refactor: split bootstrap actions and allow custom
r56 . ./functions.sh
# Set up timezone
echo ${TIMEZONE} >$R/etc/timezone
chroot_exec dpkg-reconfigure -f noninteractive tzdata
# Set up default locale and keyboard configuration
if [ "$ENABLE_MINBASE" = false ] ; then
# Set locale choice in debconf db, even though dpkg-reconfigure ignores and overwrites them due to some bug
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=684134 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=685957
# ... so we have to set locales manually
if [ "$DEFLOCAL" = "en_US.UTF-8" ] ; then
chroot_exec echo "locales locales/locales_to_be_generated multiselect ${DEFLOCAL} UTF-8" | debconf-set-selections
else
# en_US.UTF-8 should be available anyway : https://www.debian.org/doc/manuals/debian-reference/ch08.en.html#_the_reconfiguration_of_the_locale
chroot_exec echo "locales locales/locales_to_be_generated multiselect en_US.UTF-8 UTF-8, ${DEFLOCAL} UTF-8" | debconf-set-selections
Jan Wagner
code cleanup and even more spliting
r70 sed -i "/en_US.UTF-8/s/^#//" $R/etc/locale.gen
Filip Pytloun
Refactor: split bootstrap actions and allow custom
r56 fi
Jan Wagner
spliting more files, fix-uboot, fix-fbturbo, fix-locale
r67
Jan Wagner
code cleanup and even more spliting
r70 sed -i "/${DEFLOCAL}/s/^#//" $R/etc/locale.gen
Filip Pytloun
Refactor: split bootstrap actions and allow custom
r56 chroot_exec echo "locales locales/default_environment_locale select ${DEFLOCAL}" | debconf-set-selections
chroot_exec locale-gen
chroot_exec update-locale LANG=${DEFLOCAL}
# Keyboard configuration, if requested
Jan Wagner
spliting more files, fix-uboot, fix-fbturbo, fix-locale
r67 if [ "$XKB_MODEL" != "" ] ; then
Jan Wagner
code cleanup and even more spliting
r70 sed -i "s/^XKBMODEL.*/XKBMODEL=\"${XKB_MODEL}\"/" $R/etc/default/keyboard
Filip Pytloun
Refactor: split bootstrap actions and allow custom
r56 fi
Jan Wagner
spliting more files, fix-uboot, fix-fbturbo, fix-locale
r67 if [ "$XKB_LAYOUT" != "" ] ; then
Jan Wagner
code cleanup and even more spliting
r70 sed -i "s/^XKBLAYOUT.*/XKBLAYOUT=\"${XKB_LAYOUT}\"/" $R/etc/default/keyboard
Filip Pytloun
Refactor: split bootstrap actions and allow custom
r56 fi
Jan Wagner
spliting more files, fix-uboot, fix-fbturbo, fix-locale
r67 if [ "$XKB_VARIANT" != "" ] ; then
Jan Wagner
code cleanup and even more spliting
r70 sed -i "s/^XKBVARIANT.*/XKBVARIANT=\"${XKB_VARIANT}\"/" $R/etc/default/keyboard
Filip Pytloun
Refactor: split bootstrap actions and allow custom
r56 fi
Jan Wagner
spliting more files, fix-uboot, fix-fbturbo, fix-locale
r67 if [ "$XKB_OPTIONS" != "" ] ; then
Jan Wagner
code cleanup and even more spliting
r70 sed -i "s/^XKBOPTIONS.*/XKBOPTIONS=\"${XKB_OPTIONS}\"/" $R/etc/default/keyboard
Filip Pytloun
Refactor: split bootstrap actions and allow custom
r56 fi
chroot_exec dpkg-reconfigure -f noninteractive keyboard-configuration
Jan Wagner
spliting more files, fix-uboot, fix-fbturbo, fix-locale
r67
Filip Pytloun
Refactor: split bootstrap actions and allow custom
r56 # Set up font console
case "${DEFLOCAL}" in
*UTF-8)
Jan Wagner
code cleanup and even more spliting
r70 sed -i 's/^CHARMAP.*/CHARMAP="UTF-8"/' $R/etc/default/console-setup
Filip Pytloun
Refactor: split bootstrap actions and allow custom
r56 ;;
*)
Jan Wagner
code cleanup and even more spliting
r70 sed -i 's/^CHARMAP.*/CHARMAP="guess"/' $R/etc/default/console-setup
Filip Pytloun
Refactor: split bootstrap actions and allow custom
r56 ;;
esac
chroot_exec dpkg-reconfigure -f noninteractive console-setup
Jan Wagner
code cleanup and even more spliting
r70 else # ENABLE_MINBASE=true
Jan Wagner
spliting more files, fix-uboot, fix-fbturbo, fix-locale
r67 # Set POSIX default locales
install_readonly files/locales/locale $R/etc/default/locale
Filip Pytloun
Refactor: split bootstrap actions and allow custom
r56 fi