From 57996542724bfedf000412d9ec835022d02c254f Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Fri, 31 Jan 2014 18:59:40 -0800 Subject: [PATCH] build.sh: Only extract busybox before building the portage image There's no need to extract it again every time we run this script. --- build.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/build.sh b/build.sh index 78eb33b..402a336 100755 --- a/build.sh +++ b/build.sh @@ -157,12 +157,17 @@ import_portage() } # extract Busybox for the portage image +# +# Arguments: +# +# 1: SUBDIR target subdirectory for the busybox binary extract_busybox() { - msg "extract Busybox for the portage image" + SUBDIR="${1}" + msg "extract Busybox binary to ${SUBDIR}" THIS_DIR=$(dirname $($REALPATH $0)) CONTAINER="${NAMESPACE}-gentoo-${DATE}-extract-busybox" - "${DOCKER}" run -name "${CONTAINER}" -v "${THIS_DIR}/portage/":/tmp "${NAMESPACE}/gentoo:${DATE}" cp /bin/busybox /tmp/ + "${DOCKER}" run -name "${CONTAINER}" -v "${THIS_DIR}/${SUBDIR}/":/tmp "${NAMESPACE}/gentoo:${DATE}" cp /bin/busybox /tmp/ "${DOCKER}" rm "${CONTAINER}" } @@ -181,6 +186,10 @@ build_repo() REPO="${1}" msg "build repo ${REPO}" if ! repo_exists "${REPO}"; then + if [ "${REPO}" = portage ]; then + extract_busybox "${REPO}" + fi + env -i \ NAMESPACE="${NAMESPACE}" \ TAG="${DATE}" \ @@ -203,7 +212,6 @@ build() { import_stage3 import_portage - extract_busybox for REPO in ${REPOS}; do build_repo "${REPO}" -- 2.26.2