Merge branch 'upstream'
[automated-distro-installer] / fai / config / hooks / updatebase.UBUNTU
1 #! /bin/bash
2
3 # https://lists.uni-koeln.de/pipermail/linux-fai/2016-July/011398.html
4 # In Ubuntu 16.04 (but not 14.04), the locales configuration mechanism has
5 # changed. There is a /var/lib/dpkg/info/locales.config file, which
6 # overrides /var/lib/dpkg/info/locales.postinst and consults
7 # /var/lib/locales/supported.d/local instead of the debconf system. (See
8 # the code in /usr/share/debconf/frontend that prefers locales.config.) This
9 # hook applies the debconf setting. It must run after FAI's debconf task
10 # but before dpkg gets a chance to clobber debconf with an empty setting.
11
12 if [ ! -f "$target/var/lib/locales/supported.d/local" ]; then
13 $ROOTCMD debconf --owner=locales sh -c '
14 . /usr/share/debconf/confmodule
15 db_version 2.0
16 db_get locales/locales_to_be_generated &&
17 mkdir -p /var/lib/locales/supported.d &&
18 echo "$RET" > /var/lib/locales/supported.d/local' &&
19 $ROOTCMD dpkg-reconfigure locales
20 fi