Ubuntu Pastebin

Paste from shadeslayer at Wed, 4 Feb 2015 16:51:35 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/sh

set -e

. "$SETUP_DATA_DIR/common-data"
. "$SETUP_DATA_DIR/common-functions"
. "$SETUP_DATA_DIR/common-config"

if [ -n "${CHROOT_UNION_TYPE}" ] && [ "${CHROOT_UNION_TYPE}" != 'none' ]; then

    if [ "$JENKINS_WORKSPACE" = "" ]; then
        fatal "No JENKINS_WORKSPACE defined!"
    fi
    if [ "$STAGE" = "setup-start" ]; then
        echo "Mounting $JENKINS_WORKSPACE inside the chroot"
        mkdir -p "$CHROOT_MOUNT_LOCATION/tmp/jenkins"
        mkdir -p "$CHROOT_MOUNT_LOCATION/$JENKINS_WORKSPACE"
        mount -t overlayfs -o lowerdir="$JENKINS_WORKSPACE",upperdir="$CHROOT_MOUNT_LOCATION/tmp/jenkins" overlayfs "$CHROOT_MOUNT_LOCATION/$JENKINS_WORKSPACE"
        echo "Overlay ready"
    elif [ "$STAGE" = "setup-stop" ]; then
        umount "$CHROOT_MOUNT_LOCATION/$JENKINS_WORKSPACE"
        rm -rf "$CHROOT_MOUNT_LOCATION/tmp/jenkins"
        echo "Teardown of $JENKINS_WORKSPACE overlayfs complete"
    fi
fi
Download as text