diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d1df902..33a35cd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 @@ -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 @@ -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 diff --git a/Dockerfile b/Dockerfile.beatnik similarity index 88% rename from Dockerfile rename to Dockerfile.beatnik index c3a6d8e..0a8bb7e 100644 --- a/Dockerfile +++ b/Dockerfile.beatnik @@ -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 @@ -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 @@ -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 && \ @@ -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} && \ @@ -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} diff --git a/README.md b/README.md index fc4b883..77a2fdd 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/local_patch/patch-rsb.sh b/local_patch/patch-rsb.sh index fb5b0b2..2a94c0c 100755 --- a/local_patch/patch-rsb.sh +++ b/local_patch/patch-rsb.sh @@ -1,7 +1,7 @@ #!/bin/bash THIS=$(realpath $(dirname $0)) -RSB=${RTEMS_BASE}/rsb +RSB=${RTEMS_TOP}/rsb set -xe