update to 31b795ca71189b326b80666076398f31aea4f2be
[automated-distro-installer] / fai / config / hooks / updatebase.UBUNTU
1 #! /bin/bash
2
3 # use external mirror, remove this script when using a mirror from CD
4
5 cat <<EOM > $target/etc/apt/sources.list
6 # external mirror
7 deb $ubuntumirror/ubuntu $ubuntudist main restricted universe multiverse
8 deb $ubuntumirror/ubuntu $ubuntudist-updates main restricted universe multiverse
9 deb $ubuntumirror/ubuntu $ubuntudist-security main restricted universe multiverse
10 EOM
11
12
13 # https://lists.uni-koeln.de/pipermail/linux-fai/2016-July/011398.html
14 # In Ubuntu 16.04 (but not 14.04), the locales configuration mechanism has
15 # changed. There is a /var/lib/dpkg/info/locales.config file, which
16 # overrides /var/lib/dpkg/info/locales.postinst and consults
17 # /var/lib/locales/supported.d/local instead of the debconf system. (See
18 # the code in /usr/share/debconf/frontend that prefers locales.config.) This
19 # hook applies the debconf setting. It must run after FAI's debconf task
20 # but before dpkg gets a chance to clobber debconf with an empty setting.
21
22 if [ ! -f "$target/var/lib/locales/supported.d/local" ]; then
23 $ROOTCMD debconf --owner=locales sh -c '
24 . /usr/share/debconf/confmodule
25 db_version 2.0
26 db_get locales/locales_to_be_generated &&
27 mkdir -p /var/lib/locales/supported.d &&
28 echo "$RET" > /var/lib/locales/supported.d/local' &&
29 $ROOTCMD dpkg-reconfigure locales
30 fi