Skip to content

Commit 36db3de

Browse files
authored
Merge pull request #485 from xiulipan/pr/qemu
Travis CI Update Part 2. (Enabel Qemu boot test)
2 parents 32cf948 + 97ea0dc commit 36db3de

7 files changed

Lines changed: 167 additions & 8 deletions

File tree

.travis.yml

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ stages:
1313
- deploy
1414

1515
before_install:
16-
- docker pull xiulipan/sof
16+
- docker pull xiulipan/sof && docker tag xiulipan/sof sof
17+
- docker pull xiulipan/sofqemu && docker tag xiulipan/sofqemu sofqemu
1718

1819
install:
1920
- docker run -it -v `pwd`:/home/sof/work/sof.git --user `id -u` xiulipan/sof ./scripts/rimage-build.sh -l
@@ -22,25 +23,34 @@ jobs:
2223
include:
2324
- stage: compile
2425
name: "BYT Build"
25-
script: docker run -it -v `pwd`:/home/sof/work/sof.git --user `id -u` xiulipan/sof ./scripts/xtensa-build-all.sh -lr byt
26+
script: ./scripts/docker-run.sh ./scripts/xtensa-build-all.sh -lr byt
27+
- stage: compile
28+
name: "CHT Build"
29+
script: ./scripts/docker-run.sh ./scripts/xtensa-build-all.sh -lr cht
2630
- stage: compile
2731
name: "BDW Build"
28-
script: docker run -it -v `pwd`:/home/sof/work/sof.git --user `id -u` xiulipan/sof ./scripts/xtensa-build-all.sh -lr bdw
32+
script: ./scripts/docker-run.sh ./scripts/xtensa-build-all.sh -lr bdw
2933
- stage: compile
3034
name: "HSW Build"
31-
script: docker run -it -v `pwd`:/home/sof/work/sof.git --user `id -u` xiulipan/sof ./scripts/xtensa-build-all.sh -lr hsw
35+
script: ./scripts/docker-run.sh ./scripts/xtensa-build-all.sh -lr hsw
3236
- stage: compile
3337
name: "APL Build"
34-
script: docker run -it -v `pwd`:/home/sof/work/sof.git --user `id -u` xiulipan/sof ./scripts/xtensa-build-all.sh -lr apl
38+
script: ./scripts/docker-run.sh ./scripts/xtensa-build-all.sh -lr apl
3539
- stage: compile
3640
name: "CNL Build"
37-
script: docker run -it -v `pwd`:/home/sof/work/sof.git --user `id -u` xiulipan/sof ./scripts/xtensa-build-all.sh -lr cnl
41+
script: ./scripts/docker-run.sh ./scripts/xtensa-build-all.sh -lr cnl
3842
- stage: compile
3943
name: "SUE Build"
40-
script: docker run -it -v `pwd`:/home/sof/work/sof.git --user `id -u` xiulipan/sof ./scripts/xtensa-build-all.sh -lr sue
44+
script: ./scripts/docker-run.sh ./scripts/xtensa-build-all.sh -lr sue
4145
- stage: compile
4246
name: "ICL Build"
43-
script: docker run -it -v `pwd`:/home/sof/work/sof.git --user `id -u` xiulipan/sof ./scripts/xtensa-build-all.sh -lr icl
47+
script: ./scripts/docker-run.sh ./scripts/xtensa-build-all.sh -lr icl
4448
- stage: compile
4549
name: "Host Build"
4650
script: docker run -it -v `pwd`:/home/sof/work/sof.git --user `id -u` xiulipan/sof ./scripts/host-build-all.sh -l
51+
- stage: test
52+
name: "BYT Boot Test"
53+
script: ./scripts/docker-run.sh ./scripts/xtensa-build-all.sh -lr byt && ./scripts/docker-qemu.sh ../sof.git/scripts/qemu-check.sh byt
54+
- stage: test
55+
name: "CHT Boot Test"
56+
script: ./scripts/docker-run.sh ./scripts/xtensa-build-all.sh -lr cht && ./scripts/docker-qemu.sh ../sof.git/scripts/qemu-check.sh cht

