source: /cluster/svnroot/bccd-ng/branches/skylar/bccd-3.4.0-build_ng/bin/prepare_debootstrap @ 6047

Last change on this file since 6047 was 6047, checked in by skylar, 2 years ago

need to point at different debootstrap tar balls depending on NO_BCCD setting re #1008

  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 1.1 KB
Line 
1#!/usr/bin/env bash
2
3# $Id: prepare_debootstrap 6047 2018-07-08 22:24:02Z skylar $
4
5set -eo pipefail
6
7PATH=/bin:/usr/bin:/sbin:/usr/sbin
8
9if [[ -z ${WORKSPACE} ]]; then
10    echo "Must be run w/i Jenkins!" >&2
11    exit 1
12fi
13
14DBS_DIR="${WORKSPACE}/debootstrap"
15DBS_TAR="${WORKSPACE}/target/debootstrap.tar.bz2"
16
17# Support either debootstrap-bccd or debootstrap
18if [[ -z ${NO_BCCD} ]]; then
19    DBS_BCCD_TAR="${WORKSPACE}/target/debootstrap-bccd.tar.bz2"
20else
21    DBS_BCCD_TAR="${DBS_TAR}"
22fi
23
24if [[ ! -d "${DBS_DIR}" ]]; then
25    mkdir -p "${DBS_DIR}"
26fi
27
28if [[ "${WORKSPACE}" =~ debootstrap$ ]]; then
29    sudo debootstrap \
30        --arch amd64 \
31        sid \
32        "${DBS_DIR}" \
33        http://debmirror.cluster.earlham.edu
34elif [[ -r "${DBS_BCCD_TAR}" ]]; then
35    nice pbzip2 -dc "${DBS_BCCD_TAR}" | tar -C "${WORKSPACE}" -xf -
36elif [[ -r "${DBS_TAR}" ]]; then
37    nice pbzip2 -dc "${DBS_TAR}" | tar -C "${WORKSPACE}" -xf -
38else
39    echo "No valid action available!" >&2
40    exit 1
41fi
42
43for dir in proc sys boot/grub; do
44    if [[ ! -d "${DBS_DIR}"/"${dir}" ]]; then
45        /bin/mkdir "${DBS_DIR}"/"${dir}"
46    fi
47done
48mount --bind /proc "${DBS_DIR}"/proc
49mount --bind /sys "${DBS_DIR}"/sys
50
51exit 0
Note: See TracBrowser for help on using the repository browser.