blob: 02f66bf74f19d54f6d70c101eda32b884ac54220 [file] [log] [blame]
# syntax=docker/dockerfile:1.4
# Copyright 2024 The ChromiumOS Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
######################################################################
FROM ubuntu:jammy as downloader
WORKDIR /
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get install -y \
--no-install-recommends \
wget \
ca-certificates \
xz-utils
######################################################################
FROM downloader as zephyrfetch
RUN wget https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.16.5-1/zephyr-sdk-0.16.5-1_linux-x86_64.tar.xz
RUN tar xvf zephyr-sdk-0.16.5-1_linux-x86_64.tar.xz
#######################################################################
FROM downloader as ccsfetch
ARG CCS_VERSION=12.5.0
RUN apt-get update \
&& apt-get install -y \
--no-install-recommends \
udev \
libc6-i386
RUN wget https://dr-download.ti.com/software-development/ide-configuration-compiler-or-debugger/MD-J1VdearkvK/${CCS_VERSION}/CCS${CCS_VERSION}.00007_linux-x64.tar.gz
RUN tar xvf CCS${CCS_VERSION}.00007_linux-x64.tar.gz
ENV CCS_BASE=/ti
WORKDIR /CCS${CCS_VERSION}.00007_linux-x64
RUN mkdir -p /etc/udev/rules.d/
RUN ./ccs_setup_${CCS_VERSION}.00007.run --mode unattended --prefix /ti
######################################################################
FROM downloader as dolos-firmware-builder
ARG CCS_VERSION=12.5.0
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get install -y \
--no-install-recommends \
ccache \
cmake \
device-tree-compiler \
dfu-util \
file \
g++-multilib \
gcc \
gcc-multilib \
git \
gperf \
libmagic1 \
libsdl2-dev \
make \
ninja-build \
python3-dev \
python3-pip \
python3-setuptools \
python3-tk \
python3-wheel
RUN pip install west
RUN west init -m https://github.com/msp-ti/zephyr.git --mr mspm0_cleanup /zephyrproject
WORKDIR /zephyrproject/zephyr
COPY dockerfiles/zephyr_yaml_edit.py .
RUN python3 zephyr_yaml_edit.py
RUN west update
ENV ZEPHYR_BASE=/zephyrproject/zephyr/
RUN west zephyr-export
COPY dockerfiles/requirements.compiled .
RUN pip install --require-hashes -r requirements.compiled
WORKDIR /usr/local/zephyr-sdk-0.16.5-1
COPY --link --from=zephyrfetch /zephyr-sdk-0.16.5-1/ .
RUN ./setup.sh -h -t all
WORKDIR /ti
COPY --link --from=ccsfetch /ti/ .
#######################################################################
FROM dolos-firmware-builder as build
ENV CCS_BASE=/ti
WORKDIR /dolos/.git
COPY .git/ .
WORKDIR /dolos/sb-config
COPY sb-config/ .
WORKDIR /dolos/firmware-zephyr
COPY firmware-zephyr/ .
WORKDIR /dolos/firmware-zephyr/src
RUN bash build.sh
#######################################################################
FROM scratch as copytohost
COPY --link --from=build /dolos/firmware-zephyr/build/zephyr/zephyr.txt /