Skip to content

Commit

Permalink
new(pkg,docker): added an amazonlinux2 gcc10 builder.
Browse files Browse the repository at this point in the history
This fixes driver build issues on al2 5.10 kernels.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
  • Loading branch information
FedeDP authored and poiana committed Jul 19, 2024
1 parent 508fb74 commit 9e6dca8
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
32 changes: 32 additions & 0 deletions docker/builders/builder-amazonlinux2-x86_64_gcc10.0.0.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
FROM amazonlinux:2.0.20240529.0

LABEL maintainer="cncf-falco-dev@lists.cncf.io"

RUN yum -y install gcc10 \
clang \
llvm \
bash-completion \
bc \
ca-certificates \
curl \
gnupg2 \
libc6-dev \
elfutils-libelf-devel \
xz \
cpio \
flex \
bison \
openssl \
openssl-devel \
wget \
binutils \
which \
make \
cmake3 \
tar \
zstd \
git

# Properly create soft links
RUN ln -s /usr/bin/gcc10-cc /usr/bin/gcc-10.0.0
RUN ln -s /usr/bin/cmake3 /usr/bin/cmake
9 changes: 9 additions & 0 deletions pkg/driverbuilder/builder/amazonlinux.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"database/sql"
_ "embed"
"fmt"
"github.com/blang/semver"
"io"
"io/ioutil"
"log"
Expand Down Expand Up @@ -179,6 +180,14 @@ func (a *amazonlinux2) URLs(kr kernelrelease.KernelRelease) ([]string, error) {
return fetchAmazonLinuxPackagesURLs(a, kr)
}

func (a *amazonlinux2) GCCVersion(kr kernelrelease.KernelRelease) semver.Version {
// 5.10 amazonlinux2 kernels need gcc 10
if kr.Major == 5 && kr.Minor == 10 {
return semver.Version{Major: 10}
}
return semver.Version{}
}

func (a *amazonlinux2) repos() []string {
return []string{
"core/2.0",
Expand Down

0 comments on commit 9e6dca8

Please sign in to comment.