X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=fai%2Fconfig%2Fhooks%2Fupdatebase.UBUNTU;h=98f775f077c3d871191b9cb1a2bcae427ab5ff4e;hb=HEAD;hp=226fb752218d91cf8b1553ffef8e679a67f5ef04;hpb=3bd65f0ca635f1349626c2393a4dd8a50df64f54;p=automated-distro-installer diff --git a/fai/config/hooks/updatebase.UBUNTU b/fai/config/hooks/updatebase.UBUNTU index 226fb75..98f775f 100755 --- a/fai/config/hooks/updatebase.UBUNTU +++ b/fai/config/hooks/updatebase.UBUNTU @@ -1,17 +1,28 @@ #! /bin/bash -# use external mirror, remove this script when using a mirror from CD +# mk-basefile doesn't use the -updates suite, then we unpack it, then we +# install sources.list that has -updates and we install random +# packages. It might avoid a problem if we a dist-upgrade first. -dist=trusty +$ROOTCMD apt-get update +$ROOTCMD apt-get -y dist-upgrade --purge --auto-remove -cat < $target/etc/apt/sources.list -# external mirror -deb MIRRORURL $dist main restricted universe multiverse -deb MIRRORURL $dist-updates main restricted universe multiverse -deb MIRRORURL $dist-security main restricted universe multiverse -EOM +# https://lists.uni-koeln.de/pipermail/linux-fai/2016-July/011398.html +# In Ubuntu 16.04 (but not 14.04), the locales configuration mechanism has +# changed. There is a /var/lib/dpkg/info/locales.config file, which +# overrides /var/lib/dpkg/info/locales.postinst and consults +# /var/lib/locales/supported.d/local instead of the debconf system. (See +# the code in /usr/share/debconf/frontend that prefers locales.config.) This +# hook applies the debconf setting. It must run after FAI's debconf task +# but before dpkg gets a chance to clobber debconf with an empty setting. -# determine a fast mirror for Ubuntu -list=$(curl -s http://mirrors.ubuntu.com/mirrors.txt) -mirror=$(netselect $list | awk '{print $2}') -sed -i -e "s#MIRRORURL#$mirror#" $target/etc/apt/sources.list + +if [ ! -f "$target/var/lib/locales/supported.d/local" ]; then + $ROOTCMD debconf --owner=locales sh -c ' + . /usr/share/debconf/confmodule + db_version 2.0 + db_get locales/locales_to_be_generated && + mkdir -p /var/lib/locales/supported.d && + echo "$RET" > /var/lib/locales/supported.d/local' && + $ROOTCMD dpkg-reconfigure locales +fi