From 98642b8581b9aaa697deb7a19c54576a61bcefcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Igor=20Pe=C4=8Dovnik?= Date: Tue, 22 Dec 2020 14:41:51 +0100 Subject: [PATCH] Set image compression levels to maximum (#2491) * Set image compression levels to maximum This feature is used mainly by us or other distributors. An internal function. Compression time and CPU usage for this process is significantly increased but the size of the daily batch was decreased from 80Gb -> 50Gb. Mitigate upload speed bottleneck. * Small improvement for internal build process * Typo --- lib/build-all-ng.sh | 2 +- lib/debootstrap.sh | 2 +- lib/image-helpers.sh | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/build-all-ng.sh b/lib/build-all-ng.sh index 84b0401a09..ad38870364 100644 --- a/lib/build-all-ng.sh +++ b/lib/build-all-ng.sh @@ -92,7 +92,7 @@ pack_upload () if [[ $COMPRESS_OUTPUTIMAGE == *xz* ]]; then display_alert "Compressing" "$DEST/images/${version}.img.xz" "info" - pixz -3 < "$DESTIMG/${version}.img" > "${DESTIMG}/${version}.img.xz" + pixz -9 < "$DESTIMG/${version}.img" > "${DESTIMG}/${version}.img.xz" rm "${DESTIMG}/${version}.img" compression_type=".xz" fi diff --git a/lib/debootstrap.sh b/lib/debootstrap.sh index 7c56ce5022..a9af5d609d 100644 --- a/lib/debootstrap.sh +++ b/lib/debootstrap.sh @@ -665,7 +665,7 @@ create_image() if [[ $COMPRESS_OUTPUTIMAGE == *xz* ]]; then display_alert "Compressing" "$DEST/images/${version}.img.xz" "info" - pixz -3 < $DESTIMG/${version}.img > $DEST/images/${version}.img.xz + pixz -9 < $DESTIMG/${version}.img > $DEST/images/${version}.img.xz compression_type=".xz" fi diff --git a/lib/image-helpers.sh b/lib/image-helpers.sh index a2ecea5f1d..40ba4c567a 100644 --- a/lib/image-helpers.sh +++ b/lib/image-helpers.sh @@ -143,7 +143,9 @@ install_deb_chroot() display_alert "Installing${desc}" "${name/\/root\//}" [[ $NO_APT_CACHER != yes ]] && local apt_extra="-o Acquire::http::Proxy=\"http://${APT_PROXY_ADDR:-localhost:3142}\" -o Acquire::http::Proxy::localhost=\"DIRECT\"" - LC_ALL=C LANG=C chroot "${SDCARD}" /bin/bash -c "DEBIAN_FRONTEND=noninteractive apt-get -yqq \ + # when building in bulk from remote, lets make sure we have up2date index + [[ $BUILD_ALL == yes && ${variant} == remote ]] && chroot "${SDCARD}" /bin/bash -c "DEBIAN_FRONTEND=noninteractive apt-get $apt_extra -yqq update" + chroot "${SDCARD}" /bin/bash -c "DEBIAN_FRONTEND=noninteractive apt-get -yqq \ $apt_extra --no-install-recommends install $name" >> "${DEST}"/debug/install.log 2>&1 [[ ${variant} == remote && ${transfer} == yes ]] && rsync -rq "${SDCARD}"/var/cache/apt/archives/*.deb ${DEB_STORAGE}/ }