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

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

need to make boot/grub re #1003, #1005

  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 1.0 KB
Line 
1#!/usr/bin/env bash
2
3# $Id: prepare_debootstrap 6032 2018-06-11 20:14:07Z 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_BCCD_TAR="${WORKSPACE}/target/debootstrap-bccd.tar.bz2"
16DBS_TAR="${WORKSPACE}/target/debootstrap.tar.bz2"
17
18if [[ ! -d "${DBS_DIR}" ]]; then
19    mkdir -p "${DBS_DIR}"
20fi
21
22if [[ "${WORKSPACE}" =~ debootstrap$ ]]; then
23    sudo debootstrap \
24        --arch amd64 \
25        sid \
26        "${DBS_DIR}" \
27        http://debmirror.cluster.earlham.edu
28elif [[ -r "${DBS_BCCD_TAR}" ]]; then
29    nice pbzip2 -dc "${DBS_BCCD_TAR}" | tar -C "${WORKSPACE}" -xf -
30elif [[ -r "${DBS_TAR}" ]]; then
31    nice pbzip2 -dc "${DBS_TAR}" | tar -C "${WORKSPACE}" -xf -
32else
33    echo "No valid action available!" >&2
34    exit 1
35fi
36
37for dir in proc sys boot/grub; do
38    if [[ ! -d "${DBS_DIR}"/"${dir}" ]]; then
39        /bin/mkdir "${DBS_DIR}"/"${dir}"
40    fi
41done
42mount --bind /proc "${DBS_DIR}"/proc
43mount --bind /sys "${DBS_DIR}"/sys
44
45exit 0
Note: See TracBrowser for help on using the repository browser.