scripts/docker-qemu.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/sh
2+
3+
# Runs a given script in the docker container you can generate from the
4+
# docker_build directory.
5+
# Example:
6+
# To build sof for baytrail:
7+
# ./scripts/docker-run.sh ./scripts/xtensa-build-all.sh byt
8+
# To build topology:
9+
# ./scripts/docker-run.sh ./scripts/build_soft.sh
10+
11+
docker run -it --privileged -v `pwd`:/home/sof/sof.git \
12+
-v `pwd`/../soft.git:/home/sof/soft.git \
13+
--user `id -u` sofqemu $@
File renamed without changes.
File renamed without changes.
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#
2+
# Defines a docker image that can run Xtensa Qemu
3+
#
4+
# Usage:
5+
# check out sof
6+
# build docker image:
7+
# cd scripts/docker_build/sof_qemu
8+
# ./docker-build.sh
9+
#
10+
# run docker image:
11+
# in sof repo
12+
# ./scripts/docker-qemu.sh scrpits-or-command-you-want-run
13+
#
14+
15+
FROM ubuntu:18.04
16+
ARG UID=1000
17+
18+
# Set up proxy from host
19+
COPY apt.conf /etc/apt/
20+
ARG host_http_proxy
21+
ARG host_https_proxy
22+
ENV http_proxy $host_http_proxy
23+
ENV https_proxy $host_https_proxy
24+
25+
RUN apt-get -y update && \
26+
apt-get install -y \
27+
autoconf \
28+
build-essential \
29+
git \
30+
python \
31+
zlib1g-dev \
32+
libglib2.0-dev \
33+
libpixman-1-dev \
34+
pkg-config \
35+
sudo
36+
37+
38+
# Set up sof user
39+
RUN useradd --create-home -d /home/sof -u $UID -G sudo sof && \
40+
echo "sof:test0000" | chpasswd && adduser sof sudo
41+
ENV HOME /home/sof
42+
43+
# build qemu
44+
USER sof
45+
RUN cd /home/sof && git clone https://github.com/thesofproject/qemu.git && \
46+
cd qemu && git checkout sof-stable && \
47+
# replace the submodule git repo to github mirror
48+
sed -i 's#git://git.qemu.org#https://github.com/qemu#g' .gitmodules && \
49+
sed -i 's#git://git.qemu-project.org#https://github.com/qemu#g' .gitmodules && \
50+
./configure --prefix=`pwd`/ --target-list=xtensa-softmmu --enable-coroutine-pool && \
51+
make
52+
53+
# Create direcroties for the host machines sof/soft directories to be mounted.
54+
RUN mkdir -p /home/sof/sof.git && \
55+
mkdir -p /home/sof/soft.git
56+
57+
WORKDIR /home/sof/qemu/
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
if [ -f "/etc/apt/apt.conf" ]; then
3+
cp /etc/apt/apt.conf ./
4+
else
5+
touch apt.conf
6+
fi
7+
docker build --build-arg UID=$(id -u) --build-arg host_http_proxy=$http_proxy --build-arg host_https_proxy=$https_proxy -t sofqemu .

scripts/qemu-check.sh

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
#!/bin/bash
2+
3+
SUPPORTED_PLATFORMS=(byt cht bdw hsw apl cnl sue icl)
4+
5+
rm -f dump-*.txt
6+
7+
if [ "$#" -eq 0 ]
8+
then
9+
PLATFORMS=${SUPPORTED_PLATFORMS[@]}
10+
else
11+
for args in $@
12+
do
13+
for i in ${SUPPORTED_PLATFORMS[@]}
14+
do
15+
if [ $i == $args ]
16+
then
17+
PLATFORMS+=$i" "
18+
fi
19+
done
20+
done
21+
fi
22+
23+
echo $PLATFORMS
24+
25+
for j in ${PLATFORMS[@]}
26+
do
27+
FWNAME="sof-$j.ri"
28+
if [ $j == "byt" ]
29+
then
30+
READY_IPC="0x70028800"
31+
fi
32+
if [ $j == "cht" ]
33+
then
34+
READY_IPC="0x70028800"
35+
fi
36+
if [ $j == "bdw" ]
37+
then
38+
READY_IPC="0x70028800"
39+
fi
40+
if [ $j == "hsw" ]
41+
then
42+
READY_IPC="0x70028800"
43+
fi
44+
if [ $j == "apl" ]
45+
then
46+
READY_IPC="0x70028800"
47+
fi
48+
if [ $j == "cnl" ]
49+
then
50+
READY_IPC="0x70028800"
51+
fi
52+
if [ $j == "sue" ]
53+
then
54+
READY_IPC="0x70028800"
55+
fi
56+
if [ $j == "icl" ]
57+
then
58+
READY_IPC="0x70028800"
59+
fi
60+
61+
./xtensa-host.sh $j -k ../sof.git/src/arch/xtensa/sof-$j.ri -o 2.0 ../sof.git/dump-$j.txt
62+
# dump log into sof.git incase running in docker
63+
64+
# now check log for boot message
65+
if grep $READY_IPC ../sof.git/dump-$j.txt; then
66+
echo "Boot success";
67+
else
68+
echo "Error boot failed"
69+
tail -n 50 ../sof.git/dump-$j.txt
70+
exit 2;
71+
fi
72+
done

0 commit comments

Comments
 (0)