From 5ae5aba2ff0fac539b687fdc249ccb8b9b87d859 2018-11-11 02:21:33 From: Unknown Date: 2018-11-11 02:21:33 Subject: [PATCH] using netselect-apt to autoconfigure apt source better not spam the same apt server again and again --- diff --git a/bootstrap.d/11-apt.sh b/bootstrap.d/11-apt.sh index f413f58..a3b847f 100644 --- a/bootstrap.d/11-apt.sh +++ b/bootstrap.d/11-apt.sh @@ -30,12 +30,13 @@ if [ "$BUILD_KERNEL" = false ] ; then fi else # BUILD_KERNEL=true - # Install APT sources.list - install_readonly files/apt/sources.list "${ETC_DIR}/apt/sources.list" - - # Use specified APT server and release - sed -i "s/\/ftp.debian.org\//\/${APT_SERVER}\//" "${ETC_DIR}/apt/sources.list" - sed -i "s/ jessie/ ${RELEASE}/" "${ETC_DIR}/apt/sources.list" + #autconfigure best apt server to not spam ftp.debian.org + rm files/apt/sources.list + if [ "$ENABLE_NONFREE" ] ; then + netselect-apt --arch "$RELEASE_ARCH" --sources --nonfree --outfile "${ETC_DIR}/apt/sources.list" -d "$RELEASE" + else + netselect-apt --arch "$RELEASE_ARCH" --sources --nonfree --outfile "${ETC_DIR}/apt/sources.list" -d "$RELEASE" + fi fi # Allow the installation of non-free Debian packages diff --git a/rpi23-gen-image.sh b/rpi23-gen-image.sh index 2931ab8..db4db2a 100755 --- a/rpi23-gen-image.sh +++ b/rpi23-gen-image.sh @@ -196,6 +196,9 @@ APT_INCLUDES="${APT_INCLUDES},apt-transport-https,apt-utils,ca-certificates,debi REQUIRED_PACKAGES="debootstrap debian-archive-keyring qemu-user-static binfmt-support dosfstools rsync bmap-tools whois git bc psmisc dbus sudo" MISSING_PACKAGES="" +#autoselect best apt mirror +REQUIRED_PACKAGES="${REQUIRED_PACKAGES} netselect-apt" + # Packages installed for c/c++ build environment in chroot (keep empty) COMPILER_PACKAGES=""