diskimage-builder/elements/apt-conf/extra-data.d/99-override-default-apt-conf
Jon-Paul Sullivan 852cec3789 Enable custom apt.conf in apt-conf element
Allow DIB_APT_CONF to be set to the apt.conf file to be inserted
into the built images.

Change-Id: I5d148ae7286a93e81b3e984c94ba4f089d3a3280
2014-02-26 19:10:23 +00:00

17 lines
517 B
Bash
Executable file

#!/bin/bash
# Override the default /etc/apt/apt.conf with $DIB_APT_CONF
set -eu
# exit directly if DIB_APT_CONF is not defined properly
if [ -z "$DIB_APT_CONF" ] ; then
echo "DIB_APT_CONF is not set - no apt.conf will be copied in"
exit 0
elif [ ! -f "$DIB_APT_CONF" ] ; then
echo "$DIB_APT_CONF is not a valid apt.conf file."
echo "You should assign a proper apt.conf file in DIB_APT_CONF"
exit 1
fi
# copy the apt.conf to cloudimg
sudo cp -L -f $DIB_APT_CONF $TMP_MOUNT_PATH/etc/apt/apt.conf