Skip to content

Commit

Permalink
Add dockerfile for NuttX platform compile (#31341)
Browse files Browse the repository at this point in the history
Signed-off-by: zhanghongyu <[email protected]>
Co-authored-by: Andrei Litvin <[email protected]>
  • Loading branch information
zhhyu7 and andy31415 authored Mar 2, 2024
1 parent 9e8a77f commit d8f5bf1
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 1 deletion.
2 changes: 1 addition & 1 deletion integrations/docker/images/base/chip-build/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
39 : [Python] Add ruff Python linter to chip-build
40 : [NuttX] Add support for NuttX SDK
41 changes: 41 additions & 0 deletions integrations/docker/images/stage-2/chip-build-nuttx/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
ARG VERSION=1
FROM ghcr.io/project-chip/chip-build:${VERSION}
LABEL org.opencontainers.image.source https://github.com/project-chip/connectedhomeip

# ------------------------------------------------------------------------------
# Install prerequisites
RUN set -x \
&& dpkg --add-architecture i386 \
&& apt update -y \
&& apt install -y genromfs xxd libgmp-dev libmpfr-dev libmpc-dev \
&& : # last line

# ------------------------------------------------------------------------------
# Download and build g++-13
RUN set -x \
&& ! test -d /opt/nuttx/gcc-13 \
&& wget -P gcc_build https://ftp.tsukuba.wide.ad.jp/software/gcc/releases/gcc-13.1.0/gcc-13.1.0.tar.gz \
&& cd gcc_build \
&& tar xzf gcc-13.1.0.tar.gz \
&& cd gcc-13.1.0 \
&& ./configure --prefix=/opt/nuttx/gcc-13 --disable-multilib \
&& make -j8 \
&& make install-strip \
&& rm -rf ../../gcc_build \
&& : # last line

# ------------------------------------------------------------------------------
# Download NuttX SDK
RUN set -x \
&& cd /opt/nuttx \
&& wget -q -O nuttx.zip https://codeload.github.com/apache/nuttx/zip/b8e0423 \
&& unzip -q nuttx.zip \
&& mv nuttx-b8e0423 nuttx \
&& rm nuttx.zip

RUN set -x \
&& cd /opt/nuttx \
&& wget -q -O nuttx_app.zip https://codeload.github.com/apache/nuttx-apps/zip/9c48a8d \
&& unzip -q nuttx_app.zip \
&& mv nuttx-apps-9c48a8d apps \
&& rm nuttx_app.zip
1 change: 1 addition & 0 deletions integrations/docker/images/stage-2/chip-build-nuttx/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ FROM ghcr.io/project-chip/chip-build-ti:${VERSION} AS ti
FROM ghcr.io/project-chip/chip-build-openiotsdk:${VERSION} AS openiotsdk
FROM ghcr.io/project-chip/chip-build-bouffalolab:${VERSION} AS bouffalolab
FROM ghcr.io/project-chip/chip-build-asr:${VERSION} AS asr
FROM ghcr.io/project-chip/chip-build-nuttx:${VERSION} AS nuttx
FROM ghcr.io/project-chip/chip-build:${VERSION}

LABEL org.opencontainers.image.source https://github.com/project-chip/connectedhomeip
Expand Down Expand Up @@ -67,6 +68,8 @@ COPY --from=efr32 /opt/silabs/gecko_sdk /opt/silabs/gecko_sdk
COPY --from=efr32 /opt/silabs/wiseconnect-wifi-bt-sdk /opt/silabs/wiseconnect-wifi-bt-sdk
COPY --from=efr32 /opt/silabs/wifi_sdk /opt/silabs/wifi_sdk

COPY --from=nuttx /opt/nuttx /opt/nuttx

# Android license file "acceping" is done by writing license hashes
# into the 'licenses' subfolder. This allows any user (in particular
# 'vscode' to accept licenses)
Expand Down

0 comments on commit d8f5bf1

Please sign in to comment.