Skip to content

Commit

Permalink
switch to bsp based naming for images
Browse files Browse the repository at this point in the history
  • Loading branch information
gilesknap committed Mar 7, 2024
1 parent 0ffce96 commit 3bd88f6
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 21 deletions.
16 changes: 9 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ jobs:
max-parallel: 1 # take advantage of caching
matrix:
target: [developer, runtime]
include:
- os: ubuntu-latest
platforms: linux/amd64
# add more targets here and add a Dockerfile.${{ matrix.target }} to the repo
target_architecture: [beatnik]

runs-on: ${{ matrix.os }}

runs-on: ubuntu-latest
env:
TAG: ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}-${{ matrix.target }}
TAG: ghcr.io/${{ github.repository_owner }}/rtems-${{ matrix.target_architecture }}-${{ matrix.target }}
steps:

- name: Log in to GitHub Docker Registry
Expand All @@ -38,10 +38,11 @@ jobs:
- name: Build image
uses: docker/build-push-action@v5
with:
file: Dockerfile.${{ matrix.target_architecture }}
target: ${{ matrix.target }}
tags: ${{ env.TAG }}:${{ github.ref_name }},${{ env.TAG }}:latest
cache-from: type=gha
cache-to: type=gha,mode=max
cache-from: type=gha,scope=${{ matrix.target }}
cache-to: type=gha,mode=max,scope=${{ matrix.target }}
load: true

- name: Test image
Expand All @@ -51,5 +52,6 @@ jobs:
if: ${{ github.event_name == 'push' && github.ref_type == 'tag' }}
uses: docker/build-push-action@v5
with:
file: Dockerfile.${{ matrix.target_architecture }}
tags: ${{ env.TAG }}:${{ github.ref_name }},${{ env.TAG }}:latest
push: true
17 changes: 10 additions & 7 deletions Dockerfile → Dockerfile.beatnik
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ ENV RTEMS_MINOR=1-rc2
ENV RTEMS_VERSION=${RTEMS_MAJOR}.${RTEMS_MINOR}
ENV RTEMS_ARCH=powerpc
ENV RTEMS_BSP=beatnik
ENV RTEMS_BASE=/rtems6-${RTEMS_BSP}-legacy
ENV RTEMS_PREFIX=${RTEMS_BASE}/rtems/${RTEMS_VERSION}
ENV RTEMS_TOP=/rtems6-${RTEMS_BSP}-legacy
ENV RTEMS_PREFIX=${RTEMS_TOP}/rtems/${RTEMS_VERSION}
ENV PATH=${RTEMS_PREFIX}/bin:${PATH}

FROM environment AS developer
Expand All @@ -33,7 +33,7 @@ RUN python3 -m venv ${VIRTUALENV}
ENV PATH=${VIRTUALENV}/bin:${PATH}

# get the RTEMS Source Builder
WORKDIR ${RTEMS_BASE}
WORKDIR ${RTEMS_TOP}
RUN curl https://ftp.rtems.org/pub/rtems/releases/${RTEMS_MAJOR}/rc/${RTEMS_VERSION}/sources/rtems-source-builder-${RTEMS_VERSION}.tar.xz \
| tar -xJ && \
mv rtems-source-builder-${RTEMS_VERSION} rsb
Expand All @@ -49,13 +49,13 @@ RUN ../source-builder/sb-set-builder --prefix=${RTEMS_PREFIX} ${RTEMS_MAJOR}/rte
ranlib $(find ${RTEMS_PREFIX} -name '*.a')

# get the kernel
WORKDIR ${RTEMS_BASE}
WORKDIR ${RTEMS_TOP}
RUN curl https://ftp.rtems.org/pub/rtems/releases/${RTEMS_MAJOR}/rc/${RTEMS_VERSION}/sources/rtems-${RTEMS_VERSION}.tar.xz \
| tar -xJ && \
mv rtems-${RTEMS_VERSION} kernel

# patch the kernel
WORKDIR ${RTEMS_BASE}/kernel
WORKDIR ${RTEMS_TOP}/kernel
COPY VMEConfig.patch .
RUN git apply VMEConfig.patch && \
./waf bspdefaults --rtems-bsps=${RTEMS_ARCH}/${RTEMS_BSP} > config.ini && \
Expand All @@ -66,10 +66,10 @@ RUN git apply VMEConfig.patch && \
RUN ./waf && \
./waf install

RUN git clone git://git.rtems.org/rtems-net-legacy.git ${RTEMS_BASE}/rtems-net-legacy
RUN git clone git://git.rtems.org/rtems-net-legacy.git ${RTEMS_TOP}/rtems-net-legacy

# add in the legacy network stack
WORKDIR ${RTEMS_BASE}/rtems-net-legacy
WORKDIR ${RTEMS_TOP}/rtems-net-legacy
RUN git submodule init && \
git submodule update && \
./waf configure --prefix=${RTEMS_PREFIX} --rtems-bsps=${RTEMS_ARCH}/${RTEMS_BSP} && \
Expand All @@ -90,5 +90,8 @@ RUN rm -r \

from runtime_prep AS runtime

# environment variables for epics-base build
ENV RTEMS_BASE=${RTEMS_PREFIX}

COPY --from=runtime_prep ${RTEMS_PREFIX} ${RTEMS_PREFIX}

27 changes: 20 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,27 @@
A container that makes the RTEMS powerpc beatnik Board Support Package (BSP).
RTEMS Board Support Packages
============================

A container that makes the RTEMS Board Support Packages (BSPs).

This container gets the sources from RTEMS releases, builds the toolchain and then compiles the BSP.

The developer target serves as an archive for the source code. The runtime target is a minmal container with the RTEMS powerpc-beatnik BSP only, intended to be used as a base for epics-base builds.
The developer target serves as an archive for the source code. The runtime target is a minimal container with the RTEMS BSP only, intended to be used as a base image for epics-base builds (see https://github.com/epics-containers/epics-base)

Supported BSPs
--------------

The repo is designed to allow for multiple target architectures. At present the list of BSPs is only 1 long:

- mvme5500
- rtems version: 6.1-rc2
- patches for MVME5500 boards used at DLS
- legacy network stack
- processor is m4700 with hardware floating point support


The current configuration is:-
- rtems version: 6.1-rc2
- patches for MVME5500 boards used at DLS
- legacy network stack
Acknowledgements
================

This container can be run to experiment with building components with the RSP and prebuilt rtems6 toolchain.
This is all possible due to the hard work of the RTEMS community.

See https://docs.rtems.org/branches/master/user/start/index.html

0 comments on commit 3bd88f6

Please sign in to comment.