From fe33d346378040ef59925f898c493f4beef8b0c7 Mon Sep 17 00:00:00 2001 From: Jan Grant Date: Wed, 9 Apr 2014 15:31:57 +0100 Subject: [PATCH] Add switch to turn on caching for debian element. DIB_OFFLINE has wide-ranging effect. This patch adds a tunable that only turns on the tarball-caching behaviour specifically for the debian element. Change-Id: Idd646d7909df6907afc0eeeec1129c3f1a1f92bc --- elements/debian/README.md | 4 ++++ elements/debian/root.d/08-debootstrap | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/elements/debian/README.md b/elements/debian/README.md index eab538569..885387cea 100644 --- a/elements/debian/README.md +++ b/elements/debian/README.md @@ -10,3 +10,7 @@ and pass it in via `DIB_DISTRIBUTION_MIRROR`. Use of this element will also require the tool 'debootstrap' to be available on your system. It should be available on Ubuntu, Debian, and Fedora. + +The `DIB_OFFLINE` or more specific `DIB_DEBIAN_USE_DEBOOTSTRAP_CACHE` +variables can be set to prefer the use of a pre-cached root filesystem +tarball. diff --git a/elements/debian/root.d/08-debootstrap b/elements/debian/root.d/08-debootstrap index d33b3a4fe..13aa84b1b 100755 --- a/elements/debian/root.d/08-debootstrap +++ b/elements/debian/root.d/08-debootstrap @@ -32,7 +32,7 @@ DIB_DISTRIBUTION_MIRROR=${DIB_DISTRIBUTION_MIRROR:-http://http.debian.net/debian http_proxy=${http_proxy:-} set -x -if [ -n "$DIB_OFFLINE" ] && [ -f $DEBOOTSTRAP_TARBALL ] ; then +if [ -n "$DIB_OFFLINE" -o -n "${DIB_DEBIAN_USE_DEBOOTSTRAP_CACHE:-}" ] && [ -f $DEBOOTSTRAP_TARBALL ] ; then echo $DEBOOTSTRAP_TARBALL found in cache. Using. sudo tar -C $TARGET_ROOT --numeric-owner -xzf $DEBOOTSTRAP_TARBALL else