Lines Matching +full:build +full:- +full:system +full:- +full:ubuntu
1 #!/bin/bash -xe
4 # This script is for starting QEMU against the input build and running the
11 # imported from. Generally, this is the build directory
12 # that is generated by the OpenBMC build-setup.sh script
14 # Example: /home/builder/workspace/openbmc-build/build.
23 # DOCKER_IMG_NAME = Defaults to openbmc/ubuntu-robot-qemu, the name the
25 # OBMC_BUILD_DIR = Defaults to /tmp/openbmc/build, the path to the
26 # directory where the UPSTREAM_WORKSPACE build files will
27 # be mounted to. Since the build containers have been
31 # paths in the original build directory. If the build
32 # directory was changed in the build-setup.sh run, this
41 # QEMU_BIN = Location of qemu-system-arm binary to use when starting
43 # ./tmp/sysroots/${QEMU_ARCH}/usr/bin/qemu-system-arm
45 # of obmc-phosphor-image. If you don't find the sysroots
46 # folder, run `bitbake build-sysroots`.
57 set -uo pipefail
59 QEMU_RUN_TIMER=${QEMU_RUN_TIMER:-300}
60 QEMU_LOGIN_TIMER=${QEMU_LOGIN_TIMER:-180}
61 WORKSPACE=${WORKSPACE:-${HOME}/${RANDOM}${RANDOM}}
62 DOCKER_IMG_NAME=${DOCKER_IMG_NAME:-openbmc/ubuntu-robot-qemu}
63 OBMC_BUILD_DIR=${OBMC_BUILD_DIR:-/tmp/openbmc/build}
64 UPSTREAM_WORKSPACE=${UPSTREAM_WORKSPACE:-${1}}
65 LAUNCH=${LAUNCH:-local}
67 MACHINE=${MACHINE:-${DEFAULT_MACHINE}}
68 DEFAULT_IMAGE_LOC=${DEFAULT_IMAGE_LOC:-./tmp/deploy/images/}
72 # then we need to just let our run-robot use the default
80 ARCH=$(uname -m)
85 QEMU_ARCH="ppc64le-linux"
88 QEMU_ARCH="x86_64-linux"
91 QEMU_ARCH="arm64-linux"
94 echo "Unsupported system architecture(${ARCH}) found for docker image"
99 QEMU_BIN=${QEMU_BIN:-./tmp/sysroots/${QEMU_ARCH}/usr/bin/qemu-system-arm}
101 # Get the base directory of the openbmc-build-scripts repo so we can return
105 # shellcheck source=scripts/build-qemu-robot-docker.sh
106 . "$DIR/scripts/build-qemu-robot-docker.sh" "$DOCKER_IMG_NAME"
109 cp "$DIR"/scripts/boot-qemu* "${UPSTREAM_WORKSPACE}"
117 obmc_qemu_docker=$(docker run --detach \
118 --rm \
119 --user root \
120 --env HOME="${OBMC_BUILD_DIR}" \
121 --env QEMU_RUN_TIMER="${QEMU_RUN_TIMER}" \
122 --env QEMU_ARCH="${QEMU_ARCH}" \
123 --env QEMU_BIN="${QEMU_BIN}" \
124 --env MACHINE="${MACHINE}" \
125 --env DEFAULT_IMAGE_LOC="${DEFAULT_IMAGE_LOC}" \
126 --workdir "${OBMC_BUILD_DIR}" \
127 --volume "${UPSTREAM_WORKSPACE}:${OBMC_BUILD_DIR}:ro" \
128 --tty \
129 "${DOCKER_IMG_NAME}" "${OBMC_BUILD_DIR}"/boot-qemu-test.exp)
142 grep "IPAddress\":" | tail -n1 | cut -d '"' -f 4)"
147 while [ $attempt -gt 0 ]; do
148 attempt=$(( attempt - 1 ))
151 if grep -q 'OPENBMC-READY' <<< "$result" ; then
160 if [ "$attempt" -eq 0 ]; then
170 mkdir -p "${WORKSPACE}"
174 cp "$DIR"/scripts/run-robot.sh "${WORKSPACE}"
178 docker run --rm \
179 --env HOME="${HOME}" \
180 --env IP_ADDR="${DOCKER_QEMU_IP_ADDR}" \
181 --env SSH_PORT="${DOCKER_SSH_PORT}" \
182 --env HTTPS_PORT="${DOCKER_HTTPS_PORT}" \
183 --env MACHINE="${MACHINE_QEMU}" \
184 --workdir "${HOME}" \
185 --volume "${WORKSPACE}":"${HOME}" \
186 --tty \
187 "${DOCKER_IMG_NAME}" "${HOME}"/run-robot.sh