|
|
#!/bin/bash
|
|
|
#
|
|
|
# Setup APT repositories
|
|
|
#
|
|
|
|
|
|
# Load utility functions
|
|
|
. ./functions.sh
|
|
|
|
|
|
# Install and setup APT proxy configuration
|
|
|
if [ -z "$APT_PROXY" ] ; then
|
|
|
install_readonly files/apt/10proxy "${ETC_DIR}/apt/apt.conf.d/10proxy"
|
|
|
sed -i "s/\"\"/\"${APT_PROXY}\"/" "${ETC_DIR}/apt/apt.conf.d/10proxy"
|
|
|
fi
|
|
|
|
|
|
if [ "$BUILD_KERNEL" = false ] ; then
|
|
|
echo "Downloading precompiled kernel"
|
|
|
echo "error: not configured"
|
|
|
exit 1;
|
|
|
# BUILD_KERNEL=true
|
|
|
else
|
|
|
echo "No precompiled kernel repositories were added"
|
|
|
fi
|
|
|
|
|
|
#autconfigure best apt server to not spam ftp.debian.org
|
|
|
#rm files/apt/sources.list
|
|
|
#netselect-apt does not know buster yet
|
|
|
if [ "$RELEASE" = "buster" ] ; then
|
|
|
RELEASE=${RELEASE:=testing}
|
|
|
fi
|
|
|
|
|
|
if [ "$ENABLE_NONFREE" = true ] ; then
|
|
|
netselect-apt --arch "$RELEASE_ARCH" --tests 10 --sources --nonfree --outfile "${ETC_DIR}/apt/sources.list" -d "$RELEASE"
|
|
|
else
|
|
|
netselect-apt --arch "$RELEASE_ARCH" --tests 10 --sources --outfile "${ETC_DIR}/apt/sources.list" -d "$RELEASE"
|
|
|
fi
|
|
|
|
|
|
#ipinfo=$(curl ipinfo.io | grep country )
|
|
|
#grep -o '\"[^"]*\"' $ipinfo | tr -d '"'
|
|
|
#grep -Po '"country":.*?[^\\]",' $(curl ipinfo.io | grep country )
|
|
|
#sed -i "s,http:,https:,g" "${ETC_DIR}/apt/sources.list"
|
|
|
|
|
|
# Upgrade package index and update all installed packages and changed dependencies
|
|
|
chroot_exec apt-get -qq -y update
|
|
|
chroot_exec apt-get -qq -y -u dist-upgrade
|
|
|
|
|
|
if [ "$APT_INCLUDES_LATE" ] ; then
|
|
|
chroot_exec apt-get -qq -y install "$(echo "$APT_INCLUDES_LATE" |tr , ' ')"
|
|
|
fi
|
|
|
|
|
|
if [ -d packages ] ; then
|
|
|
for package in packages/*.deb ; do
|
|
|
cp "$package" "${R}"/tmp
|
|
|
chroot_exec dpkg --unpack /tmp/"$(basename "$package")"
|
|
|
done
|
|
|
fi
|
|
|
chroot_exec apt-get -qq -y -f install
|
|
|
|
|
|
chroot_exec apt-get -qq -y check
|