WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit bde74f8

Browse files
authored
Add Fedora 43 images (#119)
Fedora 43 was released just recently. Add CI images based on that. Signed-off-by: Oliver Steffen <[email protected]>
1 parent 40e1fd2 commit bde74f8

File tree

4 files changed

+254
-0
lines changed

4 files changed

+254
-0
lines changed

.github/workflows/Fedora-43.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# GitHub Action Workflow for building the Fedora 43 images.
2+
3+
# SPDX-License-Identifier: BSD-2-Clause-Patent
4+
5+
name: "Fedora 43 Images"
6+
7+
# This workflow only runs (on the main branch or on PRs targeted
8+
# at the main branch) and if files inside the Fedora-43 directory
9+
# have been modifed/added/removed...
10+
11+
on:
12+
workflow_dispatch:
13+
push:
14+
branches: [ main ]
15+
paths:
16+
- 'Fedora-43/**'
17+
pull_request:
18+
branches: [ main ]
19+
paths:
20+
- 'Fedora-43/**'
21+
22+
jobs:
23+
Build_Image:
24+
uses: ./.github/workflows/build-image.yaml
25+
with:
26+
image_name: "Fedora-43"
27+
sub_images: "build test dev"

Fedora-43/Dockerfile

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
# Dockerfile for building container images for use in the EDK2 CI.
2+
#
3+
# Copyright (C) 2025, Red Hat, Inc.
4+
# SPDX-License-Identifier: BSD-2-Clause-Patent
5+
#
6+
# This file contains the definitions for images to be used for different
7+
# jobs in the EDK2 CI pipeline. The set of tools and dependencies is split into
8+
# multiple images to reduce the overall download size by providing images
9+
# tailored to the task of the CI job. Currently there are two images: "build"
10+
# and "test".
11+
# The images are intended to run on x86_64.
12+
13+
14+
# Build Image
15+
# This image is intended for jobs that compile the source code and as a general
16+
# purpose image. It contains the toolchains for all supported architectures, and
17+
# all build dependencies.
18+
FROM registry.fedoraproject.org/fedora:43 AS build
19+
20+
ARG CSPELL_VERSION=9.3.0
21+
ARG MARKDOWNLINT_VERSION=0.44.0
22+
ARG POWERSHELL_VERSION=7.5.4
23+
ARG DOTNET_VERSION=9.0
24+
RUN --mount=type=cache,target=/var/cache/libdnf5,sharing=locked \
25+
dnf \
26+
--assumeyes \
27+
--nodocs \
28+
--setopt=install_weak_deps=0 \
29+
install \
30+
acpica-tools \
31+
dotnet-runtime-${DOTNET_VERSION} \
32+
curl \
33+
gcc-c++ \
34+
gcc \
35+
gcc-aarch64-linux-gnu \
36+
gcc-arm-linux-gnu \
37+
gcc-riscv64-linux-gnu \
38+
gcc-loongarch64-linux-gnu \
39+
git \
40+
lcov \
41+
libX11-devel \
42+
libXext-devel \
43+
libuuid-devel \
44+
libasan \
45+
libubsan \
46+
make \
47+
nuget \
48+
nasm \
49+
https://github.com/PowerShell/PowerShell/releases/download/v${POWERSHELL_VERSION}/powershell-${POWERSHELL_VERSION}-1.rh.x86_64.rpm \
50+
python3 \
51+
python3-distutils-extra \
52+
python3-pip \
53+
python3-devel \
54+
nodejs \
55+
npm \
56+
tar \
57+
sudo
58+
RUN alternatives --install /usr/bin/python python /usr/bin/python3 1
59+
60+
# Preinstall python + dependencies as virtual environment
61+
RUN --mount=type=cache,target=/var/cache/libdnf5,sharing=locked \
62+
dnf \
63+
--assumeyes \
64+
--nodocs \
65+
--setopt=install_weak_deps=0 \
66+
install \
67+
python3 \
68+
python3-virtualenv
69+
RUN virtualenv=/opt/venv
70+
ENV VIRTUAL_ENV=/opt/venv
71+
ENV PATH=/opt/venv/bin:$PATH
72+
RUN --mount=type=cache,target=/root/.cache/pip \
73+
pip install --upgrade pip \
74+
-r "https://raw.githubusercontent.com/tianocore/edk2/master/pip-requirements.txt"
75+
76+
RUN --mount=type=cache,target=/root/.cache/pip \
77+
pip install --upgrade pip lcov_cobertura setuptools
78+
79+
# Set toolchains prefix
80+
ENV GCC_AARCH64_PREFIX=/usr/bin/aarch64-linux-gnu-
81+
ENV GCC_ARM_PREFIX=/usr/bin/arm-linux-gnu-
82+
ENV GCC_RISCV64_PREFIX=/usr/bin/riscv64-linux-gnu-
83+
ENV GCC_LOONGARCH64_PREFIX=/usr/bin/loongarch64-linux-gnu-
84+
# - Also set GCC5, which is deprecated, but still in use.
85+
ENV GCC5_AARCH64_PREFIX=/usr/bin/aarch64-linux-gnu-
86+
ENV GCC5_ARM_PREFIX=/usr/bin/arm-linux-gnu-
87+
ENV GCC5_RISCV64_PREFIX=/usr/bin/riscv64-linux-gnu-
88+
ENV GCC5_LOONGARCH64_PREFIX=/usr/bin/loongarch64-linux-gnu-
89+
90+
# Tools used by build extensions.
91+
RUN --mount=type=cache,target=/root/.npm \
92+
npm install -g npm \
93+
cspell@${CSPELL_VERSION} \
94+
markdownlint-cli@${MARKDOWNLINT_VERSION}
95+
96+
# Test Image
97+
# This image is intended for jobs that run tests (and possibly also build)
98+
# firmware images. It is based on the build image and adds Qemu for the
99+
# architectures under test.
100+
101+
FROM build AS test
102+
RUN --mount=type=cache,target=/var/cache/libdnf5,sharing=locked \
103+
dnf \
104+
--assumeyes \
105+
--nodocs \
106+
--setopt=install_weak_deps=0 \
107+
install \
108+
qemu-system-arm \
109+
qemu-system-aarch64 \
110+
qemu-system-loongarch64 \
111+
qemu-system-x86 \
112+
qemu-system-riscv \
113+
qemu-ui-gtk
114+
115+
# Dev Image
116+
# This image is intended for local use. This builds on the test image but adds
117+
# tools for local developers.
118+
FROM test AS dev
119+
ENV GCM_LINK=https://github.com/git-ecosystem/git-credential-manager/releases/download/v2.6.0/gcm-linux_amd64.2.6.0.tar.gz
120+
RUN --mount=type=cache,target=/var/cache/libdnf5,sharing=locked \
121+
dnf \
122+
--assumeyes \
123+
--nodocs \
124+
--setopt=install_weak_deps=0 \
125+
install \
126+
libicu \
127+
clang \
128+
curl \
129+
lld \
130+
llvm \
131+
tar \
132+
vim \
133+
nano
134+
135+
# Setup the git credential manager for developer credentials.
136+
RUN curl -L "${GCM_LINK}" | tar -xz -C /usr/local/bin
137+
RUN git-credential-manager configure
138+
RUN git config --global credential.credentialStore cache
139+
RUN cp /etc/skel/.bashrc /root/.bashrc
140+
141+
# Set the entry point
142+
COPY fedora43_dev_entrypoint.sh /usr/libexec/entrypoint
143+
ENTRYPOINT ["/usr/libexec/entrypoint"]

Fedora-43/Readme.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Fedora 43 Images
2+
3+
This set of images is based on the Fedora 43 image.
4+
It has three flavors, `build`, `test`, and `dev`.
5+
The first two are primarily intended for automated builds
6+
and CI usage.
7+
8+
The `build` image contains the compilers and build tools
9+
needed for building EDK2 under Linux (x86_64).
10+
11+
The `test` image extends the `build` image and adds Qemu for
12+
testing purposes.
13+
14+
The `dev` image in turn extends the `test` image and adds developer
15+
convenience tools, for example the git credential manager.
16+
17+
These images include:
18+
19+
- gcc 15.2.1 (x86, arm, aarch64, riscv, loongarch64)
20+
- nasm 2.16.03
21+
- Python 3.14
22+
- Qemu 10.1.2 (x86, arm, aarch64, loongarch64)
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
#!/bin/bash -x
2+
#
3+
# Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
4+
# SPDX-License-Identifier: BSD-2-Clause-Patent
5+
6+
set -e
7+
8+
#####################################################################
9+
# Check for required env
10+
if [ -z "${EDK2_DOCKER_USER_HOME}" ] || [ ! -d "${EDK2_DOCKER_USER_HOME}" ]; then
11+
echo 'Missing EDK2_DOCKER_USER_HOME. Running as root.'
12+
exec "$@"
13+
fi
14+
15+
#####################################################################
16+
# Create a user to run the command
17+
#
18+
# Docker would run as root, but that creates a permissions mess in a mixed
19+
# development environment where some commands are run inside the container and
20+
# some outside. Instead, we'll create a user with uid/gid to match the one
21+
# running the container. Then, the permissions will be consistent with
22+
# non-docker activities.
23+
#
24+
# - If the caller provides a username, we'll use it. Otherwise, just use an
25+
# arbitrary username.
26+
EDK2_DOCKER_USER=${EDK2_DOCKER_USER:-edk2}
27+
#
28+
# - Get the uid and gid from the user's home directory.
29+
user_uid=$(stat -c "%u" "${EDK2_DOCKER_USER_HOME}")
30+
user_gid=$(stat -c "%g" "${EDK2_DOCKER_USER_HOME}")
31+
#
32+
# - Add the group. We'll take a shortcut here and always name it the same as
33+
# the username. The name is cosmetic, though. The important thing is that the
34+
# gid matches.
35+
groupadd "${EDK2_DOCKER_USER}" -f -o -g "${user_gid}"
36+
#
37+
# - Add the user.
38+
useradd "${EDK2_DOCKER_USER}" -o -l -u "${user_uid}" -g "${user_gid}" \
39+
-G wheel -d "${EDK2_DOCKER_USER_HOME}" -M -s /bin/bash
40+
41+
echo "${EDK2_DOCKER_USER}":tianocore | chpasswd
42+
43+
# Adjust owner of the pre-initialized Python virtual env
44+
if [ -d "${VIRTUAL_ENV}" ]; then
45+
chown --recursive "${EDK2_DOCKER_USER}" "${VIRTUAL_ENV}"
46+
fi
47+
48+
#####################################################################
49+
# Cleanup variables
50+
unset user_uid
51+
unset user_gid
52+
53+
54+
#####################################################################
55+
# Drop permissions and run the command
56+
if [ "$1" = "su" ]; then
57+
# Special case. Let the user come in as root, if they really want to.
58+
shift
59+
exec "$@"
60+
else
61+
exec runuser -u "${EDK2_DOCKER_USER}" -- "$@"
62+
fi

0 commit comments

Comments
 (0)