Don't cache debootstrap rootfs by default

By default we create a tarball of any debootstrap rootfs we create. For
the majority of use cases this is a large performance hit for no
benefit. Lets make this an opt-in feature.

Change-Id: I58fc485aacacaa17243bf9ce760ed91256d1f182
This commit is contained in:
Gregory Haynes 2016-02-16 07:55:19 +00:00
parent 6f6a096d94
commit 2678209e94
2 changed files with 8 additions and 1 deletions

View File

@ -25,6 +25,11 @@ pass extra arguments to the debootstrap command used to create the
base filesystem image. If --keyring is is used in `DIB_DEBOOTSTRAP_EXTRA_ARGS`, base filesystem image. If --keyring is is used in `DIB_DEBOOTSTRAP_EXTRA_ARGS`,
it will override `DIB_APT_KEYRING` if that is used as well. it will override `DIB_APT_KEYRING` if that is used as well.
The `DIB_DEBOOTSTRAP_CACHE` variable can be used to cache the created root
filesystem. By default this is 0 (disabled) and any other value enables this.
If run in offline mode then the most recently cached rootfs is used instead of
being built.
------------------- -------------------
Note on ARM systems Note on ARM systems
------------------- -------------------

View File

@ -72,7 +72,9 @@ else
${DIB_DEBIAN_DEBOOTSTRAP_SCRIPT:-}" ${DIB_DEBIAN_DEBOOTSTRAP_SCRIPT:-}"
echo Caching debootstrap result in $DEBOOTSTRAP_TARBALL echo Caching debootstrap result in $DEBOOTSTRAP_TARBALL
sudo tar --numeric-owner -C $TARGET_ROOT -zcf $DEBOOTSTRAP_TARBALL --exclude='./tmp/*' . if [ "${DIB_DEBOOTSTRAP_CACHE:-0}" != "0" ]; then
sudo tar --numeric-owner -C $TARGET_ROOT -zcf $DEBOOTSTRAP_TARBALL --exclude='./tmp/*' .
fi
fi fi
sudo rm -f ${TARGET_ROOT}/.extra_settings sudo rm -f ${TARGET_ROOT}/.extra_settings