[Sound-open-firmware] [PATCH 1/3] scripts: Add #! headers to shell scripts
Use /bin/sh by default. The lists used in xtensa-build-all.sh are a bash feature, use bash for that script.
Signed-off-by: Dylan Reid dgreid@chromium.org --- scripts/host-build-all.sh | 2 ++ scripts/rimage-build.sh | 2 ++ scripts/xtensa-build-all.sh | 2 ++ 3 files changed, 6 insertions(+)
diff --git a/scripts/host-build-all.sh b/scripts/host-build-all.sh index fd3c847..87933b3 100755 --- a/scripts/host-build-all.sh +++ b/scripts/host-build-all.sh @@ -1,3 +1,5 @@ +#!/bin/sh + # fail on any errors set -e
diff --git a/scripts/rimage-build.sh b/scripts/rimage-build.sh index a2a2e86..af7997d 100755 --- a/scripts/rimage-build.sh +++ b/scripts/rimage-build.sh @@ -1,3 +1,5 @@ +#!/bin/sh + ./autogen.sh ./configure --enable-rimage make diff --git a/scripts/xtensa-build-all.sh b/scripts/xtensa-build-all.sh index 35ff9d9..99db2b0 100755 --- a/scripts/xtensa-build-all.sh +++ b/scripts/xtensa-build-all.sh @@ -1,3 +1,5 @@ +#!/bin/bash + # fail on any errors set -e
Make it easier to build the topology when working in sof.git. This script automates the change of directory to and from soft.git. It also makes building in a container easier because all scripts can execute from the same working directory.
Signed-off-by: Dylan Reid dgreid@chromium.org --- scripts/build-soft.sh | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100755 scripts/build-soft.sh
diff --git a/scripts/build-soft.sh b/scripts/build-soft.sh new file mode 100755 index 0000000..ee89352 --- /dev/null +++ b/scripts/build-soft.sh @@ -0,0 +1,7 @@ +#!/bin/sh +cd ../soft.git +./autogen.sh +./configure --prefix=/home/sof/bin +make -j$(nproc) +make install +cd ../sof.git
Having a docker container that contains the cross compiler and host dependencies eases setup and maintenance of local builds.
The container setup procedure is based of the wiki instruction. A few more dependencies were added.
In addition to the ct-ng and xtensa-newlib steps, this container builds top of tree alsa-lib and alsa-utils as distros seem to be slow to update them with the needed topology features.
The docker-run.sh script is used to automatically bind mount local soft.git and sof.git directories in to the container. This provides build artifacts in the same place as a local "make" would.
Use it like the following:
./scripts/docker-run.sh make ./scripts/docker-run.sh ./scripts/xtensa-build-all.sh etc...
The container only needs to be re-built when the toolchain or alsa dependencies are modified.
Signed-off-by: Dylan Reid dgreid@chromium.org --- scripts/README.docker | 27 +++++++ scripts/docker-run.sh | 13 ++++ scripts/docker_build/Dockerfile | 125 ++++++++++++++++++++++++++++++++ 3 files changed, 165 insertions(+) create mode 100644 scripts/README.docker create mode 100755 scripts/docker-run.sh create mode 100644 scripts/docker_build/Dockerfile
diff --git a/scripts/README.docker b/scripts/README.docker new file mode 100644 index 0000000..fd390d6 --- /dev/null +++ b/scripts/README.docker @@ -0,0 +1,27 @@ +The docker container provided in docker_build sets up a build environment for +building Sound Open Firmware. A working docker installation is needed to run +the docker build container. + +Note: This script assumes the sof.git/ and soft.git/ directories are siblings. + +Quick Start: + +First, build the docker container. This step needs to be done initially and +when the toolchain or alsa dependencies are updated. + +cd scripts/docker_build +docker build --build-arg UID=$(id -u) -t sof . + +After the container is built, it can be used to run the scripts. + +To build for baytrail: +./scripts/docker-run.sh ./scripts/xtensa-build-all.sh byt + +To rebuild the topology in soft.git: +./scripts/docker-run.sh ./scripts/build-soft.sh + +An incremental sof.git build: +./scripts/docker-run.sh make + +Or enter a shell: +./scripts/docker-run.sh bash diff --git a/scripts/docker-run.sh b/scripts/docker-run.sh new file mode 100755 index 0000000..b1e989c --- /dev/null +++ b/scripts/docker-run.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +# Runs a given script in the docker container you can generate from the +# docker_build directory. +# Example: +# To build sof for baytrail: +# ./scripts/docker-run.sh ./scripts/xtensa-build-all.sh byt +# To build topology: +# ./scripts/docker-run.sh ./scripts/build_soft.sh + +docker run -it -v `pwd`:/home/sof/work/sof.git \ + -v `pwd`/../soft.git:/home/sof/work/soft.git \ + --user `id -u` sof $@ diff --git a/scripts/docker_build/Dockerfile b/scripts/docker_build/Dockerfile new file mode 100644 index 0000000..6b587e2 --- /dev/null +++ b/scripts/docker_build/Dockerfile @@ -0,0 +1,125 @@ +# Copyright 2018 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. +# +# Defines a docker image that can build sound open firmware +# +# Usage: +# check out sof +# build docker image: +# docker build --build-arg UID=$(id -u) -t sof . +# docker run -it -v <insert sof dir here>:/home/sof/workdir -v <soft git dir>:/home/sof/work/soft.git --user `id -u` sof +# +# For incremental builds: +# docker run -it -v <insert sof dir here>:/home/sof/work/sof.git -v <soft git dir>:/home/sof/work/soft.git --user `id -u` sof ./incremental.sh +# + +FROM ubuntu +ARG UID=1000 + +RUN apt-get -y update && \ + apt-get install -y \ + autoconf \ + bison \ + build-essential \ + flex \ + gawk \ + gettext \ + git \ + gperf \ + help2man \ + libncurses5-dev \ + libncurses5-dev \ + libssl-dev \ + libtool \ + libtool \ + libtool-bin \ + pkg-config \ + software-properties-common \ + sudo \ + texinfo \ + udev \ + wget + +# Use gcc/g++ 7. +RUN add-apt-repository ppa:ubuntu-toolchain-r/test -y +RUN apt-get -y update +RUN apt-get install -y gcc-7 g++-7 +RUN apt-get clean +RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 70 --slave /usr/bin/g++ g++ /usr/bin/g++-7 + +# Use ToT alsa utils for the latest topology patches. +RUN mkdir -p /root/alsa-build +RUN cd /root/alsa-build && git clone git://git.alsa-project.org/alsa-lib.git +RUN cd /root/alsa-build && git clone git://git.alsa-project.org/alsa-utils.git +RUN cd /root/alsa-build/alsa-lib && ./gitcompile && make install +RUN cd /root/alsa-build/alsa-utils && ./gitcompile && make install + +RUN useradd --create-home -d /home/sof -u $UID -G sudo sof +RUN echo "sof:test0000" | chpasswd +RUN adduser sof sudo +ENV HOME /home/sof + +# pull all sof repositories that are needed +USER sof +RUN git clone git://git.alsa-project.org/sound-open-firmware.git /home/sof/sof.git +RUN git clone git://git.alsa-project.org/sound-open-firmware-tools.git /home/sof/soft.git +RUN git clone https://github.com/01org/osadsp-crosstool-ng.git /home/sof/ct-ng.git +RUN git clone https://github.com/jcmvbkbc/newlib-xtensa.git /home/sof/newlib-xtensa.git + +USER sof +RUN mkdir -p /home/sof/bin +WORKDIR /home/sof/soft.git +RUN ./autogen.sh +RUN ./configure --prefix=/home/sof/bin +RUN make +RUN make install + +ENV PATH="/home/sof/bin/bin:${PATH}" + +USER sof +WORKDIR /home/sof/ct-ng.git +RUN for arch in byt hsw bxt cnl; do \ + ./bootstrap && \ + ./configure --prefix=`pwd` && \ + make && \ + make install && \ + ./ct-ng xtensa-${arch}-elf && \ + ./ct-ng build && \ + make distclean; \ +done + +ENV PATH="/home/sof/ct-ng.git/builds/xtensa-byt-elf/bin:${PATH}" +ENV PATH="/home/sof/ct-ng.git/builds/xtensa-hsw-elf/bin:${PATH}" +ENV PATH="/home/sof/ct-ng.git/builds/xtensa-bxt-elf/bin:${PATH}" +ENV PATH="/home/sof/ct-ng.git/builds/xtensa-cnl-elf/bin:${PATH}" + +USER sof +WORKDIR /home/sof/newlib-xtensa.git +RUN git checkout -b xtensa origin/xtensa +RUN for arch in byt hsw bxt cnl; do \ + ./configure --target=xtensa-${arch}-elf \ + --prefix=/home/sof/work/xtensa-root && \ + make && \ + make install && \ + make distclean; \ +done + +USER sof +WORKDIR /home/sof/sof.git +RUN ./autogen.sh +RUN ./configure --enable-rimage +RUN make +USER root +RUN make install + +# Create direcroties for the host machines sof/soft directories to be mounted. +USER sof +RUN mkdir -p /home/sof/work/sof +RUN mkdir -p /home/sof/work/soft + +USER sof +WORKDIR /home/sof/work/sof.git/ + +# Default to building all. +CMD ./scripts/xtensa-build-all.sh
Hi Dylan,
I have tried you scripts behind proxy and solve one of the apt proxy problem.
But I still got hold by the add-apt-repository.
I see the Dockerfile also contains some git protocol url, and I assume that this could not be supported by the proxy.
Do you have any better method to set the proxy for the docker?
Thanks
Xiuli
On 4/26/2018 00:48, Dylan Reid wrote:
Having a docker container that contains the cross compiler and host dependencies eases setup and maintenance of local builds.
The container setup procedure is based of the wiki instruction. A few more dependencies were added.
In addition to the ct-ng and xtensa-newlib steps, this container builds top of tree alsa-lib and alsa-utils as distros seem to be slow to update them with the needed topology features.
The docker-run.sh script is used to automatically bind mount local soft.git and sof.git directories in to the container. This provides build artifacts in the same place as a local "make" would.
Use it like the following:
./scripts/docker-run.sh make ./scripts/docker-run.sh ./scripts/xtensa-build-all.sh etc...
The container only needs to be re-built when the toolchain or alsa dependencies are modified.
Signed-off-by: Dylan Reid dgreid@chromium.org
scripts/README.docker | 27 +++++++ scripts/docker-run.sh | 13 ++++ scripts/docker_build/Dockerfile | 125 ++++++++++++++++++++++++++++++++ 3 files changed, 165 insertions(+) create mode 100644 scripts/README.docker create mode 100755 scripts/docker-run.sh create mode 100644 scripts/docker_build/Dockerfile
diff --git a/scripts/README.docker b/scripts/README.docker new file mode 100644 index 0000000..fd390d6 --- /dev/null +++ b/scripts/README.docker @@ -0,0 +1,27 @@ +The docker container provided in docker_build sets up a build environment for +building Sound Open Firmware. A working docker installation is needed to run +the docker build container.
+Note: This script assumes the sof.git/ and soft.git/ directories are siblings.
+Quick Start:
+First, build the docker container. This step needs to be done initially and +when the toolchain or alsa dependencies are updated.
+cd scripts/docker_build +docker build --build-arg UID=$(id -u) -t sof .
+After the container is built, it can be used to run the scripts.
+To build for baytrail: +./scripts/docker-run.sh ./scripts/xtensa-build-all.sh byt
+To rebuild the topology in soft.git: +./scripts/docker-run.sh ./scripts/build-soft.sh
+An incremental sof.git build: +./scripts/docker-run.sh make
+Or enter a shell: +./scripts/docker-run.sh bash diff --git a/scripts/docker-run.sh b/scripts/docker-run.sh new file mode 100755 index 0000000..b1e989c --- /dev/null +++ b/scripts/docker-run.sh @@ -0,0 +1,13 @@ +#!/bin/sh
+# Runs a given script in the docker container you can generate from the +# docker_build directory. +# Example: +# To build sof for baytrail: +# ./scripts/docker-run.sh ./scripts/xtensa-build-all.sh byt +# To build topology: +# ./scripts/docker-run.sh ./scripts/build_soft.sh
+docker run -it -v `pwd`:/home/sof/work/sof.git \
-v `pwd`/../soft.git:/home/sof/work/soft.git \
--user `id -u` sof $@
diff --git a/scripts/docker_build/Dockerfile b/scripts/docker_build/Dockerfile new file mode 100644 index 0000000..6b587e2 --- /dev/null +++ b/scripts/docker_build/Dockerfile @@ -0,0 +1,125 @@ +# Copyright 2018 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. +# +# Defines a docker image that can build sound open firmware +# +# Usage: +# check out sof +# build docker image: +# docker build --build-arg UID=$(id -u) -t sof . +# docker run -it -v <insert sof dir here>:/home/sof/workdir -v <soft git dir>:/home/sof/work/soft.git --user `id -u` sof +# +# For incremental builds: +# docker run -it -v <insert sof dir here>:/home/sof/work/sof.git -v <soft git dir>:/home/sof/work/soft.git --user `id -u` sof ./incremental.sh +#
+FROM ubuntu +ARG UID=1000
+RUN apt-get -y update && \
apt-get install -y \
autoconf \
bison \
build-essential \
flex \
gawk \
gettext \
git \
gperf \
help2man \
libncurses5-dev \
libncurses5-dev \
libssl-dev \
libtool \
libtool \
libtool-bin \
pkg-config \
software-properties-common \
sudo \
texinfo \
udev \
wget
+# Use gcc/g++ 7. +RUN add-apt-repository ppa:ubuntu-toolchain-r/test -y +RUN apt-get -y update +RUN apt-get install -y gcc-7 g++-7 +RUN apt-get clean +RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 70 --slave /usr/bin/g++ g++ /usr/bin/g++-7
+# Use ToT alsa utils for the latest topology patches. +RUN mkdir -p /root/alsa-build +RUN cd /root/alsa-build && git clone git://git.alsa-project.org/alsa-lib.git +RUN cd /root/alsa-build && git clone git://git.alsa-project.org/alsa-utils.git +RUN cd /root/alsa-build/alsa-lib && ./gitcompile && make install +RUN cd /root/alsa-build/alsa-utils && ./gitcompile && make install
+RUN useradd --create-home -d /home/sof -u $UID -G sudo sof +RUN echo "sof:test0000" | chpasswd +RUN adduser sof sudo +ENV HOME /home/sof
+# pull all sof repositories that are needed +USER sof +RUN git clone git://git.alsa-project.org/sound-open-firmware.git /home/sof/sof.git +RUN git clone git://git.alsa-project.org/sound-open-firmware-tools.git /home/sof/soft.git +RUN git clone https://github.com/01org/osadsp-crosstool-ng.git /home/sof/ct-ng.git +RUN git clone https://github.com/jcmvbkbc/newlib-xtensa.git /home/sof/newlib-xtensa.git
+USER sof +RUN mkdir -p /home/sof/bin +WORKDIR /home/sof/soft.git +RUN ./autogen.sh +RUN ./configure --prefix=/home/sof/bin +RUN make +RUN make install
+ENV PATH="/home/sof/bin/bin:${PATH}"
+USER sof +WORKDIR /home/sof/ct-ng.git +RUN for arch in byt hsw bxt cnl; do \
- ./bootstrap && \
- ./configure --prefix=`pwd` && \
- make && \
- make install && \
- ./ct-ng xtensa-${arch}-elf && \
- ./ct-ng build && \
- make distclean; \
+done
+ENV PATH="/home/sof/ct-ng.git/builds/xtensa-byt-elf/bin:${PATH}" +ENV PATH="/home/sof/ct-ng.git/builds/xtensa-hsw-elf/bin:${PATH}" +ENV PATH="/home/sof/ct-ng.git/builds/xtensa-bxt-elf/bin:${PATH}" +ENV PATH="/home/sof/ct-ng.git/builds/xtensa-cnl-elf/bin:${PATH}"
+USER sof +WORKDIR /home/sof/newlib-xtensa.git +RUN git checkout -b xtensa origin/xtensa +RUN for arch in byt hsw bxt cnl; do \
- ./configure --target=xtensa-${arch}-elf \
--prefix=/home/sof/work/xtensa-root && \
- make && \
- make install && \
- make distclean; \
+done
+USER sof +WORKDIR /home/sof/sof.git +RUN ./autogen.sh +RUN ./configure --enable-rimage +RUN make +USER root +RUN make install
+# Create direcroties for the host machines sof/soft directories to be mounted. +USER sof +RUN mkdir -p /home/sof/work/sof +RUN mkdir -p /home/sof/work/soft
+USER sof +WORKDIR /home/sof/work/sof.git/
+# Default to building all. +CMD ./scripts/xtensa-build-all.sh
On Wed, 2018-05-02 at 14:08 +0800, Pan, Xiuli wrote:
Hi Dylan,
Please no top posting.
I have tried you scripts behind proxy and solve one of the apt proxy problem.
But I still got hold by the add-apt-repository.
So does this means your patch " [PATCH] scripts: docker: Add apt proxy setting" should not be applied ?
Liam --------------------------------------------------------------------- Intel Corporation (UK) Limited Registered No. 1134945 (England) Registered Office: Pipers Way, Swindon SN3 1RJ VAT No: 860 2173 47
This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.
On 5/2/2018 16:21, Liam Girdwood wrote:
On Wed, 2018-05-02 at 14:08 +0800, Pan, Xiuli wrote:
Hi Dylan,
Please no top posting.
I have tried you scripts behind proxy and solve one of the apt proxy problem.
But I still got hold by the add-apt-repository.
So does this means your patch " [PATCH] scripts: docker: Add apt proxy setting" should not be applied ?
Not sure now. Hold by one of the step. Could not build the docker in proxy environment. Could manually add-apt-repository, may need to edit the dockerfile later. Will update the docker builder to wiki then.
Thanks Xiuli
Liam
Intel Corporation (UK) Limited Registered No. 1134945 (England) Registered Office: Pipers Way, Swindon SN3 1RJ VAT No: 860 2173 47
This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies. _______________________________________________ Sound-open-firmware mailing list Sound-open-firmware@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/sound-open-firmware
On Tue, May 1, 2018 at 11:08 PM Pan, Xiuli xiuli.pan@linux.intel.com wrote:
Hi Dylan,
I have tried you scripts behind proxy and solve one of the apt proxy problem.
But I still got hold by the add-apt-repository.
I see the Dockerfile also contains some git protocol url, and I assume that this could not be supported by the proxy.
If it's the git:// URLs that are a problem, they can probably be switched to https.
Do you have any better method to set the proxy for the docker?
I don't have a setup to test through a proxy. Have you tried the steps here? https://docs.docker.com/network/proxy/#configure-the-docker-client And here? https://askubuntu.com/questions/53146/how-do-i-get-add-apt-repository-to-wor...
Thanks for looking at this,
Dylan
Thanks
Xiuli
On 4/26/2018 00:48, Dylan Reid wrote:
Having a docker container that contains the cross compiler and host dependencies eases setup and maintenance of local builds.
The container setup procedure is based of the wiki instruction. A few more dependencies were added.
In addition to the ct-ng and xtensa-newlib steps, this container builds top of tree alsa-lib and alsa-utils as distros seem to be slow to update them with the needed topology features.
The docker-run.sh script is used to automatically bind mount local soft.git and sof.git directories in to the container. This provides build artifacts in the same place as a local "make" would.
Use it like the following:
./scripts/docker-run.sh make ./scripts/docker-run.sh ./scripts/xtensa-build-all.sh etc...
The container only needs to be re-built when the toolchain or alsa dependencies are modified.
Signed-off-by: Dylan Reid dgreid@chromium.org
scripts/README.docker | 27 +++++++ scripts/docker-run.sh | 13 ++++ scripts/docker_build/Dockerfile | 125 ++++++++++++++++++++++++++++++++ 3 files changed, 165 insertions(+) create mode 100644 scripts/README.docker create mode 100755 scripts/docker-run.sh create mode 100644 scripts/docker_build/Dockerfile
diff --git a/scripts/README.docker b/scripts/README.docker new file mode 100644 index 0000000..fd390d6 --- /dev/null +++ b/scripts/README.docker @@ -0,0 +1,27 @@ +The docker container provided in docker_build sets up a build
environment for
+building Sound Open Firmware. A working docker installation is needed
to run
+the docker build container.
+Note: This script assumes the sof.git/ and soft.git/ directories are
siblings.
+Quick Start:
+First, build the docker container. This step needs to be done
initially and
+when the toolchain or alsa dependencies are updated.
+cd scripts/docker_build +docker build --build-arg UID=$(id -u) -t sof .
+After the container is built, it can be used to run the scripts.
+To build for baytrail: +./scripts/docker-run.sh ./scripts/xtensa-build-all.sh byt
+To rebuild the topology in soft.git: +./scripts/docker-run.sh ./scripts/build-soft.sh
+An incremental sof.git build: +./scripts/docker-run.sh make
+Or enter a shell: +./scripts/docker-run.sh bash diff --git a/scripts/docker-run.sh b/scripts/docker-run.sh new file mode 100755 index 0000000..b1e989c --- /dev/null +++ b/scripts/docker-run.sh @@ -0,0 +1,13 @@ +#!/bin/sh
+# Runs a given script in the docker container you can generate from the +# docker_build directory. +# Example: +# To build sof for baytrail: +# ./scripts/docker-run.sh ./scripts/xtensa-build-all.sh byt +# To build topology: +# ./scripts/docker-run.sh ./scripts/build_soft.sh
+docker run -it -v `pwd`:/home/sof/work/sof.git \
-v `pwd`/../soft.git:/home/sof/work/soft.git \
--user `id -u` sof $@
diff --git a/scripts/docker_build/Dockerfile
b/scripts/docker_build/Dockerfile
new file mode 100644 index 0000000..6b587e2 --- /dev/null +++ b/scripts/docker_build/Dockerfile @@ -0,0 +1,125 @@ +# Copyright 2018 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can
be
+# found in the LICENSE file. +# +# Defines a docker image that can build sound open firmware +# +# Usage: +# check out sof +# build docker image: +# docker build --build-arg UID=$(id -u) -t sof . +# docker run -it -v <insert sof dir here>:/home/sof/workdir -v <soft
git dir>:/home/sof/work/soft.git --user `id -u` sof
+# +# For incremental builds: +# docker run -it -v <insert sof dir here>:/home/sof/work/sof.git -v
<soft git dir>:/home/sof/work/soft.git --user `id -u` sof ./incremental.sh
+#
+FROM ubuntu +ARG UID=1000
+RUN apt-get -y update && \
apt-get install -y \
autoconf \
bison \
build-essential \
flex \
gawk \
gettext \
git \
gperf \
help2man \
libncurses5-dev \
libncurses5-dev \
libssl-dev \
libtool \
libtool \
libtool-bin \
pkg-config \
software-properties-common \
sudo \
texinfo \
udev \
wget
+# Use gcc/g++ 7. +RUN add-apt-repository ppa:ubuntu-toolchain-r/test -y +RUN apt-get -y update +RUN apt-get install -y gcc-7 g++-7 +RUN apt-get clean +RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 70
--slave /usr/bin/g++ g++ /usr/bin/g++-7
+# Use ToT alsa utils for the latest topology patches. +RUN mkdir -p /root/alsa-build +RUN cd /root/alsa-build && git clone git://
git.alsa-project.org/alsa-lib.git
+RUN cd /root/alsa-build && git clone git://
git.alsa-project.org/alsa-utils.git
+RUN cd /root/alsa-build/alsa-lib && ./gitcompile && make install +RUN cd /root/alsa-build/alsa-utils && ./gitcompile && make install
+RUN useradd --create-home -d /home/sof -u $UID -G sudo sof +RUN echo "sof:test0000" | chpasswd +RUN adduser sof sudo +ENV HOME /home/sof
+# pull all sof repositories that are needed +USER sof +RUN git clone git://git.alsa-project.org/sound-open-firmware.git
/home/sof/sof.git
+RUN git clone git://git.alsa-project.org/sound-open-firmware-tools.git
/home/sof/soft.git
+RUN git clone https://github.com/01org/osadsp-crosstool-ng.git
/home/sof/ct-ng.git
+RUN git clone https://github.com/jcmvbkbc/newlib-xtensa.git
/home/sof/newlib-xtensa.git
+USER sof +RUN mkdir -p /home/sof/bin +WORKDIR /home/sof/soft.git +RUN ./autogen.sh +RUN ./configure --prefix=/home/sof/bin +RUN make +RUN make install
+ENV PATH="/home/sof/bin/bin:${PATH}"
+USER sof +WORKDIR /home/sof/ct-ng.git +RUN for arch in byt hsw bxt cnl; do \
./bootstrap && \
./configure --prefix=`pwd` && \
make && \
make install && \
./ct-ng xtensa-${arch}-elf && \
./ct-ng build && \
make distclean; \
+done
+ENV PATH="/home/sof/ct-ng.git/builds/xtensa-byt-elf/bin:${PATH}" +ENV PATH="/home/sof/ct-ng.git/builds/xtensa-hsw-elf/bin:${PATH}" +ENV PATH="/home/sof/ct-ng.git/builds/xtensa-bxt-elf/bin:${PATH}" +ENV PATH="/home/sof/ct-ng.git/builds/xtensa-cnl-elf/bin:${PATH}"
+USER sof +WORKDIR /home/sof/newlib-xtensa.git +RUN git checkout -b xtensa origin/xtensa +RUN for arch in byt hsw bxt cnl; do \
./configure --target=xtensa-${arch}-elf \
--prefix=/home/sof/work/xtensa-root && \
make && \
make install && \
make distclean; \
+done
+USER sof +WORKDIR /home/sof/sof.git +RUN ./autogen.sh +RUN ./configure --enable-rimage +RUN make +USER root +RUN make install
+# Create direcroties for the host machines sof/soft directories to be
mounted.
+USER sof +RUN mkdir -p /home/sof/work/sof +RUN mkdir -p /home/sof/work/soft
+USER sof +WORKDIR /home/sof/work/sof.git/
+# Default to building all. +CMD ./scripts/xtensa-build-all.sh
On Wed, 2018-04-25 at 09:48 -0700, Dylan Reid wrote:
Use /bin/sh by default. The lists used in xtensa-build-all.sh are a bash feature, use bash for that script.
Signed-off-by: Dylan Reid dgreid@chromium.org
Applied 1/3 and 3/3.
Thanks
Liam
participants (4)
-
Dylan Reid
-
Liam Girdwood
-
Liam Girdwood
-
Pan, Xiuli