diff --git a/README.md b/README.md index 7318217..d7c90ef 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,9 @@ Set Debian packages server address. Choose a server from the list of Debian worl ##### `APT_PROXY`="" Set Proxy server address. Using a local Proxy-Cache like `apt-cacher-ng` will speed-up the bootstrapping process because all required Debian packages will only be downloaded from the Debian mirror site once. If `apt-cacher-ng` is running on default `http://127.0.0.1:3142` it is autodetected and you don't need to set this. +##### `KEEP_APT_PROXY`=false +Keep the APT_PROXY settings used in the bootsrapping process in the generated image. + ##### `APT_INCLUDES`="" A comma-separated list of additional packages to be installed by debootstrap during bootstrapping. diff --git a/bootstrap.d/11-apt.sh b/bootstrap.d/11-apt.sh index 1a05bf3..33b3cc1 100644 --- a/bootstrap.d/11-apt.sh +++ b/bootstrap.d/11-apt.sh @@ -16,7 +16,7 @@ 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" +sed -i "s/ stretch/ ${RELEASE}/" "${ETC_DIR}/apt/sources.list" # Upgrade package index and update all installed packages and changed dependencies chroot_exec apt-get -qq -y update diff --git a/files/apt/sources.list b/files/apt/sources.list index ffc2c9b..07e52dc 100644 --- a/files/apt/sources.list +++ b/files/apt/sources.list @@ -1,8 +1,8 @@ -deb http://ftp.debian.org/debian jessie main contrib -#deb-src http://ftp.debian.org/debian jessie main contrib +deb http://ftp.debian.org/debian stretch main contrib +#deb-src http://ftp.debian.org/debian stretch main contrib -deb http://ftp.debian.org/debian/ jessie-updates main contrib -#deb-src http://ftp.debian.org/debian/ jessie-updates main contrib +deb http://ftp.debian.org/debian/ stretch-updates main contrib +#deb-src http://ftp.debian.org/debian/ stretch-updates main contrib -deb http://security.debian.org/ jessie/updates main contrib -#deb-src http://security.debian.org/ jessie/updates main contrib +deb http://security.debian.org/ stretch/updates main contrib +#deb-src http://security.debian.org/ stretch/updates main contrib diff --git a/rpi23-gen-image.sh b/rpi23-gen-image.sh index 2ea5bcb..0081612 100755 --- a/rpi23-gen-image.sh +++ b/rpi23-gen-image.sh @@ -119,6 +119,7 @@ NET_NTP_2=${NET_NTP_2:=""} # APT settings APT_PROXY=${APT_PROXY:=""} APT_SERVER=${APT_SERVER:="ftp.debian.org"} +KEEP_APT_PROXY=${KEEP_APT_PROXY:=false} # Feature settings ENABLE_PRINTK=${ENABLE_PRINTK:=false} @@ -675,13 +676,17 @@ umount -l "${R}/sys" rm -rf "${R}/run/*" rm -rf "${R}/tmp/*" +# Clean up APT proxy settings +if [ "$KEEP_APT_PROXY" = false ] ; then + rm -f "${ETC_DIR}/apt/apt.conf.d/10proxy" +fi + # Clean up files rm -f "${ETC_DIR}/ssh/ssh_host_*" rm -f "${ETC_DIR}/dropbear/dropbear_*" rm -f "${ETC_DIR}/apt/sources.list.save" rm -f "${ETC_DIR}/resolvconf/resolv.conf.d/original" rm -f "${ETC_DIR}/*-" -rm -f "${ETC_DIR}/apt/apt.conf.d/10proxy" rm -f "${ETC_DIR}/resolv.conf" rm -f "${R}/root/.bash_history" rm -f "${R}/var/lib/urandom/random-seed"