From f7f6cb45ee3c400748f42d20fb73ebd8468060b5 Mon Sep 17 00:00:00 2001
From: Robert Collins <rbtcollins@hp.com>
Date: Thu, 18 Jul 2013 10:04:26 +1200
Subject: [PATCH] Fix the DIB_OFFLINE setting to actually work.

I missed the getopt parameter and forgot defaults are imported after
option processing. Untested code is broken code!

Change-Id: I133a691909d38e834c204950276a57f4884fc4ed
---
 bin/disk-image-create | 2 +-
 lib/common-defaults   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/bin/disk-image-create b/bin/disk-image-create
index 9e0dd3784..efbcf853a 100755
--- a/bin/disk-image-create
+++ b/bin/disk-image-create
@@ -55,7 +55,7 @@ function show_options () {
 
 INSTALL_PACKAGES=""
 COMPRESS_IMAGE="true"
-TEMP=`getopt -o a:ho:xucnp: -l no-tmpfs -n $SCRIPTNAME -- "$@"`
+TEMP=`getopt -o a:ho:xucnp: -l no-tmpfs,offline -n $SCRIPTNAME -- "$@"`
 if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi
 
 # Note the quotes around `$TEMP': they are essential!
diff --git a/lib/common-defaults b/lib/common-defaults
index 23aa0acc0..ff06fe781 100644
--- a/lib/common-defaults
+++ b/lib/common-defaults
@@ -39,4 +39,4 @@ export DIB_NO_TMPFS=${DIB_NO_TMPFS:-0}
 _BASE_ELEMENT_DIR=$(dirname $0)/../elements
 ELEMENTS_PATH=${ELEMENTS_PATH:+"$ELEMENTS_PATH:$_BASE_ELEMENT_DIR"}
 export ELEMENTS_PATH=${ELEMENTS_PATH:-$_BASE_ELEMENT_DIR}
-export DIB_OFFLINE=''
+export DIB_OFFLINE=${DIB_OFFLINE:-''}