From dfad3b1175229e1b306a62dde305a5373bbe7304 Mon Sep 17 00:00:00 2001 From: Federico Di Pierro Date: Tue, 1 Aug 2023 09:34:25 +0200 Subject: [PATCH 01/17] new(ci): push docker images to ghcr. Signed-off-by: Federico Di Pierro --- .github/workflows/main.yml | 48 ++++++++++++++++++++++++++++++++++++++ images/Makefile | 45 ++++++++++++++++++++++++----------- images/README.md | 9 +++---- 3 files changed, 85 insertions(+), 17 deletions(-) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..b25e7f8 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,48 @@ +name: Build and Push docker images +on: + pull_request: + branches: + - main + paths: + - 'images/**' + push: + branches: + - main + paths: + - 'images/**' + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + push-images: + strategy: + fail-fast: false + matrix: + architecture: [amd64, arm64] + runs-on: ${{ (matrix.arch == 'arm64' && 'actuated-arm64-8cpu-16gb') || 'ubuntu-22.04' }} + steps: + - name: Checkout repo + uses: actions/checkout@v3 + + - name: Login to Github Packages + if: ${{ github.event_name == 'push' }} + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Sets PUSH env var for main push + if: ${{ github.event_name == 'push' }} + run: | + echo "PUSH=true" >> $GITHUB_ENV + + - name: Build images + working-directory: ./images + run: | + make build-all + + + diff --git a/images/Makefile b/images/Makefile index 611c55c..9020d7a 100644 --- a/images/Makefile +++ b/images/Makefile @@ -1,9 +1,10 @@ DRY_RUN := false -REPOSITORY := falcosecurity/kernel-testing +PUSH := false +REPOSITORY := ghcr.io/falcosecurity/kernel-testing ARCH ?= $(shell uname -m) YAML_FILE := images.yaml -.PHONY: build-rootfs build-kernel docker-push generate-yaml build-all initrd-builder modernprobe-builder builder +.PHONY: build-rootfs build-kernel generate-yaml build-all initrd-builder modernprobe-builder builder builder: if [ "$(DRY_RUN)" = "true" ]; then \ @@ -11,6 +12,10 @@ builder: else \ echo "Building modernprobe-builder image"; \ docker build -t $(REPOSITORY)/builder:0.0.1-$(ARCH) builder; \ + if [ "$(PUSH)" = "true" ]; then \ + echo "Pushing image: $(REPOSITORY)/builder:0.0.1-$(ARCH)"; \ + docker push $(REPOSITORY)/builder:0.0.1-$(ARCH); \ + fi; \ fi modernprobe-builder: @@ -19,6 +24,10 @@ modernprobe-builder: else \ echo "Building modernprobe-builder image"; \ docker build -t $(REPOSITORY)/modernprobe-builder:0.0.1-$(ARCH) modernprobe-builder; \ + if [ "$(PUSH)" = "true" ]; then \ + echo "Pushing image: $(REPOSITORY)/modernprobe-builder:0.0.1-$(ARCH)"; \ + docker push $(REPOSITORY)/modernprobe-builder:0.0.1-$(ARCH); \ + fi; \ fi initrd-builder: @@ -39,6 +48,12 @@ build-rootfs: else \ echo "Building rootfs image: $$image"; \ docker build -t $$image $$rootfs_dir; \ + if [ "$(PUSH)" = "true" ]; then \ + echo "Pushing image: $$image"; \ + docker push $$image; \ + fi; \ + docker image rm -f $$image; \ + docker builder prune -f -a; \ fi; \ done @@ -52,16 +67,12 @@ build-kernel: initrd-builder else \ echo "Building kernel image: $$image"; \ docker build -t $$image -f $$kernel_dir/Dockerfile.kernel $$kernel_dir; \ - fi; \ - done - -docker-push: - @for image in $$(docker images --format "{{.Repository}}:{{.Tag}}" | grep "$(REPOSITORY)" | grep "$(ARCH)"); do \ - if [ "$(DRY_RUN)" = "true" ]; then \ - echo "Dry run: Pushing image: docker push $$image"; \ - else \ - echo "Pushing image: $$image"; \ - docker push $$image; \ + if [ "$(PUSH)" = "true" ]; then \ + echo "Pushing image: $$image"; \ + docker push $$image; \ + fi; \ + docker image rm -f $$image; \ + docker builder prune -f -a; \ fi; \ done @@ -79,6 +90,10 @@ docker-push: else \ echo "Building rootfs image: $$rootfs_image"; \ docker build -t $$rootfs_image $$rootfs_dir; \ + if [ "$(PUSH)" = "true" ]; then \ + echo "Pushing image: $$rootfs_image"; \ + docker push $$rootfs_image; \ + fi; \ fi; \ fi; \ if [ -n "$$kernel_dir" ]; then \ @@ -87,6 +102,10 @@ docker-push: else \ echo "Building kernel image: $$kernel_image"; \ docker build -t $$kernel_image -f $$kernel_dir/Dockerfile.kernel $$kernel_dir; \ + if [ "$(PUSH)" = "true" ]; then \ + echo "Pushing image: $$kernel_image"; \ + docker push $$kernel_image; \ + fi; \ fi; \ fi; @@ -102,4 +121,4 @@ generate-yaml: fi; \ done -build-all: build-rootfs build-kernel +build-all: build-kernel build-rootfs diff --git a/images/README.md b/images/README.md index 28cbbbb..71fa1ac 100644 --- a/images/README.md +++ b/images/README.md @@ -2,11 +2,10 @@ Makefile present in this directory is specifically designed to generate the static Docker images required by Ignite to run tests on different Linux distributions. The workflow provided by this Makefile is designed to be straightforward, consisting of three main commands: -1. `build-all`: This target builds all the necessary Docker images for the different versions and distributions required for testing with Firecracker. +1. `build-all`: This target builds all the necessary Docker images for the different versions and distributions required for testing with Firecracker. +Optionally, you can set `PUSH=true` env variable to push the resulting Docker images to a Docker Hub registry for easier distribution and access. -2. `docker-push`: Optionally, you can use this target to push the resulting Docker images to a Docker Hub registry for easier distribution and access. - -3. `generate-yaml`: This target allows you to generate a YAML file (`images.yaml`) containing the matrix of new image information. The generated YAML file can be conveniently copied to the variables file of Ansible to keep the test environment up to date. +2. `generate-yaml`: This target allows you to generate a YAML file (`images.yaml`) containing the matrix of new image information. The generated YAML file can be conveniently copied to the variables file of Ansible to keep the test environment up to date. ## Prerequisites @@ -73,6 +72,8 @@ You can customize the Makefile to suit your specific requirements. The variables - `DRY_RUN`: Set this variable to `true` for a dry run, where the build commands will be printed but not executed. +- `PUSH`: Set this variable to `true` when executing build to also push built image to remote registry. + - `REPOSITORY`: The Docker repository where the built images will be tagged and pushed. - `ARCH`: The architecture for which the images will be built. By default, it will use the output of `uname -p`. From 16fe9462095110d55d175017afb7720cea5c79a5 Mon Sep 17 00:00:00 2001 From: Federico Di Pierro Date: Wed, 6 Dec 2023 14:11:04 +0100 Subject: [PATCH 02/17] fix(images): drop `bpftool` dep from images since it is only used by modernbpf-builder now. Signed-off-by: Federico Di Pierro --- images/aarch64/amazonlinux2022/5.15/Dockerfile | 2 -- images/aarch64/fedora/6.2/Dockerfile | 1 - images/aarch64/oraclelinux/5.15/Dockerfile | 3 +-- images/aarch64/ubuntu/6.3/Dockerfile | 1 - images/x86_64/amazonlinux2022/5.15/Dockerfile | 2 -- images/x86_64/amazonlinux2023/6.1/Dockerfile | 6 ++---- images/x86_64/archlinux/5.18/Dockerfile | 1 - images/x86_64/archlinux/6.0/Dockerfile | 4 +--- images/x86_64/centos/5.14/Dockerfile | 1 - images/x86_64/fedora/5.17/Dockerfile | 1 - images/x86_64/fedora/5.8/Dockerfile | 1 - images/x86_64/fedora/6.2/Dockerfile | 1 - images/x86_64/oraclelinux/5.15/Dockerfile | 1 - 13 files changed, 4 insertions(+), 21 deletions(-) diff --git a/images/aarch64/amazonlinux2022/5.15/Dockerfile b/images/aarch64/amazonlinux2022/5.15/Dockerfile index 366f934..f885356 100644 --- a/images/aarch64/amazonlinux2022/5.15/Dockerfile +++ b/images/aarch64/amazonlinux2022/5.15/Dockerfile @@ -26,8 +26,6 @@ RUN dnf groupinstall -y 'Development Tools' && \ xargs -I@ curl -Lo headers.rpm ${URL}@ && \ grep -E 'kernel-devel-'${VERSION}'.*.rpm' primary.xml | grep href | cut -d\" -f2 | \ xargs -I@ curl -Lo sources.rpm ${URL}@ && \ - grep -E 'bpftool-'${VERSION}'.*.rpm' primary.xml | grep href | cut -d\" -f2 | \ - xargs -I@ curl -Lo bpftool.rpm ${URL}@ && \ dnf install -y ./*.rpm && \ rm -f ./*.rpm && \ mkdir -p /lib/modules/5.15.73-45.135.amzn2022.aarch64/ && \ diff --git a/images/aarch64/fedora/6.2/Dockerfile b/images/aarch64/fedora/6.2/Dockerfile index 837d1a0..873090a 100644 --- a/images/aarch64/fedora/6.2/Dockerfile +++ b/images/aarch64/fedora/6.2/Dockerfile @@ -15,7 +15,6 @@ RUN dnf groupinstall -y 'Development Tools' && \ openssh-server \ rsync \ systemd && \ - curl -Lo bpftool.rpm ${URL}/b/bpftool-${HVERSION}.fc38.${ARCH}.rpm && \ curl -Lo sources.rpm ${URL}/k/kernel-devel-${VERSION}.fc38.${ARCH}.rpm && \ curl -Lo headers.rpm ${URL}/k/kernel-headers-${HVERSION}.fc38.${ARCH}.rpm && \ dnf install -y ./*.rpm && \ diff --git a/images/aarch64/oraclelinux/5.15/Dockerfile b/images/aarch64/oraclelinux/5.15/Dockerfile index e90ec1d..2e5c56c 100644 --- a/images/aarch64/oraclelinux/5.15/Dockerfile +++ b/images/aarch64/oraclelinux/5.15/Dockerfile @@ -21,8 +21,7 @@ RUN yum install -y \ curl -L -o kernel.rpm ${URL}/getPackage/kernel-uek-core-${VERSION}.el9uek.${ARCH}.rpm && \ curl -L -o devel.rpm ${URL}/getPackage/kernel-uek-devel-${VERSION}.el9uek.${ARCH}.rpm && \ curl -L -o modules.rpm ${URL}/getPackage/kernel-uek-modules-${VERSION}.el9uek.${ARCH}.rpm && \ - curl -L -o bpftool.rpm ${URL}/getPackage/bpftool-${VERSION}.el9uek.${ARCH}.rpm && \ - yum install -y ./kernel.rpm ./devel.rpm ./modules.rpm ./bpftool.rpm && \ + yum install -y ./kernel.rpm ./devel.rpm ./modules.rpm && \ sed -i -e 's/^AcceptEnv LANG LC_\*$/#AcceptEnv LANG LC_*/' /etc/ssh/sshd_config && \ echo "root:root" | chpasswd && \ echo 'UseDNS no' >> /etc/ssh/sshd_config && \ diff --git a/images/aarch64/ubuntu/6.3/Dockerfile b/images/aarch64/ubuntu/6.3/Dockerfile index 083f27b..a755354 100644 --- a/images/aarch64/ubuntu/6.3/Dockerfile +++ b/images/aarch64/ubuntu/6.3/Dockerfile @@ -43,7 +43,6 @@ RUN apt-get update && apt-get install -y \ xargs -I@ curl -LO ${URL}@ && \ find . -name '*.deb' | xargs -n1 dpkg -i --force-depends && \ rm -f *.deb && \ - find /usr/lib/linux-tools/ -name bpftool -exec ln -s {} /usr/bin/bpftool \; && \ sed -ie '/^ConditionVirtualization.*/d' /lib/systemd/system/systemd-timesyncd.service && \ echo "" > /etc/machine-id && echo "" > /var/lib/dbus/machine-id && \ sed -i -e 's/^AcceptEnv LANG LC_\*$/#AcceptEnv LANG LC_*/' /etc/ssh/sshd_config && \ diff --git a/images/x86_64/amazonlinux2022/5.15/Dockerfile b/images/x86_64/amazonlinux2022/5.15/Dockerfile index cb9013e..ca82521 100644 --- a/images/x86_64/amazonlinux2022/5.15/Dockerfile +++ b/images/x86_64/amazonlinux2022/5.15/Dockerfile @@ -25,8 +25,6 @@ RUN dnf groupinstall -y 'Development Tools' && \ xargs -I@ curl -Lo headers.rpm ${URL}@ && \ grep -E 'kernel-devel-'${VERSION}'.*.rpm' primary.xml | grep href | cut -d\" -f2 | \ xargs -I@ curl -Lo sources.rpm ${URL}@ && \ - grep -E 'bpftool-'${VERSION}'.*.rpm' primary.xml | grep href | cut -d\" -f2 | \ - xargs -I@ curl -Lo bpftool.rpm ${URL}@ && \ dnf install -y ./*.rpm && \ rm -vf ./*.rpm && \ dnf clean all && \ diff --git a/images/x86_64/amazonlinux2023/6.1/Dockerfile b/images/x86_64/amazonlinux2023/6.1/Dockerfile index 82694e4..c8759be 100644 --- a/images/x86_64/amazonlinux2023/6.1/Dockerfile +++ b/images/x86_64/amazonlinux2023/6.1/Dockerfile @@ -25,10 +25,8 @@ RUN dnf groupinstall -y 'Development Tools' && \ xargs -I@ curl -Lo headers.rpm ${URL}@ && \ grep -E 'kernel-devel-'${VERSION}'.*.rpm' primary.xml | grep href | cut -d\" -f2 | \ xargs -I@ curl -Lo sources.rpm ${URL}@ && \ - grep -E 'bpftool-'${VERSION}'.*.rpm' primary.xml | grep href | cut -d\" -f2 | \ - xargs -I@ curl -Lo bpftool.rpm ${URL}@ && \ - dnf install -y ./headers.rpm ./bpftool.rpm ./sources.rpm && \ - rm -vf ./headers.rpm ./bpftool.rpm ./sources.rpm && \ + dnf install -y ./headers.rpm ./sources.rpm && \ + rm -vf ./headers.rpm ./sources.rpm && \ dnf clean all && \ rm -rf /var/cache/yum && \ mkdir -p /lib/modules/6.1.34-58.102.amzn2023.x86_64/ && \ diff --git a/images/x86_64/archlinux/5.18/Dockerfile b/images/x86_64/archlinux/5.18/Dockerfile index d783ff0..9245a76 100644 --- a/images/x86_64/archlinux/5.18/Dockerfile +++ b/images/x86_64/archlinux/5.18/Dockerfile @@ -5,7 +5,6 @@ WORKDIR /home/ubuntu RUN echo 'Server=https://archive.archlinux.org/repos/2022/08/04/$repo/os/$arch' > /etc/pacman.d/mirrorlist && \ pacman -Syyu --noconfirm && \ pacman -S --noconfirm \ - bpf \ clang \ cmake \ gcc \ diff --git a/images/x86_64/archlinux/6.0/Dockerfile b/images/x86_64/archlinux/6.0/Dockerfile index dd9b49e..9211a0c 100644 --- a/images/x86_64/archlinux/6.0/Dockerfile +++ b/images/x86_64/archlinux/6.0/Dockerfile @@ -20,10 +20,8 @@ RUN pacman -Syyu --noconfirm && \ wget && \ yes | pacman -Scc && \ curl -Lo headers.tar.zst ${URL}/l/linux-headers/linux-headers-${VERSION}-x86_64.pkg.tar.zst && \ - curl -Lo bpf.tar.zst ${URL}/b/bpf/bpf-6.0-2-x86_64.pkg.tar.zst && \ pacman -U --noconfirm ./headers.tar.zst && \ - pacman -U --noconfirm ./bpf.tar.zst && \ - rm -v ./headers.tar.zst ./bpf.tar.zst && \ + rm -v ./headers.tar.zst && \ ln -sf /usr/share/zoneinfo/US/Eastern /etc/localtime && \ echo 'LANG=en_US.UTF-8' > /etc/locale.gen && \ locale-gen && \ diff --git a/images/x86_64/centos/5.14/Dockerfile b/images/x86_64/centos/5.14/Dockerfile index 43db49b..134d1ae 100644 --- a/images/x86_64/centos/5.14/Dockerfile +++ b/images/x86_64/centos/5.14/Dockerfile @@ -17,7 +17,6 @@ RUN dnf groupinstall -y 'Development Tools' && \ rsync \ systemd && \ curl -Lo headers.rpm ${APPSTR_URL}/kernel-devel-${VERSION}.el9.x86_64.rpm && \ - curl -Lo bpftool.rpm ${BASEOS_URL}/bpftool-7.1.0-325.el9.x86_64.rpm && \ dnf install -y ./*.rpm && \ rm -v ./*.rpm && \ mkdir -p /lib/modules/${VERSION}.el9.x86_64/ && \ diff --git a/images/x86_64/fedora/5.17/Dockerfile b/images/x86_64/fedora/5.17/Dockerfile index 90e4ae2..97b434d 100644 --- a/images/x86_64/fedora/5.17/Dockerfile +++ b/images/x86_64/fedora/5.17/Dockerfile @@ -14,7 +14,6 @@ RUN dnf groupinstall -y 'Development Tools' && \ openssh-server \ rsync \ systemd && \ - curl -Lo bpftool.rpm ${URL}/b/bpftool-${HVERSION}.fc36.x86_64.rpm && \ curl -Lo sources.rpm ${URL}/k/kernel-devel-${VERSION}.fc36.x86_64.rpm && \ curl -Lo headers.rpm ${URL}/k/kernel-headers-${HVERSION}.fc36.x86_64.rpm && \ dnf install -y ./*.rpm && \ diff --git a/images/x86_64/fedora/5.8/Dockerfile b/images/x86_64/fedora/5.8/Dockerfile index 5674c76..5149c7a 100644 --- a/images/x86_64/fedora/5.8/Dockerfile +++ b/images/x86_64/fedora/5.8/Dockerfile @@ -14,7 +14,6 @@ RUN dnf groupinstall -y 'Development Tools' && \ openssh-server \ rsync \ systemd && \ - curl -Lo bpftool.rpm ${URL}/b/bpftool-${HVERSION}.fc33.x86_64.rpm && \ curl -Lo sources.rpm ${URL}/k/kernel-devel-${VERSION}.fc33.x86_64.rpm && \ curl -Lo headers.rpm ${URL}/k/kernel-headers-${HVERSION}.fc33.x86_64.rpm && \ dnf install -y ./*.rpm && \ diff --git a/images/x86_64/fedora/6.2/Dockerfile b/images/x86_64/fedora/6.2/Dockerfile index 53c71ac..ebff9f2 100644 --- a/images/x86_64/fedora/6.2/Dockerfile +++ b/images/x86_64/fedora/6.2/Dockerfile @@ -14,7 +14,6 @@ RUN dnf groupinstall -y 'Development Tools' && \ openssh-server \ rsync \ systemd && \ - curl -Lo bpftool.rpm ${URL}/b/bpftool-${HVERSION}.fc38.x86_64.rpm && \ curl -Lo sources.rpm ${URL}/k/kernel-devel-${VERSION}.fc38.x86_64.rpm && \ curl -Lo headers.rpm ${URL}/k/kernel-headers-${HVERSION}.fc38.x86_64.rpm && \ dnf install -y ./*.rpm && \ diff --git a/images/x86_64/oraclelinux/5.15/Dockerfile b/images/x86_64/oraclelinux/5.15/Dockerfile index 76c28a2..d79f42a 100644 --- a/images/x86_64/oraclelinux/5.15/Dockerfile +++ b/images/x86_64/oraclelinux/5.15/Dockerfile @@ -20,7 +20,6 @@ RUN yum install -y \ curl -Lo kernel.rpm ${URL}/getPackage/kernel-uek-core-${VERSION}.el9uek.x86_64.rpm && \ curl -Lo devel.rpm ${URL}/getPackage/kernel-uek-devel-${VERSION}.el9uek.x86_64.rpm && \ curl -Lo modules.rpm ${URL}/getPackage/kernel-uek-modules-${VERSION}.el9uek.x86_64.rpm && \ - curl -Lo bpftool.rpm ${URL}/getPackage/bpftool-${VERSION}.el9uek.x86_64.rpm && \ yum install -y ./*.rpm && \ rm -f ./*.rpm && \ sed -i -e 's/^AcceptEnv LANG LC_\*$/#AcceptEnv LANG LC_*/' /etc/ssh/sshd_config && \ From fbc1de8530d21aed15ddda207ce63a0578bd1809 Mon Sep 17 00:00:00 2001 From: Federico Di Pierro Date: Tue, 30 Jan 2024 11:38:27 +0100 Subject: [PATCH 03/17] fix(images): fixed arch 5.18 kernel image dockerfile. Signed-off-by: Federico Di Pierro --- images/x86_64/archlinux/5.18/Dockerfile.kernel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images/x86_64/archlinux/5.18/Dockerfile.kernel b/images/x86_64/archlinux/5.18/Dockerfile.kernel index 40cf0c5..a7fe33a 100644 --- a/images/x86_64/archlinux/5.18/Dockerfile.kernel +++ b/images/x86_64/archlinux/5.18/Dockerfile.kernel @@ -4,7 +4,7 @@ ARG ARCH FROM initrd-builder:0.0.1 AS builder -ARG VERSION=linux-5.18.16.arch1-1 +ARG VERSION=5.18.16.arch1-1 ARG URL='https://archive.archlinux.org/packages/l' ARG ARCH=x86_64 From cf0b95668e9e12cdfafcd7e194fe8bcb3d5656e0 Mon Sep 17 00:00:00 2001 From: Federico Di Pierro Date: Tue, 30 Jan 2024 11:50:56 +0100 Subject: [PATCH 04/17] chore(ci,images): properly error out if some build failed. Signed-off-by: Federico Di Pierro --- .github/workflows/main.yml | 9 ++++++ images/Makefile | 64 +++++++++++++++++++------------------- 2 files changed, 41 insertions(+), 32 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b25e7f8..d892125 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,6 +16,7 @@ concurrency: cancel-in-progress: true jobs: + # Job responsible to test the build of the images and, only on main CI, to push them too. push-images: strategy: fail-fast: false @@ -42,7 +43,15 @@ jobs: - name: Build images working-directory: ./images run: | + touch failed.txt make build-all + - name: Check failures + working-directory: ./images + run: | + if [ -s failed.txt ]; then + cat failed.txt + exit 1; + fi diff --git a/images/Makefile b/images/Makefile index 9020d7a..49d9c6f 100644 --- a/images/Makefile +++ b/images/Makefile @@ -11,7 +11,7 @@ builder: echo "Dry run: Building builder image: docker build -t $(REPOSITORY)/builder:0.0.1-$(ARCH) builder"; \ else \ echo "Building modernprobe-builder image"; \ - docker build -t $(REPOSITORY)/builder:0.0.1-$(ARCH) builder; \ + docker build -t $(REPOSITORY)/builder:0.0.1-$(ARCH) builder || echo "FAIL: builder" >> failed.txt; \ if [ "$(PUSH)" = "true" ]; then \ echo "Pushing image: $(REPOSITORY)/builder:0.0.1-$(ARCH)"; \ docker push $(REPOSITORY)/builder:0.0.1-$(ARCH); \ @@ -23,7 +23,7 @@ modernprobe-builder: echo "Dry run: Building modernprobe-builder image: docker build -t $(REPOSITORY)/modernprobe-builder:0.0.1-$(ARCH) modernprobe-builder"; \ else \ echo "Building modernprobe-builder image"; \ - docker build -t $(REPOSITORY)/modernprobe-builder:0.0.1-$(ARCH) modernprobe-builder; \ + docker build -t $(REPOSITORY)/modernprobe-builder:0.0.1-$(ARCH) modernprobe-builder || echo "FAIL: modernprobe-builder" >> failed.txt; \ if [ "$(PUSH)" = "true" ]; then \ echo "Pushing image: $(REPOSITORY)/modernprobe-builder:0.0.1-$(ARCH)"; \ docker push $(REPOSITORY)/modernprobe-builder:0.0.1-$(ARCH); \ @@ -35,7 +35,7 @@ initrd-builder: echo "Dry run: Building initrd-builder image: docker build -t initrd-builder:0.0.1 initrd-builder"; \ else \ echo "Building initrd-builder image"; \ - docker build -t initrd-builder:0.0.1 initrd-builder; \ + docker build -t initrd-builder:0.0.1 initrd-builder || echo "FAIL: initrd-builder" >> failed.txt; \ fi build-rootfs: @@ -47,7 +47,7 @@ build-rootfs: echo "Dry run: Building rootfs image: docker build -t $$image $$rootfs_dir"; \ else \ echo "Building rootfs image: $$image"; \ - docker build -t $$image $$rootfs_dir; \ + docker build -t $$image $$rootfs_dir || echo "FAIL: $$image" >> failed.txt; \ if [ "$(PUSH)" = "true" ]; then \ echo "Pushing image: $$image"; \ docker push $$image; \ @@ -66,7 +66,7 @@ build-kernel: initrd-builder echo "Dry run: Building kernel image: docker build -t $$image -f $$kernel_dir/Dockerfile.kernel $$kernel_dir"; \ else \ echo "Building kernel image: $$image"; \ - docker build -t $$image -f $$kernel_dir/Dockerfile.kernel $$kernel_dir; \ + docker build -t $$image -f $$kernel_dir/Dockerfile.kernel $$kernel_dir || echo "FAIL: $$image" >> failed.txt; \ if [ "$(PUSH)" = "true" ]; then \ echo "Pushing image: $$image"; \ docker push $$image; \ @@ -78,36 +78,36 @@ build-kernel: initrd-builder %: initrd-builder @version=$$(basename $@); \ - distro=$$(basename $$(dirname $@)); \ - arch=$(ARCH); \ - rootfs_dir=$$(find . -type d -path "./$$arch/$$distro/$$version"); \ - kernel_dir=$$(find . -type d -path "./$$arch/$$distro/$$version"); \ - rootfs_image=$(REPOSITORY)/$$distro-image:$$version-$$arch; \ - kernel_image=$(REPOSITORY)/$$distro-kernel:$$version-$$arch; \ - if [ -n "$$rootfs_dir" ]; then \ - if [ "$(DRY_RUN)" = "true" ]; then \ - echo "Dry run: Building rootfs image: docker build -t $$rootfs_image $$rootfs_dir"; \ - else \ - echo "Building rootfs image: $$rootfs_image"; \ - docker build -t $$rootfs_image $$rootfs_dir; \ - if [ "$(PUSH)" = "true" ]; then \ - echo "Pushing image: $$rootfs_image"; \ - docker push $$rootfs_image; \ - fi; \ + distro=$$(basename $$(dirname $@)); \ + arch=$(ARCH); \ + rootfs_dir=$$(find . -type d -path "./$$arch/$$distro/$$version"); \ + kernel_dir=$$(find . -type d -path "./$$arch/$$distro/$$version"); \ + rootfs_image=$(REPOSITORY)/$$distro-image:$$version-$$arch; \ + kernel_image=$(REPOSITORY)/$$distro-kernel:$$version-$$arch; \ + if [ -n "$$rootfs_dir" ]; then \ + if [ "$(DRY_RUN)" = "true" ]; then \ + echo "Dry run: Building rootfs image: docker build -t $$rootfs_image $$rootfs_dir"; \ + else \ + echo "Building rootfs image: $$rootfs_image"; \ + docker build -t $$rootfs_image $$rootfs_dir; \ + if [ "$(PUSH)" = "true" ]; then \ + echo "Pushing image: $$rootfs_image"; \ + docker push $$rootfs_image; \ fi; \ fi; \ - if [ -n "$$kernel_dir" ]; then \ - if [ "$(DRY_RUN)" = "true" ]; then \ - echo "Dry run: Building kernel image: docker build -t $$kernel_image -f $$kernel_dir/Dockerfile.kernel $$kernel_dir"; \ - else \ - echo "Building kernel image: $$kernel_image"; \ - docker build -t $$kernel_image -f $$kernel_dir/Dockerfile.kernel $$kernel_dir; \ - if [ "$(PUSH)" = "true" ]; then \ - echo "Pushing image: $$kernel_image"; \ - docker push $$kernel_image; \ - fi; \ + fi; \ + if [ -n "$$kernel_dir" ]; then \ + if [ "$(DRY_RUN)" = "true" ]; then \ + echo "Dry run: Building kernel image: docker build -t $$kernel_image -f $$kernel_dir/Dockerfile.kernel $$kernel_dir"; \ + else \ + echo "Building kernel image: $$kernel_image"; \ + docker build -t $$kernel_image -f $$kernel_dir/Dockerfile.kernel $$kernel_dir; \ + if [ "$(PUSH)" = "true" ]; then \ + echo "Pushing image: $$kernel_image"; \ + docker push $$kernel_image; \ fi; \ - fi; + fi; \ + fi; generate-yaml: @echo "machines:" > $(YAML_FILE) From 537bf9f4249534acf3ad49b22d73e90b4f07f90f Mon Sep 17 00:00:00 2001 From: Federico Di Pierro Date: Tue, 30 Jan 2024 15:04:30 +0100 Subject: [PATCH 05/17] fix(images,ci): fixed amd64 images build. Signed-off-by: Federico Di Pierro --- .github/workflows/main.yml | 2 +- images/x86_64/archlinux/5.18/Dockerfile | 4 ++-- images/x86_64/centos/4.18/Dockerfile | 2 +- images/x86_64/centos/4.18/Dockerfile.kernel | 2 +- images/x86_64/centos/5.14/Dockerfile | 3 +-- images/x86_64/centos/5.14/Dockerfile.kernel | 2 +- images/x86_64/fedora/5.17/Dockerfile | 2 +- images/x86_64/ubuntu/6.2/Dockerfile | 2 +- images/x86_64/ubuntu/6.2/Dockerfile.kernel | 2 +- images/x86_64/ubuntu/{6.3 => 6.5}/Dockerfile | 2 +- images/x86_64/ubuntu/{6.3 => 6.5}/Dockerfile.kernel | 2 +- 11 files changed, 12 insertions(+), 13 deletions(-) rename images/x86_64/ubuntu/{6.3 => 6.5}/Dockerfile (97%) rename images/x86_64/ubuntu/{6.3 => 6.5}/Dockerfile.kernel (95%) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d892125..e62a697 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -21,7 +21,7 @@ jobs: strategy: fail-fast: false matrix: - architecture: [amd64, arm64] + arch: [amd64, arm64] runs-on: ${{ (matrix.arch == 'arm64' && 'actuated-arm64-8cpu-16gb') || 'ubuntu-22.04' }} steps: - name: Checkout repo diff --git a/images/x86_64/archlinux/5.18/Dockerfile b/images/x86_64/archlinux/5.18/Dockerfile index 9245a76..deebaf7 100644 --- a/images/x86_64/archlinux/5.18/Dockerfile +++ b/images/x86_64/archlinux/5.18/Dockerfile @@ -1,8 +1,8 @@ -FROM archlinux:base +FROM archlinux:base-20220807.0.72894 WORKDIR /home/ubuntu -RUN echo 'Server=https://archive.archlinux.org/repos/2022/08/04/$repo/os/$arch' > /etc/pacman.d/mirrorlist && \ +RUN printf 'SigLevel = Never\nServer=https://archive.archlinux.org/repos/2022/08/04/$repo/os/$arch' > /etc/pacman.d/mirrorlist && \ pacman -Syyu --noconfirm && \ pacman -S --noconfirm \ clang \ diff --git a/images/x86_64/centos/4.18/Dockerfile b/images/x86_64/centos/4.18/Dockerfile index 6959df5..4ee9eb0 100644 --- a/images/x86_64/centos/4.18/Dockerfile +++ b/images/x86_64/centos/4.18/Dockerfile @@ -1,6 +1,6 @@ FROM quay.io/centos/centos:stream8 -ARG VERSION=4.18.0-497 +ARG VERSION=4.18.0-536 ARG BASEOS_URL='http://mirror.centos.org/centos/8-stream/BaseOS/x86_64/os/Packages' RUN dnf groupinstall -y 'Development Tools' && \ diff --git a/images/x86_64/centos/4.18/Dockerfile.kernel b/images/x86_64/centos/4.18/Dockerfile.kernel index 6576487..765194e 100644 --- a/images/x86_64/centos/4.18/Dockerfile.kernel +++ b/images/x86_64/centos/4.18/Dockerfile.kernel @@ -1,4 +1,4 @@ -ARG VERSION=4.18.0-497 +ARG VERSION=4.18.0-536 ARG BASEOS_URL='http://mirror.centos.org/centos/8-stream/BaseOS/x86_64/os/Packages' ARG ARCH=x86_64 diff --git a/images/x86_64/centos/5.14/Dockerfile b/images/x86_64/centos/5.14/Dockerfile index 134d1ae..8b0aed1 100644 --- a/images/x86_64/centos/5.14/Dockerfile +++ b/images/x86_64/centos/5.14/Dockerfile @@ -1,7 +1,6 @@ FROM quay.io/centos/centos:stream9 -ARG VERSION=5.14.0-325 -ARG BASEOS_URL='https://mirror.stream.centos.org/9-stream/BaseOS/x86_64/os/Packages' +ARG VERSION=5.14.0-412 ARG APPSTR_URL='http://mirror.stream.centos.org/9-stream/AppStream/x86_64/os/Packages' RUN dnf groupinstall -y 'Development Tools' && \ diff --git a/images/x86_64/centos/5.14/Dockerfile.kernel b/images/x86_64/centos/5.14/Dockerfile.kernel index a02ff8d..13c628f 100644 --- a/images/x86_64/centos/5.14/Dockerfile.kernel +++ b/images/x86_64/centos/5.14/Dockerfile.kernel @@ -1,4 +1,4 @@ -ARG VERSION=5.14.0-325 +ARG VERSION=5.14.0-412 ARG BASEOS_URL='https://mirror.stream.centos.org/9-stream/BaseOS/x86_64/os/Packages' ARG APPSTR_URL='http://mirror.stream.centos.org/9-stream/AppStream/x86_64/os/Packages' ARG ARCH=x86_64 diff --git a/images/x86_64/fedora/5.17/Dockerfile b/images/x86_64/fedora/5.17/Dockerfile index 97b434d..6b677f1 100644 --- a/images/x86_64/fedora/5.17/Dockerfile +++ b/images/x86_64/fedora/5.17/Dockerfile @@ -2,7 +2,7 @@ FROM fedora:36 ARG VERSION=5.17.5-300 ARG HVERSION=5.17.0-300 -ARG URL='https://mirrors.kernel.org/fedora/releases/36/Everything/x86_64/os/Packages' +ARG URL='https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/36/Everything/x86_64/os/Packages' RUN dnf groupinstall -y 'Development Tools' && \ dnf install -y \ diff --git a/images/x86_64/ubuntu/6.2/Dockerfile b/images/x86_64/ubuntu/6.2/Dockerfile index e6c17c0..911d635 100644 --- a/images/x86_64/ubuntu/6.2/Dockerfile +++ b/images/x86_64/ubuntu/6.2/Dockerfile @@ -1,6 +1,6 @@ FROM ubuntu:22.04 -ARG VERSION=6.2.0-26-generic +ARG VERSION=6.2.0-41-generic WORKDIR /home/ubuntu diff --git a/images/x86_64/ubuntu/6.2/Dockerfile.kernel b/images/x86_64/ubuntu/6.2/Dockerfile.kernel index da1aa91..577119f 100644 --- a/images/x86_64/ubuntu/6.2/Dockerfile.kernel +++ b/images/x86_64/ubuntu/6.2/Dockerfile.kernel @@ -1,6 +1,6 @@ FROM initrd-builder:0.0.1 AS builder -ARG VERSION=6.2.0-26-generic +ARG VERSION=6.2.0-41-generic ARG URL='http://mirrors.edge.kernel.org/ubuntu/pool/main/l/linux/' WORKDIR /home/ubuntu diff --git a/images/x86_64/ubuntu/6.3/Dockerfile b/images/x86_64/ubuntu/6.5/Dockerfile similarity index 97% rename from images/x86_64/ubuntu/6.3/Dockerfile rename to images/x86_64/ubuntu/6.5/Dockerfile index d13298b..65bf1e8 100644 --- a/images/x86_64/ubuntu/6.3/Dockerfile +++ b/images/x86_64/ubuntu/6.5/Dockerfile @@ -1,6 +1,6 @@ FROM ubuntu:23.04 -ARG VERSION=6.3.0-7 +ARG VERSION=6.5.0-17 ARG URL='http://mirrors.edge.kernel.org/ubuntu/pool/main/l/linux/' WORKDIR /home/ubuntu diff --git a/images/x86_64/ubuntu/6.3/Dockerfile.kernel b/images/x86_64/ubuntu/6.5/Dockerfile.kernel similarity index 95% rename from images/x86_64/ubuntu/6.3/Dockerfile.kernel rename to images/x86_64/ubuntu/6.5/Dockerfile.kernel index c76907b..780f8d2 100644 --- a/images/x86_64/ubuntu/6.3/Dockerfile.kernel +++ b/images/x86_64/ubuntu/6.5/Dockerfile.kernel @@ -1,6 +1,6 @@ FROM initrd-builder:0.0.1 AS builder -ARG VERSION=6.3.0-7-generic +ARG VERSION=6.5.0-17-generic ARG URL='http://mirrors.edge.kernel.org/ubuntu/pool/main/l/linux/' WORKDIR /home/ubuntu From 1c765c5fca76b9f1eef3bb41430dd0a44e33d42c Mon Sep 17 00:00:00 2001 From: Federico Di Pierro Date: Tue, 30 Jan 2024 15:25:31 +0100 Subject: [PATCH 06/17] chore(ansible-playbooks): use correct weaveworks/ignite-kernel for x86_64 centos builder. Signed-off-by: Federico Di Pierro --- ansible-playbooks/group_vars/all/vars.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible-playbooks/group_vars/all/vars.yml b/ansible-playbooks/group_vars/all/vars.yml index b6fac76..8dc3aeb 100644 --- a/ansible-playbooks/group_vars/all/vars.yml +++ b/ansible-playbooks/group_vars/all/vars.yml @@ -43,7 +43,7 @@ machines: - {name: "ubuntu-6.3", kernel: "therealbobo/ubuntu-kernel:6.3-aarch64", rootfs: "therealbobo/ubuntu-image:6.3-aarch64", arch: "aarch64"} builders: - - {name: "centos-builder", kernel: "therealbobo/centos-kernel:5.14-x86_64", rootfs: "therealbobo/builder:0.0.1-x86_64", arch: "x86_64"} + - {name: "centos-builder", kernel: "weaveworks/ignite-kernel:5.14.16", rootfs: "therealbobo/builder:0.0.1-x86_64", arch: "x86_64"} - {name: "fedora-builder", kernel: "weaveworks/ignite-kernel:5.14.16", rootfs: "therealbobo/modernprobe-builder:0.0.1-x86_64", arch: "x86_64"} - {name: "centos-builder", kernel: "weaveworks/ignite-kernel:5.14.16", rootfs: "therealbobo/builder:0.0.1-aarch64", arch: "aarch64"} - {name: "fedora-builder", kernel: "weaveworks/ignite-kernel:5.14.16", rootfs: "therealbobo/modernprobe-builder:0.0.1-aarch64", arch: "aarch64"} From 882791d83bdd3af5c45678dd1fdcf39905eff877 Mon Sep 17 00:00:00 2001 From: Federico Di Pierro Date: Tue, 30 Jan 2024 15:39:05 +0100 Subject: [PATCH 07/17] chore(images): bump ubuntu arm64 images to kernel 6.5 since 6.3 is no more distributed. Signed-off-by: Federico Di Pierro --- images/aarch64/ubuntu/{6.3 => 6.5}/Dockerfile | 2 +- images/aarch64/ubuntu/{6.3 => 6.5}/Dockerfile.kernel | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename images/aarch64/ubuntu/{6.3 => 6.5}/Dockerfile (98%) rename images/aarch64/ubuntu/{6.3 => 6.5}/Dockerfile.kernel (97%) diff --git a/images/aarch64/ubuntu/6.3/Dockerfile b/images/aarch64/ubuntu/6.5/Dockerfile similarity index 98% rename from images/aarch64/ubuntu/6.3/Dockerfile rename to images/aarch64/ubuntu/6.5/Dockerfile index a755354..988d67d 100644 --- a/images/aarch64/ubuntu/6.3/Dockerfile +++ b/images/aarch64/ubuntu/6.5/Dockerfile @@ -1,6 +1,6 @@ FROM ubuntu:23.04 -ARG VERSION=6.3.0-7 +ARG VERSION=6.5.0-17 ARG URL='http://ports.ubuntu.com/ubuntu-ports/pool/main/l/linux/' WORKDIR /home/ubuntu diff --git a/images/aarch64/ubuntu/6.3/Dockerfile.kernel b/images/aarch64/ubuntu/6.5/Dockerfile.kernel similarity index 97% rename from images/aarch64/ubuntu/6.3/Dockerfile.kernel rename to images/aarch64/ubuntu/6.5/Dockerfile.kernel index 24c94d5..10448f5 100644 --- a/images/aarch64/ubuntu/6.3/Dockerfile.kernel +++ b/images/aarch64/ubuntu/6.5/Dockerfile.kernel @@ -1,6 +1,6 @@ FROM initrd-builder:0.0.1 AS builder -ARG VERSION=6.3.0-7-generic +ARG VERSION=6.5.0-17-generic ARG URL='http://ports.ubuntu.com/ubuntu-ports/pool/main/l/linux/' WORKDIR /home/ubuntu From edb1f03b84ff2207ee1337581a5cd98b62546b87 Mon Sep 17 00:00:00 2001 From: Federico Di Pierro Date: Tue, 30 Jan 2024 16:18:18 +0100 Subject: [PATCH 08/17] chore(ci,ansible,images): properly use image tag. Moreover, added a reusable workflow to build and eventually push images. Images makefile does now support pushing tagged and latest images too now. Signed-off-by: Federico Di Pierro --- .github/workflows/ansible-lint.yml | 26 ++++---- .github/workflows/main.yml | 53 +++------------- .github/workflows/pr.yml | 20 ++++++ .github/workflows/release.yml | 17 +++++ .github/workflows/reusable_build_images.yml | 69 +++++++++++++++++++++ ansible-playbooks/group_vars/all/vars.yml | 61 +++++++++--------- images/Makefile | 67 ++++++++++++++------ 7 files changed, 205 insertions(+), 108 deletions(-) create mode 100644 .github/workflows/pr.yml create mode 100644 .github/workflows/release.yml create mode 100644 .github/workflows/reusable_build_images.yml diff --git a/.github/workflows/ansible-lint.yml b/.github/workflows/ansible-lint.yml index d73cb84..a2d9cc6 100644 --- a/.github/workflows/ansible-lint.yml +++ b/.github/workflows/ansible-lint.yml @@ -1,20 +1,18 @@ name: ansible-lint on: - pull_request: + pull_request: jobs: - build: - name: Ansible Lint - runs-on: ubuntu-latest + build: + name: Ansible Lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 + with: + fetch-depth: 0 - steps: - - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 - with: - fetch-depth: 0 - - - name: Run ansible-lint - # replace `main` with any valid ref, or tags like `v6` - uses: ansible/ansible-lint-action@v6.3.0 # the latest version has a bug that does not run in online mode - with: - path: "ansible-playbooks/" + - name: Run ansible-lint + uses: ansible/ansible-lint-action@v6.3.0 # the latest version has a bug that does not run in online mode + with: + path: "ansible-playbooks/" diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e62a697..d918deb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,10 +1,5 @@ -name: Build and Push docker images +name: Main CI on: - pull_request: - branches: - - main - paths: - - 'images/**' push: branches: - main @@ -12,46 +7,14 @@ on: - 'images/**' concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + group: main_push_images cancel-in-progress: true jobs: - # Job responsible to test the build of the images and, only on main CI, to push them too. push-images: - strategy: - fail-fast: false - matrix: - arch: [amd64, arm64] - runs-on: ${{ (matrix.arch == 'arm64' && 'actuated-arm64-8cpu-16gb') || 'ubuntu-22.04' }} - steps: - - name: Checkout repo - uses: actions/checkout@v3 - - - name: Login to Github Packages - if: ${{ github.event_name == 'push' }} - uses: docker/login-action@v1 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Sets PUSH env var for main push - if: ${{ github.event_name == 'push' }} - run: | - echo "PUSH=true" >> $GITHUB_ENV - - - name: Build images - working-directory: ./images - run: | - touch failed.txt - make build-all - - - name: Check failures - working-directory: ./images - run: | - if [ -s failed.txt ]; then - cat failed.txt - exit 1; - fi - - + uses: ./.github/workflows/reusable_build_images.yml + with: + push: true + is_latest: false + version: 'main' + secrets: inherit diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 0000000..cb393a1 --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,20 @@ +name: PR CI +on: + pull_request: + branches: + - main + paths: + - 'images/**' + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + build-images: + uses: ./.github/workflows/reusable_build_images.yml + with: + push: false + is_latest: false + version: '${{ github.run_id }}' + secrets: inherit diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..84ef2b5 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,17 @@ +name: Release CI +on: + release: + types: [published] + +concurrency: + group: release_push_images + cancel-in-progress: true + +jobs: + release-images: + uses: ./.github/workflows/reusable_build_images.yml + with: + push: true + is_latest: true + version: ${{ github.event.release.tag_name }} + secrets: inherit diff --git a/.github/workflows/reusable_build_images.yml b/.github/workflows/reusable_build_images.yml new file mode 100644 index 0000000..0f49231 --- /dev/null +++ b/.github/workflows/reusable_build_images.yml @@ -0,0 +1,69 @@ +name: Build and Push docker images +on: + workflow_call: + inputs: + version: + description: 'docker images version to be built/tagged' + type: string + required: false + default: 'main' + push: + description: 'whether to push images or build only' + type: boolean + required: false + default: false + is_latest: + description: 'whether we need to also push latest images' + type: boolean + required: false + default: false + +jobs: + # Job responsible to test the build of the images and, only on main CI, to push them too. + build-images: + strategy: + fail-fast: false + matrix: + arch: [amd64, arm64] + runs-on: ${{ (matrix.arch == 'arm64' && 'actuated-arm64-8cpu-16gb') || 'ubuntu-22.04' }} + steps: + - name: Checkout repo + uses: actions/checkout@v3 + + - name: Login to Github Packages + if: inputs.push + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Set PUSH env var + if: inputs.push + run: | + echo "PUSH=true" >> $GITHUB_ENV + + - name: Set LATEST env var + if: inputs.is_latest + run: | + echo "LATEST=true" >> $GITHUB_ENV + + - name: Set TAG env var + run: | + echo "TAG=${{ inputs.version }}" >> $GITHUB_ENV + + - name: Build images + working-directory: ./images + run: | + touch failed.txt + make build-all + + - name: Check failures + working-directory: ./images + run: | + if [ -s failed.txt ]; then + cat failed.txt + exit 1; + fi + + diff --git a/ansible-playbooks/group_vars/all/vars.yml b/ansible-playbooks/group_vars/all/vars.yml index 8dc3aeb..aceb149 100644 --- a/ansible-playbooks/group_vars/all/vars.yml +++ b/ansible-playbooks/group_vars/all/vars.yml @@ -10,43 +10,46 @@ user: root # Machine Configuration # ######################### +# Images version to be used. +version: main + # Each machine entry requires the following fields # name: the name given to the vm; # kernel: reference to an OCI image containing a kernel; # rootfs: reference to an OCI image used as base rootfs for the vm. # arch: architecture of the kernel and base images. (x86_64/aarch64). machines: - - {name: "amazonlinux2022-5.15", kernel: "therealbobo/amazonlinux2022-kernel:5.15-x86_64", rootfs: "therealbobo/amazonlinux2022-image:5.15-x86_64", arch: "x86_64"} # noqa: yaml[line-length] - - {name: "amazonlinux2023-6.1", kernel: "therealbobo/amazonlinux2023-kernel:6.1-x86_64", rootfs: "therealbobo/amazonlinux2023-image:6.1-x86_64", arch: "x86_64"} # noqa: yaml[line-length] - - {name: "amazonlinux2-4.19", kernel: "therealbobo/amazonlinux2-kernel:4.19-x86_64", rootfs: "therealbobo/amazonlinux2-image:4.19-x86_64", arch: "x86_64"} - - {name: "amazonlinux2-5.10", kernel: "therealbobo/amazonlinux2-kernel:5.10-x86_64", rootfs: "therealbobo/amazonlinux2-image:5.10-x86_64", arch: "x86_64"} - - {name: "amazonlinux2-5.15", kernel: "therealbobo/amazonlinux2-kernel:5.15-x86_64", rootfs: "therealbobo/amazonlinux2-image:5.15-x86_64", arch: "x86_64"} - - {name: "amazonlinux2-5.4", kernel: "therealbobo/amazonlinux2-kernel:5.4-x86_64", rootfs: "therealbobo/amazonlinux2-image:5.4-x86_64", arch: "x86_64"} - - {name: "archlinux-6.0", kernel: "therealbobo/archlinux-kernel:6.0-x86_64", rootfs: "therealbobo/archlinux-image:6.0-x86_64", arch: "x86_64"} - - {name: "centos-3.10", kernel: "therealbobo/centos-kernel:3.10-x86_64", rootfs: "therealbobo/centos-image:3.10-x86_64", arch: "x86_64"} - - {name: "centos-4.18", kernel: "therealbobo/centos-kernel:4.18-x86_64", rootfs: "therealbobo/centos-image:4.18-x86_64", arch: "x86_64"} - - {name: "centos-5.14", kernel: "therealbobo/centos-kernel:5.14-x86_64", rootfs: "therealbobo/centos-image:5.14-x86_64", arch: "x86_64"} - - {name: "fedora-5.17", kernel: "therealbobo/fedora-kernel:5.17-x86_64", rootfs: "therealbobo/fedora-image:5.17-x86_64", arch: "x86_64"} - - {name: "fedora-5.8", kernel: "therealbobo/fedora-kernel:5.8-x86_64", rootfs: "therealbobo/fedora-image:5.8-x86_64", arch: "x86_64"} - - {name: "fedora-6.2", kernel: "therealbobo/fedora-kernel:6.2-x86_64", rootfs: "therealbobo/fedora-image:6.2-x86_64", arch: "x86_64"} - - {name: "oraclelinux-3.10", kernel: "therealbobo/oraclelinux-kernel:3.10-x86_64", rootfs: "therealbobo/oraclelinux-image:3.10-x86_64", arch: "x86_64"} - - {name: "oraclelinux-4.14", kernel: "therealbobo/oraclelinux-kernel:4.14-x86_64", rootfs: "therealbobo/oraclelinux-image:4.14-x86_64", arch: "x86_64"} - - {name: "oraclelinux-5.15", kernel: "therealbobo/oraclelinux-kernel:5.15-x86_64", rootfs: "therealbobo/oraclelinux-image:5.15-x86_64", arch: "x86_64"} - - {name: "oraclelinux-5.4", kernel: "therealbobo/oraclelinux-kernel:5.4-x86_64", rootfs: "therealbobo/oraclelinux-image:5.4-x86_64", arch: "x86_64"} - - {name: "ubuntu-4.15", kernel: "therealbobo/ubuntu-kernel:4.15-x86_64", rootfs: "therealbobo/ubuntu-image:4.15-x86_64", arch: "x86_64"} - - {name: "ubuntu-6.3", kernel: "therealbobo/ubuntu-kernel:6.3-x86_64", rootfs: "therealbobo/ubuntu-image:6.3-x86_64", arch: "x86_64"} - - {name: "amazonlinux2022-5.15", kernel: "therealbobo/amazonlinux2022-kernel:5.15-aarch64", rootfs: "therealbobo/amazonlinux2022-image:5.15-aarch64", arch: "aarch64"} # noqa: yaml[line-length] - - {name: "amazonlinux2-5.4", kernel: "therealbobo/amazonlinux2-kernel:5.4-aarch64", rootfs: "therealbobo/amazonlinux2-image:5.4-aarch64", arch: "aarch64"} - - {name: "fedora-6.2", kernel: "therealbobo/fedora-kernel:6.2-aarch64", rootfs: "therealbobo/fedora-image:6.2-aarch64", arch: "aarch64"} - - {name: "oraclelinux-4.14", kernel: "therealbobo/oraclelinux-kernel:4.14-aarch64", rootfs: "therealbobo/oraclelinux-image:4.14-aarch64", arch: "aarch64"} - - {name: "oraclelinux-5.15", kernel: "therealbobo/oraclelinux-kernel:5.15-aarch64", rootfs: "therealbobo/oraclelinux-image:5.15-aarch64", arch: "aarch64"} - - {name: "ubuntu-6.3", kernel: "therealbobo/ubuntu-kernel:6.3-aarch64", rootfs: "therealbobo/ubuntu-image:6.3-aarch64", arch: "aarch64"} + - {name: "amazonlinux2022-5.15", kernel: "therealbobo/amazonlinux2022-kernel:5.15-x86_64-{{ version }}", rootfs: "therealbobo/amazonlinux2022-image:5.15-x86_64-{{ version }}", arch: "x86_64"} # noqa: yaml[line-length] + - {name: "amazonlinux2023-6.1", kernel: "therealbobo/amazonlinux2023-kernel:6.1-x86_64-{{ version }}", rootfs: "therealbobo/amazonlinux2023-image:6.1-x86_64-{{ version }}", arch: "x86_64"} # noqa: yaml[line-length] + - {name: "amazonlinux2-4.19", kernel: "therealbobo/amazonlinux2-kernel:4.19-x86_64-{{ version }}", rootfs: "therealbobo/amazonlinux2-image:4.19-x86_64-{{ version }}", arch: "x86_64"} + - {name: "amazonlinux2-5.10", kernel: "therealbobo/amazonlinux2-kernel:5.10-x86_64-{{ version }}", rootfs: "therealbobo/amazonlinux2-image:5.10-x86_64-{{ version }}", arch: "x86_64"} + - {name: "amazonlinux2-5.15", kernel: "therealbobo/amazonlinux2-kernel:5.15-x86_64-{{ version }}", rootfs: "therealbobo/amazonlinux2-image:5.15-x86_64-{{ version }}", arch: "x86_64"} + - {name: "amazonlinux2-5.4", kernel: "therealbobo/amazonlinux2-kernel:5.4-x86_64-{{ version }}", rootfs: "therealbobo/amazonlinux2-image:5.4-x86_64-{{ version }}", arch: "x86_64"} + - {name: "archlinux-6.0", kernel: "therealbobo/archlinux-kernel:6.0-x86_64-{{ version }}", rootfs: "therealbobo/archlinux-image:6.0-x86_64-{{ version }}", arch: "x86_64"} + - {name: "centos-3.10", kernel: "therealbobo/centos-kernel:3.10-x86_64-{{ version }}", rootfs: "therealbobo/centos-image:3.10-x86_64-{{ version }}", arch: "x86_64"} + - {name: "centos-4.18", kernel: "therealbobo/centos-kernel:4.18-x86_64-{{ version }}", rootfs: "therealbobo/centos-image:4.18-x86_64-{{ version }}", arch: "x86_64"} + - {name: "centos-5.14", kernel: "therealbobo/centos-kernel:5.14-x86_64-{{ version }}", rootfs: "therealbobo/centos-image:5.14-x86_64-{{ version }}", arch: "x86_64"} + - {name: "fedora-5.17", kernel: "therealbobo/fedora-kernel:5.17-x86_64-{{ version }}", rootfs: "therealbobo/fedora-image:5.17-x86_64-{{ version }}", arch: "x86_64"} + - {name: "fedora-5.8", kernel: "therealbobo/fedora-kernel:5.8-x86_64-{{ version }}", rootfs: "therealbobo/fedora-image:5.8-x86_64-{{ version }}", arch: "x86_64"} + - {name: "fedora-6.2", kernel: "therealbobo/fedora-kernel:6.2-x86_64-{{ version }}", rootfs: "therealbobo/fedora-image:6.2-x86_64-{{ version }}", arch: "x86_64"} + - {name: "oraclelinux-3.10", kernel: "therealbobo/oraclelinux-kernel:3.10-x86_64-{{ version }}", rootfs: "therealbobo/oraclelinux-image:3.10-x86_64-{{ version }}", arch: "x86_64"} + - {name: "oraclelinux-4.14", kernel: "therealbobo/oraclelinux-kernel:4.14-x86_64-{{ version }}", rootfs: "therealbobo/oraclelinux-image:4.14-x86_64-{{ version }}", arch: "x86_64"} + - {name: "oraclelinux-5.15", kernel: "therealbobo/oraclelinux-kernel:5.15-x86_64-{{ version }}", rootfs: "therealbobo/oraclelinux-image:5.15-x86_64-{{ version }}", arch: "x86_64"} + - {name: "oraclelinux-5.4", kernel: "therealbobo/oraclelinux-kernel:5.4-x86_64-{{ version }}", rootfs: "therealbobo/oraclelinux-image:5.4-x86_64-{{ version }}", arch: "x86_64"} + - {name: "ubuntu-4.15", kernel: "therealbobo/ubuntu-kernel:4.15-x86_64-{{ version }}", rootfs: "therealbobo/ubuntu-image:4.15-x86_64-{{ version }}", arch: "x86_64"} + - {name: "ubuntu-6.3", kernel: "therealbobo/ubuntu-kernel:6.3-x86_64-{{ version }}", rootfs: "therealbobo/ubuntu-image:6.3-x86_64-{{ version }}", arch: "x86_64"} + - {name: "amazonlinux2022-5.15", kernel: "therealbobo/amazonlinux2022-kernel:5.15-aarch64-{{ version }}", rootfs: "therealbobo/amazonlinux2022-image:5.15-aarch64-{{ version }}", arch: "aarch64"} # noqa: yaml[line-length] + - {name: "amazonlinux2-5.4", kernel: "therealbobo/amazonlinux2-kernel:5.4-aarch64-{{ version }}", rootfs: "therealbobo/amazonlinux2-image:5.4-aarch64-{{ version }}", arch: "aarch64"} + - {name: "fedora-6.2", kernel: "therealbobo/fedora-kernel:6.2-aarch64-{{ version }}", rootfs: "therealbobo/fedora-image:6.2-aarch64-{{ version }}", arch: "aarch64"} + - {name: "oraclelinux-4.14", kernel: "therealbobo/oraclelinux-kernel:4.14-aarch64-{{ version }}", rootfs: "therealbobo/oraclelinux-image:4.14-aarch64-{{ version }}", arch: "aarch64"} + - {name: "oraclelinux-5.15", kernel: "therealbobo/oraclelinux-kernel:5.15-aarch64-{{ version }}", rootfs: "therealbobo/oraclelinux-image:5.15-aarch64-{{ version }}", arch: "aarch64"} + - {name: "ubuntu-6.3", kernel: "therealbobo/ubuntu-kernel:6.3-aarch64-{{ version }}", rootfs: "therealbobo/ubuntu-image:6.3-aarch64-{{ version }}", arch: "aarch64"} builders: - - {name: "centos-builder", kernel: "weaveworks/ignite-kernel:5.14.16", rootfs: "therealbobo/builder:0.0.1-x86_64", arch: "x86_64"} - - {name: "fedora-builder", kernel: "weaveworks/ignite-kernel:5.14.16", rootfs: "therealbobo/modernprobe-builder:0.0.1-x86_64", arch: "x86_64"} - - {name: "centos-builder", kernel: "weaveworks/ignite-kernel:5.14.16", rootfs: "therealbobo/builder:0.0.1-aarch64", arch: "aarch64"} - - {name: "fedora-builder", kernel: "weaveworks/ignite-kernel:5.14.16", rootfs: "therealbobo/modernprobe-builder:0.0.1-aarch64", arch: "aarch64"} + - {name: "centos-builder", kernel: "weaveworks/ignite-kernel:5.14.16", rootfs: "therealbobo/builder:0.0.1-x86_64-{{ version }}", arch: "x86_64"} + - {name: "fedora-builder", kernel: "weaveworks/ignite-kernel:5.14.16", rootfs: "therealbobo/modernprobe-builder:0.0.1-x86_64-{{ version }}", arch: "x86_64"} + - {name: "centos-builder", kernel: "weaveworks/ignite-kernel:5.14.16", rootfs: "therealbobo/builder:0.0.1-aarch64-{{ version }}", arch: "aarch64"} + - {name: "fedora-builder", kernel: "weaveworks/ignite-kernel:5.14.16", rootfs: "therealbobo/modernprobe-builder:0.0.1-aarch64-{{ version }}", arch: "aarch64"} output_dir: "~/ansible_output" # Number of cpus. diff --git a/images/Makefile b/images/Makefile index 49d9c6f..91365be 100644 --- a/images/Makefile +++ b/images/Makefile @@ -1,5 +1,7 @@ DRY_RUN := false PUSH := false +LATEST := false +TAG ?= main REPOSITORY := ghcr.io/falcosecurity/kernel-testing ARCH ?= $(shell uname -m) YAML_FILE := images.yaml @@ -8,28 +10,41 @@ YAML_FILE := images.yaml builder: if [ "$(DRY_RUN)" = "true" ]; then \ - echo "Dry run: Building builder image: docker build -t $(REPOSITORY)/builder:0.0.1-$(ARCH) builder"; \ + echo "Dry run: Building builder image: docker build -t $(REPOSITORY)/builder:$(ARCH)-$(TAG)"; \ else \ echo "Building modernprobe-builder image"; \ - docker build -t $(REPOSITORY)/builder:0.0.1-$(ARCH) builder || echo "FAIL: builder" >> failed.txt; \ + image=$(REPOSITORY)/builder:$(ARCH); \ + docker build -t $$image-$(TAG) builder || echo "FAIL: $$image-$(TAG)" >> failed.txt; \ if [ "$(PUSH)" = "true" ]; then \ - echo "Pushing image: $(REPOSITORY)/builder:0.0.1-$(ARCH)"; \ - docker push $(REPOSITORY)/builder:0.0.1-$(ARCH); \ + echo "Pushing image: $$image-$(TAG)"; \ + docker push $$image-$(TAG); \ + if [ "$(LATEST)" = "true" ]; then \ + echo "Pushing image: $$image-latest"; \ + docker tag $$image-$(TAG) $$image-latest; \ + docker push $$image-latest; \ + fi; \ fi; \ fi modernprobe-builder: if [ "$(DRY_RUN)" = "true" ]; then \ - echo "Dry run: Building modernprobe-builder image: docker build -t $(REPOSITORY)/modernprobe-builder:0.0.1-$(ARCH) modernprobe-builder"; \ + echo "Dry run: Building modernprobe-builder image: docker build -t $(REPOSITORY)/modernprobe-builder:$(TAG)-$(ARCH) modernprobe-builder"; \ else \ echo "Building modernprobe-builder image"; \ - docker build -t $(REPOSITORY)/modernprobe-builder:0.0.1-$(ARCH) modernprobe-builder || echo "FAIL: modernprobe-builder" >> failed.txt; \ + image=$(REPOSITORY)/modernprobe-builder:$(ARCH); \ + docker build -t $$image-$(TAG) modernprobe-builder || echo "FAIL: $$image-$(TAG)" >> failed.txt; \ if [ "$(PUSH)" = "true" ]; then \ - echo "Pushing image: $(REPOSITORY)/modernprobe-builder:0.0.1-$(ARCH)"; \ - docker push $(REPOSITORY)/modernprobe-builder:0.0.1-$(ARCH); \ + echo "Pushing image: $$image-$(TAG)"; \ + docker push $$image-$(TAG); \ + if [ "$(LATEST)" = "true" ]; then \ + echo "Pushing image: $$image-latest"; \ + docker tag $$image-$(TAG) $$image-latest; \ + docker push $$image-latest; \ + fi; \ fi; \ fi +# No need to push intrd-builder image; it is just used locally as base to other images. initrd-builder: if [ "$(DRY_RUN)" = "true" ]; then \ echo "Dry run: Building initrd-builder image: docker build -t initrd-builder:0.0.1 initrd-builder"; \ @@ -44,15 +59,21 @@ build-rootfs: distro=$$(basename $$(dirname $$rootfs_dir)); \ image=$(REPOSITORY)/$$distro-image:$$version-$(ARCH); \ if [ "$(DRY_RUN)" = "true" ]; then \ - echo "Dry run: Building rootfs image: docker build -t $$image $$rootfs_dir"; \ + echo "Dry run: Building rootfs image: docker build -t $$image-$(TAG) $$rootfs_dir"; \ else \ - echo "Building rootfs image: $$image"; \ - docker build -t $$image $$rootfs_dir || echo "FAIL: $$image" >> failed.txt; \ + echo "Building rootfs image: $$image-$(TAG)"; \ + docker build -t $$image-$(TAG) $$rootfs_dir || echo "FAIL: $$image-$(TAG)" >> failed.txt; \ if [ "$(PUSH)" = "true" ]; then \ - echo "Pushing image: $$image"; \ - docker push $$image; \ + echo "Pushing image: $$image-$(TAG)"; \ + docker push $$image-$(TAG); \ + if [ "$(LATEST)" = "true" ]; then \ + echo "Pushing image: $$image-latest"; \ + docker tag $$image-$(TAG) $$image-latest; \ + docker push $$image-latest; \ + fi; \ fi; \ - docker image rm -f $$image; \ + docker image rm -f $$image-$(TAG); \ + docker image rm -f $$image-latest; \ docker builder prune -f -a; \ fi; \ done @@ -63,15 +84,21 @@ build-kernel: initrd-builder distro=$$(basename $$(dirname $$kernel_dir)); \ image=$(REPOSITORY)/$$distro-kernel:$$version-$(ARCH); \ if [ "$(DRY_RUN)" = "true" ]; then \ - echo "Dry run: Building kernel image: docker build -t $$image -f $$kernel_dir/Dockerfile.kernel $$kernel_dir"; \ + echo "Dry run: Building kernel image: docker build -t $$image-$(TAG) -f $$kernel_dir/Dockerfile.kernel $$kernel_dir"; \ else \ - echo "Building kernel image: $$image"; \ - docker build -t $$image -f $$kernel_dir/Dockerfile.kernel $$kernel_dir || echo "FAIL: $$image" >> failed.txt; \ + echo "Building kernel image: $$image-$(TAG)"; \ + docker build -t $$image-$(TAG) -f $$kernel_dir/Dockerfile.kernel $$kernel_dir || echo "FAIL: $$image-$(TAG)" >> failed.txt; \ if [ "$(PUSH)" = "true" ]; then \ - echo "Pushing image: $$image"; \ - docker push $$image; \ + echo "Pushing image: $$image-$(TAG)"; \ + docker push $$image-$(TAG); \ + if [ "$(LATEST)" = "true" ]; then \ + echo "Pushing image: $$image-latest"; \ + docker tag $$image-$(TAG) $$image-latest; \ + docker push $$image-latest; \ + fi; \ fi; \ - docker image rm -f $$image; \ + docker image rm -f $$image-$(TAG); \ + docker image rm -f $$image-latest; \ docker builder prune -f -a; \ fi; \ done From f51cdc42c751162cec34e7929044a6e05f99fe38 Mon Sep 17 00:00:00 2001 From: Federico Di Pierro Date: Tue, 30 Jan 2024 17:15:52 +0100 Subject: [PATCH 09/17] chore(images/x86_64): try to fix remaining images. Signed-off-by: Federico Di Pierro --- images/x86_64/centos/4.18/Dockerfile.kernel | 2 +- images/x86_64/centos/5.14/Dockerfile.kernel | 2 +- .../x86_64/oraclelinux/2.6/Dockerfile.kernel | 43 +++++++++++-------- .../x86_64/oraclelinux/3.10/Dockerfile.kernel | 6 +-- .../x86_64/oraclelinux/4.14/Dockerfile.kernel | 2 +- .../x86_64/oraclelinux/5.15/Dockerfile.kernel | 2 +- .../x86_64/oraclelinux/5.4/Dockerfile.kernel | 2 +- images/x86_64/ubuntu/6.2/Dockerfile | 2 +- images/x86_64/ubuntu/6.2/Dockerfile.kernel | 2 +- 9 files changed, 35 insertions(+), 28 deletions(-) diff --git a/images/x86_64/centos/4.18/Dockerfile.kernel b/images/x86_64/centos/4.18/Dockerfile.kernel index 765194e..30a54ed 100644 --- a/images/x86_64/centos/4.18/Dockerfile.kernel +++ b/images/x86_64/centos/4.18/Dockerfile.kernel @@ -42,7 +42,7 @@ COPY --from=stage1 /opt/initrd-builder/* /opt/initrd-builder/ RUN dnf groupinstall -y 'Development Tools' && \ cp -v /opt/initrd-builder/Makefile.virtio_mmio Makefile && \ curl -LO 'https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-8/-/raw/c8s/drivers/virtio/virtio_mmio.c' && \ - KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/4.18.0-497.el8.x86_64" make + KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.el8.x86_64" make FROM initrd-builder:0.0.1 AS stage2 COPY --from=stage1 /home/ubuntu/extracted /home/ubuntu/extracted/ diff --git a/images/x86_64/centos/5.14/Dockerfile.kernel b/images/x86_64/centos/5.14/Dockerfile.kernel index 13c628f..326ab45 100644 --- a/images/x86_64/centos/5.14/Dockerfile.kernel +++ b/images/x86_64/centos/5.14/Dockerfile.kernel @@ -45,7 +45,7 @@ COPY --from=stage1 /opt/initrd-builder/* /opt/initrd-builder/ RUN dnf groupinstall -y 'Development Tools' && \ cp -v /opt/initrd-builder/Makefile.virtio_mmio Makefile && \ curl -LO 'https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/raw/main/drivers/virtio/virtio_mmio.c' && \ - KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/5.14.0-325.el9.x86_64" make + KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.el9.x86_64" make FROM initrd-builder:0.0.1 AS stage2 COPY --from=stage1 /home/ubuntu/extracted /home/ubuntu/extracted/ diff --git a/images/x86_64/oraclelinux/2.6/Dockerfile.kernel b/images/x86_64/oraclelinux/2.6/Dockerfile.kernel index 7137044..c91ee5e 100644 --- a/images/x86_64/oraclelinux/2.6/Dockerfile.kernel +++ b/images/x86_64/oraclelinux/2.6/Dockerfile.kernel @@ -1,8 +1,11 @@ -FROM initrd-builder:0.0.1 AS stage1 - ARG VERSION=2.6.39-400.330.1 ARG URL='https://yum.oracle.com/repo/OracleLinux/OL6/UEK/latest/x86_64' +FROM initrd-builder:0.0.1 AS stage1 + +ARG VERSION +ARG URL + WORKDIR /home/ubuntu RUN touch .placeholder && \ @@ -20,6 +23,9 @@ RUN touch .placeholder && \ FROM oraclelinux:7 as kmod-builder +ARG VERSION +ARG URL + WORKDIR /home/ubuntu COPY --from=stage1 /home/ubuntu/extracted /home/ubuntu/extracted/ COPY --from=stage1 /opt/initrd-builder/* /opt/initrd-builder/ @@ -30,24 +36,25 @@ RUN yum groupinstall -y 'Development Tools' && \ yum install -y gcc && \ mkdir src && \ cd src && \ - curl -Lo source.rpm 'https://oss.oracle.com/ol6/SRPMS-updates/kernel-uek-2.6.39-400.330.1.el6uek.src.rpm' && \ + curl -Lo source.rpm 'https://oss.oracle.com/ol6/SRPMS-updates/kernel-uek-${VERSION}.el6uek.src.rpm' && \ rpm2cpio source.rpm > source.cpio && \ cpio -idmv < ./source.cpio && \ - tar -xaf linux-2.6.39.tar.bz2 && \ + tar -xaf linux-2.6.*.tar.bz2 && \ cd .. && \ cp -v /opt/initrd-builder/Makefile.virtio_mmio Makefile && \ + find src -name virtio_mmio.c -exec cp -v {} . \; && \ sed -ie 's/virtio-mmio/my-virtio-mmio/g' virtio_mmio.c && \ - echo KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/2.6.39-400.330.1.el6uek.x86_64/" make > cmd - -#FROM initrd-builder:0.0.1 AS stage2 -# -#COPY --from=stage1 /home/ubuntu/extracted /home/ubuntu/extracted/ -#COPY --from=kmod-builder /home/ubuntu/virtio_mmio.ko /home/ubuntu/ -#RUN cd /home/ubuntu/extracted && \ -# /opt/initrd-builder/create.sh -# -#FROM scratch -# -#COPY --from=stage1 /home/ubuntu/extracted/vmlinux /boot/ -#COPY --from=stage2 /home/ubuntu/out/initrd /boot/ -#COPY --from=stage1 /home/ubuntu/.placeholder /lib/modules/ + echo KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.el6uek.x86_64/" make + +FROM initrd-builder:0.0.1 AS stage2 + +COPY --from=stage1 /home/ubuntu/extracted /home/ubuntu/extracted/ +COPY --from=kmod-builder /home/ubuntu/virtio_mmio.ko /home/ubuntu/ +RUN cd /home/ubuntu/extracted && \ + /opt/initrd-builder/create.sh + +FROM scratch + +COPY --from=stage1 /home/ubuntu/extracted/vmlinux /boot/ +COPY --from=stage2 /home/ubuntu/out/initrd /boot/ +COPY --from=stage1 /home/ubuntu/.placeholder /lib/modules/ diff --git a/images/x86_64/oraclelinux/3.10/Dockerfile.kernel b/images/x86_64/oraclelinux/3.10/Dockerfile.kernel index bdd3f9b..42a9e58 100644 --- a/images/x86_64/oraclelinux/3.10/Dockerfile.kernel +++ b/images/x86_64/oraclelinux/3.10/Dockerfile.kernel @@ -37,15 +37,15 @@ RUN yum groupinstall -y 'Development Tools' && \ yum install -y gcc elfutils-libelf-devel && \ mkdir src && \ cd src && \ - curl -Lo source.rpm 'https://oss.oracle.com/ol7/SRPMS-updates/kernel-3.10.0-1160.92.1.0.2.el7.src.rpm' && \ + curl -Lo source.rpm 'https://oss.oracle.com/ol7/SRPMS-updates/kernel-${VERSION}.el7.src.rpm' && \ rpm2cpio source.rpm > source.cpio && \ cpio -idmv < ./source.cpio && \ - tar -xaf linux-3.10.0-1160.92.1.el7.tar.xz && \ + tar -xaf linux-3.10.*.tar.xz && \ cd .. && \ cp -v /opt/initrd-builder/Makefile.virtio_mmio Makefile && \ find src -name virtio_mmio.c -exec cp -v {} . \; && \ sed -ie 's/virtio-mmio/my-virtio-mmio/g' virtio_mmio.c && \ - KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/3.10.0-1160.92.1.0.2.el7.x86_64/" make + KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.el7.x86_64/" make FROM initrd-builder:0.0.1 AS stage2 diff --git a/images/x86_64/oraclelinux/4.14/Dockerfile.kernel b/images/x86_64/oraclelinux/4.14/Dockerfile.kernel index d43f49f..8997d23 100644 --- a/images/x86_64/oraclelinux/4.14/Dockerfile.kernel +++ b/images/x86_64/oraclelinux/4.14/Dockerfile.kernel @@ -41,7 +41,7 @@ RUN yum groupinstall -y 'Development Tools' && \ cp -v /opt/initrd-builder/Makefile.virtio_mmio Makefile && \ curl -LO 'https://raw.githubusercontent.com/torvalds/linux/v4.14/drivers/virtio/virtio_mmio.c' && \ sed -ie 's/virtio-mmio/my-virtio-mmio/g' virtio_mmio.c && \ - KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/4.14.35-2047.526.2.el7uek.x86_64/" make + KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.el7uek.x86_64/" make FROM initrd-builder:0.0.1 AS stage2 diff --git a/images/x86_64/oraclelinux/5.15/Dockerfile.kernel b/images/x86_64/oraclelinux/5.15/Dockerfile.kernel index 10ff9f4..f8dc5e9 100644 --- a/images/x86_64/oraclelinux/5.15/Dockerfile.kernel +++ b/images/x86_64/oraclelinux/5.15/Dockerfile.kernel @@ -41,7 +41,7 @@ RUN yum groupinstall -y 'Development Tools' && \ cp -v /opt/initrd-builder/Makefile.virtio_mmio Makefile && \ curl -LO 'https://raw.githubusercontent.com/torvalds/linux/v5.15/drivers/virtio/virtio_mmio.c' && \ sed -ie 's/virtio-mmio/my-virtio-mmio/g' virtio_mmio.c && \ - KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/5.15.0-8.91.4.1.el9uek.x86_64/" make + KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.el9uek.x86_64/" make FROM initrd-builder:0.0.1 AS stage2 diff --git a/images/x86_64/oraclelinux/5.4/Dockerfile.kernel b/images/x86_64/oraclelinux/5.4/Dockerfile.kernel index f7b8563..89a5e8d 100644 --- a/images/x86_64/oraclelinux/5.4/Dockerfile.kernel +++ b/images/x86_64/oraclelinux/5.4/Dockerfile.kernel @@ -38,7 +38,7 @@ RUN yum groupinstall -y 'Development Tools' && \ cp -v /opt/initrd-builder/Makefile.virtio_mmio Makefile && \ curl -LO 'https://raw.githubusercontent.com/torvalds/linux/v5.4/drivers/virtio/virtio_mmio.c' && \ sed -ie 's/virtio-mmio/my-virtio-mmio/g' virtio_mmio.c && \ - KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/5.4.17-2136.320.7.1.el8uek.x86_64/" make + KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.el8uek.x86_64/" make FROM initrd-builder:0.0.1 AS stage2 diff --git a/images/x86_64/ubuntu/6.2/Dockerfile b/images/x86_64/ubuntu/6.2/Dockerfile index 911d635..b0cdc2c 100644 --- a/images/x86_64/ubuntu/6.2/Dockerfile +++ b/images/x86_64/ubuntu/6.2/Dockerfile @@ -1,6 +1,6 @@ FROM ubuntu:22.04 -ARG VERSION=6.2.0-41-generic +ARG VERSION=6.2.0-36-generic WORKDIR /home/ubuntu diff --git a/images/x86_64/ubuntu/6.2/Dockerfile.kernel b/images/x86_64/ubuntu/6.2/Dockerfile.kernel index 577119f..699cece 100644 --- a/images/x86_64/ubuntu/6.2/Dockerfile.kernel +++ b/images/x86_64/ubuntu/6.2/Dockerfile.kernel @@ -1,6 +1,6 @@ FROM initrd-builder:0.0.1 AS builder -ARG VERSION=6.2.0-41-generic +ARG VERSION=6.2.0-36-generic ARG URL='http://mirrors.edge.kernel.org/ubuntu/pool/main/l/linux/' WORKDIR /home/ubuntu From c7e4b8bc377a3b444280e114ad46876f2943da87 Mon Sep 17 00:00:00 2001 From: Federico Di Pierro Date: Tue, 30 Jan 2024 17:38:00 +0100 Subject: [PATCH 10/17] chore(ansible-playbooks): skip line-length check for machines matrix. Signed-off-by: Federico Di Pierro --- ansible-playbooks/group_vars/all/vars.yml | 46 +++++++++++------------ 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/ansible-playbooks/group_vars/all/vars.yml b/ansible-playbooks/group_vars/all/vars.yml index aceb149..bf13633 100644 --- a/ansible-playbooks/group_vars/all/vars.yml +++ b/ansible-playbooks/group_vars/all/vars.yml @@ -21,35 +21,35 @@ version: main machines: - {name: "amazonlinux2022-5.15", kernel: "therealbobo/amazonlinux2022-kernel:5.15-x86_64-{{ version }}", rootfs: "therealbobo/amazonlinux2022-image:5.15-x86_64-{{ version }}", arch: "x86_64"} # noqa: yaml[line-length] - {name: "amazonlinux2023-6.1", kernel: "therealbobo/amazonlinux2023-kernel:6.1-x86_64-{{ version }}", rootfs: "therealbobo/amazonlinux2023-image:6.1-x86_64-{{ version }}", arch: "x86_64"} # noqa: yaml[line-length] - - {name: "amazonlinux2-4.19", kernel: "therealbobo/amazonlinux2-kernel:4.19-x86_64-{{ version }}", rootfs: "therealbobo/amazonlinux2-image:4.19-x86_64-{{ version }}", arch: "x86_64"} - - {name: "amazonlinux2-5.10", kernel: "therealbobo/amazonlinux2-kernel:5.10-x86_64-{{ version }}", rootfs: "therealbobo/amazonlinux2-image:5.10-x86_64-{{ version }}", arch: "x86_64"} - - {name: "amazonlinux2-5.15", kernel: "therealbobo/amazonlinux2-kernel:5.15-x86_64-{{ version }}", rootfs: "therealbobo/amazonlinux2-image:5.15-x86_64-{{ version }}", arch: "x86_64"} - - {name: "amazonlinux2-5.4", kernel: "therealbobo/amazonlinux2-kernel:5.4-x86_64-{{ version }}", rootfs: "therealbobo/amazonlinux2-image:5.4-x86_64-{{ version }}", arch: "x86_64"} - - {name: "archlinux-6.0", kernel: "therealbobo/archlinux-kernel:6.0-x86_64-{{ version }}", rootfs: "therealbobo/archlinux-image:6.0-x86_64-{{ version }}", arch: "x86_64"} - - {name: "centos-3.10", kernel: "therealbobo/centos-kernel:3.10-x86_64-{{ version }}", rootfs: "therealbobo/centos-image:3.10-x86_64-{{ version }}", arch: "x86_64"} - - {name: "centos-4.18", kernel: "therealbobo/centos-kernel:4.18-x86_64-{{ version }}", rootfs: "therealbobo/centos-image:4.18-x86_64-{{ version }}", arch: "x86_64"} - - {name: "centos-5.14", kernel: "therealbobo/centos-kernel:5.14-x86_64-{{ version }}", rootfs: "therealbobo/centos-image:5.14-x86_64-{{ version }}", arch: "x86_64"} - - {name: "fedora-5.17", kernel: "therealbobo/fedora-kernel:5.17-x86_64-{{ version }}", rootfs: "therealbobo/fedora-image:5.17-x86_64-{{ version }}", arch: "x86_64"} - - {name: "fedora-5.8", kernel: "therealbobo/fedora-kernel:5.8-x86_64-{{ version }}", rootfs: "therealbobo/fedora-image:5.8-x86_64-{{ version }}", arch: "x86_64"} - - {name: "fedora-6.2", kernel: "therealbobo/fedora-kernel:6.2-x86_64-{{ version }}", rootfs: "therealbobo/fedora-image:6.2-x86_64-{{ version }}", arch: "x86_64"} - - {name: "oraclelinux-3.10", kernel: "therealbobo/oraclelinux-kernel:3.10-x86_64-{{ version }}", rootfs: "therealbobo/oraclelinux-image:3.10-x86_64-{{ version }}", arch: "x86_64"} - - {name: "oraclelinux-4.14", kernel: "therealbobo/oraclelinux-kernel:4.14-x86_64-{{ version }}", rootfs: "therealbobo/oraclelinux-image:4.14-x86_64-{{ version }}", arch: "x86_64"} - - {name: "oraclelinux-5.15", kernel: "therealbobo/oraclelinux-kernel:5.15-x86_64-{{ version }}", rootfs: "therealbobo/oraclelinux-image:5.15-x86_64-{{ version }}", arch: "x86_64"} - - {name: "oraclelinux-5.4", kernel: "therealbobo/oraclelinux-kernel:5.4-x86_64-{{ version }}", rootfs: "therealbobo/oraclelinux-image:5.4-x86_64-{{ version }}", arch: "x86_64"} - - {name: "ubuntu-4.15", kernel: "therealbobo/ubuntu-kernel:4.15-x86_64-{{ version }}", rootfs: "therealbobo/ubuntu-image:4.15-x86_64-{{ version }}", arch: "x86_64"} - - {name: "ubuntu-6.3", kernel: "therealbobo/ubuntu-kernel:6.3-x86_64-{{ version }}", rootfs: "therealbobo/ubuntu-image:6.3-x86_64-{{ version }}", arch: "x86_64"} + - {name: "amazonlinux2-4.19", kernel: "therealbobo/amazonlinux2-kernel:4.19-x86_64-{{ version }}", rootfs: "therealbobo/amazonlinux2-image:4.19-x86_64-{{ version }}", arch: "x86_64"} # noqa: yaml[line-length] + - {name: "amazonlinux2-5.10", kernel: "therealbobo/amazonlinux2-kernel:5.10-x86_64-{{ version }}", rootfs: "therealbobo/amazonlinux2-image:5.10-x86_64-{{ version }}", arch: "x86_64"} # noqa: yaml[line-length] + - {name: "amazonlinux2-5.15", kernel: "therealbobo/amazonlinux2-kernel:5.15-x86_64-{{ version }}", rootfs: "therealbobo/amazonlinux2-image:5.15-x86_64-{{ version }}", arch: "x86_64"} # noqa: yaml[line-length] + - {name: "amazonlinux2-5.4", kernel: "therealbobo/amazonlinux2-kernel:5.4-x86_64-{{ version }}", rootfs: "therealbobo/amazonlinux2-image:5.4-x86_64-{{ version }}", arch: "x86_64"} # noqa: yaml[line-length] + - {name: "archlinux-6.0", kernel: "therealbobo/archlinux-kernel:6.0-x86_64-{{ version }}", rootfs: "therealbobo/archlinux-image:6.0-x86_64-{{ version }}", arch: "x86_64"} # noqa: yaml[line-length] + - {name: "centos-3.10", kernel: "therealbobo/centos-kernel:3.10-x86_64-{{ version }}", rootfs: "therealbobo/centos-image:3.10-x86_64-{{ version }}", arch: "x86_64"} # noqa: yaml[line-length] + - {name: "centos-4.18", kernel: "therealbobo/centos-kernel:4.18-x86_64-{{ version }}", rootfs: "therealbobo/centos-image:4.18-x86_64-{{ version }}", arch: "x86_64"} # noqa: yaml[line-length] + - {name: "centos-5.14", kernel: "therealbobo/centos-kernel:5.14-x86_64-{{ version }}", rootfs: "therealbobo/centos-image:5.14-x86_64-{{ version }}", arch: "x86_64"} # noqa: yaml[line-length] + - {name: "fedora-5.17", kernel: "therealbobo/fedora-kernel:5.17-x86_64-{{ version }}", rootfs: "therealbobo/fedora-image:5.17-x86_64-{{ version }}", arch: "x86_64"} # noqa: yaml[line-length] + - {name: "fedora-5.8", kernel: "therealbobo/fedora-kernel:5.8-x86_64-{{ version }}", rootfs: "therealbobo/fedora-image:5.8-x86_64-{{ version }}", arch: "x86_64"} # noqa: yaml[line-length] + - {name: "fedora-6.2", kernel: "therealbobo/fedora-kernel:6.2-x86_64-{{ version }}", rootfs: "therealbobo/fedora-image:6.2-x86_64-{{ version }}", arch: "x86_64"} # noqa: yaml[line-length] + - {name: "oraclelinux-3.10", kernel: "therealbobo/oraclelinux-kernel:3.10-x86_64-{{ version }}", rootfs: "therealbobo/oraclelinux-image:3.10-x86_64-{{ version }}", arch: "x86_64"} # noqa: yaml[line-length] + - {name: "oraclelinux-4.14", kernel: "therealbobo/oraclelinux-kernel:4.14-x86_64-{{ version }}", rootfs: "therealbobo/oraclelinux-image:4.14-x86_64-{{ version }}", arch: "x86_64"} # noqa: yaml[line-length] + - {name: "oraclelinux-5.15", kernel: "therealbobo/oraclelinux-kernel:5.15-x86_64-{{ version }}", rootfs: "therealbobo/oraclelinux-image:5.15-x86_64-{{ version }}", arch: "x86_64"} # noqa: yaml[line-length] + - {name: "oraclelinux-5.4", kernel: "therealbobo/oraclelinux-kernel:5.4-x86_64-{{ version }}", rootfs: "therealbobo/oraclelinux-image:5.4-x86_64-{{ version }}", arch: "x86_64"} # noqa: yaml[line-length] + - {name: "ubuntu-4.15", kernel: "therealbobo/ubuntu-kernel:4.15-x86_64-{{ version }}", rootfs: "therealbobo/ubuntu-image:4.15-x86_64-{{ version }}", arch: "x86_64"} # noqa: yaml[line-length] + - {name: "ubuntu-6.3", kernel: "therealbobo/ubuntu-kernel:6.3-x86_64-{{ version }}", rootfs: "therealbobo/ubuntu-image:6.3-x86_64-{{ version }}", arch: "x86_64"} # noqa: yaml[line-length] - {name: "amazonlinux2022-5.15", kernel: "therealbobo/amazonlinux2022-kernel:5.15-aarch64-{{ version }}", rootfs: "therealbobo/amazonlinux2022-image:5.15-aarch64-{{ version }}", arch: "aarch64"} # noqa: yaml[line-length] - - {name: "amazonlinux2-5.4", kernel: "therealbobo/amazonlinux2-kernel:5.4-aarch64-{{ version }}", rootfs: "therealbobo/amazonlinux2-image:5.4-aarch64-{{ version }}", arch: "aarch64"} - - {name: "fedora-6.2", kernel: "therealbobo/fedora-kernel:6.2-aarch64-{{ version }}", rootfs: "therealbobo/fedora-image:6.2-aarch64-{{ version }}", arch: "aarch64"} - - {name: "oraclelinux-4.14", kernel: "therealbobo/oraclelinux-kernel:4.14-aarch64-{{ version }}", rootfs: "therealbobo/oraclelinux-image:4.14-aarch64-{{ version }}", arch: "aarch64"} - - {name: "oraclelinux-5.15", kernel: "therealbobo/oraclelinux-kernel:5.15-aarch64-{{ version }}", rootfs: "therealbobo/oraclelinux-image:5.15-aarch64-{{ version }}", arch: "aarch64"} - - {name: "ubuntu-6.3", kernel: "therealbobo/ubuntu-kernel:6.3-aarch64-{{ version }}", rootfs: "therealbobo/ubuntu-image:6.3-aarch64-{{ version }}", arch: "aarch64"} + - {name: "amazonlinux2-5.4", kernel: "therealbobo/amazonlinux2-kernel:5.4-aarch64-{{ version }}", rootfs: "therealbobo/amazonlinux2-image:5.4-aarch64-{{ version }}", arch: "aarch64"} # noqa: yaml[line-length] + - {name: "fedora-6.2", kernel: "therealbobo/fedora-kernel:6.2-aarch64-{{ version }}", rootfs: "therealbobo/fedora-image:6.2-aarch64-{{ version }}", arch: "aarch64"} # noqa: yaml[line-length] + - {name: "oraclelinux-4.14", kernel: "therealbobo/oraclelinux-kernel:4.14-aarch64-{{ version }}", rootfs: "therealbobo/oraclelinux-image:4.14-aarch64-{{ version }}", arch: "aarch64"} # noqa: yaml[line-length] + - {name: "oraclelinux-5.15", kernel: "therealbobo/oraclelinux-kernel:5.15-aarch64-{{ version }}", rootfs: "therealbobo/oraclelinux-image:5.15-aarch64-{{ version }}", arch: "aarch64"} # noqa: yaml[line-length] + - {name: "ubuntu-6.3", kernel: "therealbobo/ubuntu-kernel:6.3-aarch64-{{ version }}", rootfs: "therealbobo/ubuntu-image:6.3-aarch64-{{ version }}", arch: "aarch64"} # noqa: yaml[line-length] builders: - {name: "centos-builder", kernel: "weaveworks/ignite-kernel:5.14.16", rootfs: "therealbobo/builder:0.0.1-x86_64-{{ version }}", arch: "x86_64"} - {name: "fedora-builder", kernel: "weaveworks/ignite-kernel:5.14.16", rootfs: "therealbobo/modernprobe-builder:0.0.1-x86_64-{{ version }}", arch: "x86_64"} - {name: "centos-builder", kernel: "weaveworks/ignite-kernel:5.14.16", rootfs: "therealbobo/builder:0.0.1-aarch64-{{ version }}", arch: "aarch64"} - - {name: "fedora-builder", kernel: "weaveworks/ignite-kernel:5.14.16", rootfs: "therealbobo/modernprobe-builder:0.0.1-aarch64-{{ version }}", arch: "aarch64"} + - {name: "fedora-builder", kernel: "weaveworks/ignite-kernel:5.14.16", rootfs: "therealbobo/modernprobe-builder:0.0.1-aarch64-{{ version }}", arch: "aarch64"} # noqa: yaml[line-length] output_dir: "~/ansible_output" # Number of cpus. From c7f093ea3b56e656fa1271a2715a5b6d55154a25 Mon Sep 17 00:00:00 2001 From: Federico Di Pierro Date: Wed, 31 Jan 2024 09:00:29 +0100 Subject: [PATCH 11/17] chore(images): multiple improvements to images Dockerfiles. Moreover, added archlinux 6.7. Signed-off-by: Federico Di Pierro --- .../amazonlinux2/5.4/Dockerfile.kernel | 9 ++++-- .../aarch64/amazonlinux2022/5.15/Dockerfile | 4 +-- .../amazonlinux2022/5.15/Dockerfile.kernel | 9 ++++-- images/aarch64/archlinux/4.14/Dockerfile | 2 +- .../aarch64/archlinux/4.14/Dockerfile.kernel | 2 +- images/aarch64/fedora/6.2/Dockerfile.kernel | 9 ++++-- .../oraclelinux/4.14/Dockerfile.kernel | 7 +++-- .../oraclelinux/5.15/Dockerfile.kernel | 6 +++- .../amazonlinux2/4.19/Dockerfile.kernel | 2 +- .../amazonlinux2/5.10/Dockerfile.kernel | 2 +- .../amazonlinux2/5.15/Dockerfile.kernel | 2 +- .../x86_64/amazonlinux2/5.4/Dockerfile.kernel | 2 +- images/x86_64/amazonlinux2022/5.15/Dockerfile | 4 +-- .../amazonlinux2022/5.15/Dockerfile.kernel | 2 +- images/x86_64/amazonlinux2023/6.1/Dockerfile | 4 +-- .../amazonlinux2023/6.1/Dockerfile.kernel | 2 +- images/x86_64/archlinux/5.18/Dockerfile | 2 +- images/x86_64/archlinux/6.0/Dockerfile | 12 +++----- images/x86_64/archlinux/6.7/Dockerfile | 29 +++++++++++++++++++ images/x86_64/archlinux/6.7/Dockerfile.kernel | 29 +++++++++++++++++++ images/x86_64/centos/3.10/Dockerfile.kernel | 6 ++-- images/x86_64/centos/4.18/Dockerfile.kernel | 2 +- images/x86_64/centos/5.14/Dockerfile.kernel | 2 +- .../x86_64/oraclelinux/2.6/Dockerfile.kernel | 11 +++---- .../x86_64/oraclelinux/3.10/Dockerfile.kernel | 2 +- .../x86_64/oraclelinux/4.14/Dockerfile.kernel | 2 +- images/x86_64/oraclelinux/5.15/Dockerfile | 4 +-- .../x86_64/oraclelinux/5.15/Dockerfile.kernel | 2 +- images/x86_64/oraclelinux/5.4/Dockerfile | 4 +-- .../x86_64/oraclelinux/5.4/Dockerfile.kernel | 2 +- 30 files changed, 125 insertions(+), 52 deletions(-) create mode 100644 images/x86_64/archlinux/6.7/Dockerfile create mode 100644 images/x86_64/archlinux/6.7/Dockerfile.kernel diff --git a/images/aarch64/amazonlinux2/5.4/Dockerfile.kernel b/images/aarch64/amazonlinux2/5.4/Dockerfile.kernel index c119c29..e282570 100644 --- a/images/aarch64/amazonlinux2/5.4/Dockerfile.kernel +++ b/images/aarch64/amazonlinux2/5.4/Dockerfile.kernel @@ -10,9 +10,9 @@ RUN touch .placeholder && \ URL=$(cat mirror.list) && \ curl -sLO "${URL}"/repodata/primary.xml.gz && \ gunzip primary.xml.gz && \ - grep -E 'kernel-5.4.247-162.*.rpm' primary.xml | grep href | cut -d\" -f2 | \ + grep -E 'kernel-${VERSION}.*.rpm' primary.xml | grep href | cut -d\" -f2 | \ xargs -I@ curl -Lo kernel.rpm ${URL}/@ && \ - grep -E 'kernel-devel-5.4.247-162.*.rpm' primary.xml | grep href | cut -d\" -f2 | \ + grep -E 'kernel-devel-${VERSION}.*.rpm' primary.xml | grep href | cut -d\" -f2 | \ xargs -I@ curl -Lo headers.rpm ${URL}/@ && \ rpm2cpio kernel.rpm > kernel.cpio && \ rpm2cpio headers.rpm > headers.cpio && \ @@ -25,6 +25,9 @@ RUN touch .placeholder && \ FROM amazonlinux:2 as kmod-builder +ARG VERSION +ARG URL + WORKDIR /home/ubuntu COPY --from=stage1 /home/ubuntu/extracted /home/ubuntu/extracted/ COPY --from=stage1 /opt/initrd-builder/* /opt/initrd-builder/ @@ -32,7 +35,7 @@ COPY --from=stage1 /opt/initrd-builder/* /opt/initrd-builder/ RUN yum groupinstall -y 'Development Tools' && \ cp -v /opt/initrd-builder/Makefile.virtio_mmio Makefile && \ curl -LO 'https://raw.githubusercontent.com/torvalds/linux/v5.4/drivers/virtio/virtio_mmio.c' && \ - KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/5.4.247-162.350.amzn2.aarch64/" make + KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.350.amzn2.aarch64/" make FROM initrd-builder:0.0.1 AS stage2 COPY --from=stage1 /home/ubuntu/extracted /home/ubuntu/extracted/ diff --git a/images/aarch64/amazonlinux2022/5.15/Dockerfile b/images/aarch64/amazonlinux2022/5.15/Dockerfile index f885356..8b4f340 100644 --- a/images/aarch64/amazonlinux2022/5.15/Dockerfile +++ b/images/aarch64/amazonlinux2022/5.15/Dockerfile @@ -28,8 +28,8 @@ RUN dnf groupinstall -y 'Development Tools' && \ xargs -I@ curl -Lo sources.rpm ${URL}@ && \ dnf install -y ./*.rpm && \ rm -f ./*.rpm && \ - mkdir -p /lib/modules/5.15.73-45.135.amzn2022.aarch64/ && \ - ln -s /usr/src/kernels/5.15.73-45.135.amzn2022.aarch64/ /lib/modules/5.15.73-45.135.amzn2022.aarch64/build && \ + mkdir -p /lib/modules/${VERSION}.135.amzn2022.aarch64/ && \ + ln -s /usr/src/kernels/${VERSION}.135.amzn2022.aarch64/ /lib/modules/${VERSION}.135.amzn2022.aarch64/build && \ sed -i -e 's/^AcceptEnv LANG LC_\*$/#AcceptEnv LANG LC_*/' /etc/ssh/sshd_config && \ echo 'UseDNS no' >> /etc/ssh/sshd_config && \ echo "root:root" | chpasswd diff --git a/images/aarch64/amazonlinux2022/5.15/Dockerfile.kernel b/images/aarch64/amazonlinux2022/5.15/Dockerfile.kernel index daddc94..e55a5ff 100644 --- a/images/aarch64/amazonlinux2022/5.15/Dockerfile.kernel +++ b/images/aarch64/amazonlinux2022/5.15/Dockerfile.kernel @@ -10,9 +10,9 @@ RUN touch .placeholder && \ URL=$(cat mirror.list) && \ curl -sLO "${URL}"repodata/primary.xml.gz && \ gunzip primary.xml.gz && \ - grep -E 'kernel-5.15.73-45.*.rpm' primary.xml | grep href | cut -d\" -f2 | \ + grep -E 'kernel-${VERSION}.*.rpm' primary.xml | grep href | cut -d\" -f2 | \ xargs -I@ curl -Lo kernel.rpm ${URL}@ && \ - grep -E 'kernel-devel-5.15.73-45.*.rpm' primary.xml | grep href | cut -d\" -f2 | \ + grep -E 'kernel-devel-${VERSION}.*.rpm' primary.xml | grep href | cut -d\" -f2 | \ xargs -I@ curl -Lo headers.rpm ${URL}@ && \ rpm2cpio kernel.rpm > kernel.cpio && \ rpm2cpio headers.rpm > headers.cpio && \ @@ -26,6 +26,9 @@ RUN touch .placeholder && \ FROM amazonlinux:2023 as kmod-builder +ARG VERSION +ARG URL + WORKDIR /home/ubuntu COPY --from=stage1 /home/ubuntu/extracted /home/ubuntu/extracted/ COPY --from=stage1 /opt/initrd-builder/* /opt/initrd-builder/ @@ -33,7 +36,7 @@ COPY --from=stage1 /opt/initrd-builder/* /opt/initrd-builder/ RUN dnf groupinstall -y 'Development Tools' && \ cp -v /opt/initrd-builder/Makefile.virtio_mmio Makefile && \ curl -LO 'https://raw.githubusercontent.com/torvalds/linux/v5.15/drivers/virtio/virtio_mmio.c' && \ - KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/5.15.73-45.135.amzn2022.aarch64/" make + KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.135.amzn2022.aarch64/" make FROM initrd-builder:0.0.1 AS stage2 COPY --from=stage1 /home/ubuntu/extracted /home/ubuntu/extracted/ diff --git a/images/aarch64/archlinux/4.14/Dockerfile b/images/aarch64/archlinux/4.14/Dockerfile index 2e7b083..2402d93 100644 --- a/images/aarch64/archlinux/4.14/Dockerfile +++ b/images/aarch64/archlinux/4.14/Dockerfile @@ -28,7 +28,7 @@ RUN pacman -Syyu --noconfirm && \ sed -i -e 's/^AcceptEnv LANG LC_\*$/#AcceptEnv LANG LC_*/' /etc/ssh/sshd_config && \ echo 'UseDNS no' >> /etc/ssh/sshd_config && \ echo "root:root" | chpasswd && \ - curl -Lo headers.tar.xz ${URL}/l/linux-aarch64-headers/linux-aarch64-headers-4.14.15-1-aarch64.pkg.tar.xz && \ + curl -Lo headers.tar.xz ${URL}/l/linux-aarch64-headers/linux-aarch64-headers-${VERSION}-aarch64.pkg.tar.xz && \ pacman -U --noconfirm ./headers.tar.xz && \ rm -v ./headers.tar.xz && \ ln -s /usr/lib/systemd/systemd /sbin/init && \ diff --git a/images/aarch64/archlinux/4.14/Dockerfile.kernel b/images/aarch64/archlinux/4.14/Dockerfile.kernel index 72f87d2..51c4ce4 100644 --- a/images/aarch64/archlinux/4.14/Dockerfile.kernel +++ b/images/aarch64/archlinux/4.14/Dockerfile.kernel @@ -7,7 +7,7 @@ WORKDIR /home/ubuntu RUN touch .placeholder && \ apt update && apt install -y file && \ - curl -Lo kernel.pkg.tar.xz ${URL}/l/linux-aarch64/linux-aarch64-4.14.15-1-aarch64.pkg.tar.xz && \ + curl -Lo kernel.pkg.tar.xz ${URL}/l/linux-aarch64/linux-aarch64-${VERSION}-aarch64.pkg.tar.xz && \ mkdir extracted && \ cd extracted && \ ls ../*.tar.xz | \ diff --git a/images/aarch64/fedora/6.2/Dockerfile.kernel b/images/aarch64/fedora/6.2/Dockerfile.kernel index f1a2cad..5beae65 100644 --- a/images/aarch64/fedora/6.2/Dockerfile.kernel +++ b/images/aarch64/fedora/6.2/Dockerfile.kernel @@ -27,7 +27,7 @@ RUN touch .placeholder && \ cpio -idmv < ../modules-core.cpio && \ find . -name '*.xz' -exec xz -d {} \; && \ VMLINUX=$(find lib/modules -name vmlinuz) ; \ - SKIP=$(objdump -EL -b binary -D -m aarch64 $VMLINUX | \ + SKIP=$(objdump -EL -b binary -D -m ${ARCH} $VMLINUX | \ grep '00088b1f' | awk '{print $1}' | cut -d: -f1 | \ tr '[:lower:]' '[:upper:]' | xargs -I@ printf "%d" 0x@ ) ; \ dd if=$VMLINUX of=/home/ubuntu/extracted/vmlinux.gz bs=1 skip=$SKIP && \ @@ -37,6 +37,11 @@ RUN touch .placeholder && \ FROM fedora:38 as kmod-builder +ARG VERSION +ARG HVERSION +ARG ARCH +ARG URL + WORKDIR /home/ubuntu COPY --from=stage1 /home/ubuntu/extracted /home/ubuntu/extracted/ COPY --from=stage1 /opt/initrd-builder/* /opt/initrd-builder/ @@ -45,7 +50,7 @@ COPY --from=stage1 /opt/initrd-builder/* /opt/initrd-builder/ RUN dnf groupinstall -y 'Development Tools' && \ cp -v /opt/initrd-builder/Makefile.virtio_mmio Makefile && \ curl -LO 'https://gitlab.com/cki-project/kernel-ark/-/raw/fedora-6.2/drivers/virtio/virtio_mmio.c' && \ - KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/6.2.9-300.fc38.aarch64/" make + KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.fc38.${ARCH}/" make FROM initrd-builder:0.0.1 AS stage2 diff --git a/images/aarch64/oraclelinux/4.14/Dockerfile.kernel b/images/aarch64/oraclelinux/4.14/Dockerfile.kernel index 18fe76c..1080542 100644 --- a/images/aarch64/oraclelinux/4.14/Dockerfile.kernel +++ b/images/aarch64/oraclelinux/4.14/Dockerfile.kernel @@ -20,6 +20,9 @@ RUN touch .placeholder && \ FROM amazonlinux:2 as kmod-builder +ARG VERSION +ARG URL + WORKDIR /home/ubuntu COPY --from=stage1 /home/ubuntu/extracted /home/ubuntu/extracted/ COPY --from=stage1 /opt/initrd-builder/* /opt/initrd-builder/ @@ -29,7 +32,7 @@ RUN yum groupinstall -y 'Development Tools' && \ curl -Lo libdtrace-devel.rpm https://yum.oracle.com/repo/OracleLinux/OL7/latest/aarch64/getPackage/libdtrace-ctf-devel-1.1.0-2.el7.aarch64.rpm && \ curl -Lo libdtrace.rpm https://yum.oracle.com/repo/OracleLinux/OL7/latest/aarch64/getPackage/libdtrace-ctf-1.1.0-2.el7.aarch64.rpm && \ yum install -y --skip-broken ./libdtrace.rpm ./libdtrace-devel.rpm && \ - curl -Lo source.rpm https://yum.oracle.com/repo/OracleLinux/OL7/latest/aarch64/getPackageSource/kernel-uek-4.14.35-2047.527.2.el7uek.src.rpm && \ + curl -Lo source.rpm https://yum.oracle.com/repo/OracleLinux/OL7/latest/aarch64/getPackageSource/kernel-uek-${VERSION}.el7uek.src.rpm && \ mkdir src && \ cd src && \ rpm2cpio ../source.rpm > source.cpio && \ @@ -45,7 +48,7 @@ RUN yum groupinstall -y 'Development Tools' && \ ln -s /usr/bin/nm /opt/oracle/oracle-armtoolset-1/root/bin/nm && \ ln -s /usr/bin/objdump /opt/oracle/oracle-armtoolset-1/root/bin/objdump && \ ln -s /usr/bin/objcopy /opt/oracle/oracle-armtoolset-1/root/bin/objcopy && \ - KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/4.14.35-2047.527.2.el7uek.aarch64/" make + KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.el7uek.aarch64/" make FROM initrd-builder:0.0.1 AS stage2 diff --git a/images/aarch64/oraclelinux/5.15/Dockerfile.kernel b/images/aarch64/oraclelinux/5.15/Dockerfile.kernel index a8016e7..d505384 100644 --- a/images/aarch64/oraclelinux/5.15/Dockerfile.kernel +++ b/images/aarch64/oraclelinux/5.15/Dockerfile.kernel @@ -24,6 +24,10 @@ RUN touch .placeholder && \ FROM oraclelinux:9 as kmod-builder +ARG VERSION +ARG ARCH +ARG URL + WORKDIR /home/ubuntu COPY --from=stage1 /home/ubuntu/extracted /home/ubuntu/extracted/ COPY --from=stage1 /opt/initrd-builder/* /opt/initrd-builder/ @@ -33,7 +37,7 @@ RUN yum groupinstall -y 'Development Tools' && \ cp -v /opt/initrd-builder/Makefile.virtio_mmio Makefile && \ curl -LO 'https://raw.githubusercontent.com/torvalds/linux/v5.15/drivers/virtio/virtio_mmio.c' && \ sed -ie 's/virtio-mmio/my-virtio-mmio/g' virtio_mmio.c && \ - KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/5.15.0-8.91.4.1.el9uek.aarch64/" make + KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.el9uek.${ARCH}/" make FROM initrd-builder:0.0.1 AS stage2 diff --git a/images/x86_64/amazonlinux2/4.19/Dockerfile.kernel b/images/x86_64/amazonlinux2/4.19/Dockerfile.kernel index 537a581..cab6033 100644 --- a/images/x86_64/amazonlinux2/4.19/Dockerfile.kernel +++ b/images/x86_64/amazonlinux2/4.19/Dockerfile.kernel @@ -41,7 +41,7 @@ COPY --from=stage1 /opt/initrd-builder/* /opt/initrd-builder/ RUN yum groupinstall -y 'Development Tools' && \ cp -v /opt/initrd-builder/Makefile.virtio_mmio Makefile && \ curl -LO 'https://raw.githubusercontent.com/torvalds/linux/v4.19/drivers/virtio/virtio_mmio.c' && \ - KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.amzn2.x86_64/" make + KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.amzn2.${ARCH}/" make FROM initrd-builder:0.0.1 AS stage2 COPY --from=stage1 /home/ubuntu/extracted /home/ubuntu/extracted/ diff --git a/images/x86_64/amazonlinux2/5.10/Dockerfile.kernel b/images/x86_64/amazonlinux2/5.10/Dockerfile.kernel index bea40cd..5d74600 100644 --- a/images/x86_64/amazonlinux2/5.10/Dockerfile.kernel +++ b/images/x86_64/amazonlinux2/5.10/Dockerfile.kernel @@ -42,7 +42,7 @@ RUN yum groupinstall -y 'Development Tools' && \ yum install -y gcc10 && \ cp -v /opt/initrd-builder/Makefile.virtio_mmio Makefile && \ curl -LO 'https://raw.githubusercontent.com/torvalds/linux/v5.10/drivers/virtio/virtio_mmio.c' && \ - KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.amzn2.x86_64/" make + KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.amzn2.${ARCH}/" make FROM initrd-builder:0.0.1 AS stage2 COPY --from=stage1 /home/ubuntu/extracted /home/ubuntu/extracted/ diff --git a/images/x86_64/amazonlinux2/5.15/Dockerfile.kernel b/images/x86_64/amazonlinux2/5.15/Dockerfile.kernel index af38f6a..d5e9207 100644 --- a/images/x86_64/amazonlinux2/5.15/Dockerfile.kernel +++ b/images/x86_64/amazonlinux2/5.15/Dockerfile.kernel @@ -42,7 +42,7 @@ RUN yum groupinstall -y 'Development Tools' && \ yum install -y gcc10 && \ cp -v /opt/initrd-builder/Makefile.virtio_mmio Makefile && \ curl -LO 'https://raw.githubusercontent.com/torvalds/linux/v5.15/drivers/virtio/virtio_mmio.c' && \ - KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.amzn2.x86_64/" make + KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.amzn2.${ARCH}/" make FROM initrd-builder:0.0.1 AS stage2 COPY --from=stage1 /home/ubuntu/extracted /home/ubuntu/extracted/ diff --git a/images/x86_64/amazonlinux2/5.4/Dockerfile.kernel b/images/x86_64/amazonlinux2/5.4/Dockerfile.kernel index c3b9120..47a7249 100644 --- a/images/x86_64/amazonlinux2/5.4/Dockerfile.kernel +++ b/images/x86_64/amazonlinux2/5.4/Dockerfile.kernel @@ -41,7 +41,7 @@ COPY --from=stage1 /opt/initrd-builder/* /opt/initrd-builder/ RUN yum groupinstall -y 'Development Tools' && \ cp -v /opt/initrd-builder/Makefile.virtio_mmio Makefile && \ curl -LO 'https://raw.githubusercontent.com/torvalds/linux/v5.4/drivers/virtio/virtio_mmio.c' && \ - KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.amzn2.x86_64/" make + KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.amzn2.${ARCH}/" make FROM initrd-builder:0.0.1 AS stage2 COPY --from=stage1 /home/ubuntu/extracted /home/ubuntu/extracted/ diff --git a/images/x86_64/amazonlinux2022/5.15/Dockerfile b/images/x86_64/amazonlinux2022/5.15/Dockerfile index ca82521..64d44c5 100644 --- a/images/x86_64/amazonlinux2022/5.15/Dockerfile +++ b/images/x86_64/amazonlinux2022/5.15/Dockerfile @@ -29,8 +29,8 @@ RUN dnf groupinstall -y 'Development Tools' && \ rm -vf ./*.rpm && \ dnf clean all && \ rm -rf /var/cache/yum && \ - mkdir -p /lib/modules/5.15.73-45.135.amzn2022.x86_64/ && \ - ln -s /usr/src/kernels/5.15.73-45.135.amzn2022.x86_64/ /lib/modules/5.15.73-45.135.amzn2022.x86_64/build && \ + mkdir -p /lib/modules/${VERSION}.135.amzn2022.x86_64/ && \ + ln -s /usr/src/kernels/${VERSION}.135.amzn2022.x86_64/ /lib/modules/${VERSION}.135.amzn2022.x86_64/build && \ sed -i -e 's/^AcceptEnv LANG LC_\*$/#AcceptEnv LANG LC_*/' /etc/ssh/sshd_config && \ echo 'UseDNS no' >> /etc/ssh/sshd_config && \ echo "root:root" | chpasswd diff --git a/images/x86_64/amazonlinux2022/5.15/Dockerfile.kernel b/images/x86_64/amazonlinux2022/5.15/Dockerfile.kernel index f85f0dc..42caf85 100644 --- a/images/x86_64/amazonlinux2022/5.15/Dockerfile.kernel +++ b/images/x86_64/amazonlinux2022/5.15/Dockerfile.kernel @@ -41,7 +41,7 @@ COPY --from=stage1 /opt/initrd-builder/* /opt/initrd-builder/ RUN dnf groupinstall -y 'Development Tools' && \ cp -v /opt/initrd-builder/Makefile.virtio_mmio Makefile && \ curl -LO 'https://raw.githubusercontent.com/torvalds/linux/v5.15/drivers/virtio/virtio_mmio.c' && \ - KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/5.15.73-45.135.amzn2022.x86_64/" make + KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.135.amzn2022.${ARCH}/" make FROM initrd-builder:0.0.1 AS stage2 COPY --from=stage1 /home/ubuntu/extracted /home/ubuntu/extracted/ diff --git a/images/x86_64/amazonlinux2023/6.1/Dockerfile b/images/x86_64/amazonlinux2023/6.1/Dockerfile index c8759be..b429ed6 100644 --- a/images/x86_64/amazonlinux2023/6.1/Dockerfile +++ b/images/x86_64/amazonlinux2023/6.1/Dockerfile @@ -29,8 +29,8 @@ RUN dnf groupinstall -y 'Development Tools' && \ rm -vf ./headers.rpm ./sources.rpm && \ dnf clean all && \ rm -rf /var/cache/yum && \ - mkdir -p /lib/modules/6.1.34-58.102.amzn2023.x86_64/ && \ - ln -s /usr/src/kernels/6.1.34-58.102.amzn2023.x86_64/ /lib/modules/6.1.34-58.102.amzn2023.x86_64/build && \ + mkdir -p /lib/modules/${VERSION}.102.amzn2023.x86_64/ && \ + ln -s /usr/src/kernels/${VERSION}.102.amzn2023.x86_64/ /lib/modules/${VERSION}.102.amzn2023.x86_64/build && \ sed -i -e 's/^AcceptEnv LANG LC_\*$/#AcceptEnv LANG LC_*/' /etc/ssh/sshd_config && \ echo 'UseDNS no' >> /etc/ssh/sshd_config && \ echo "root:root" | chpasswd diff --git a/images/x86_64/amazonlinux2023/6.1/Dockerfile.kernel b/images/x86_64/amazonlinux2023/6.1/Dockerfile.kernel index c0cc619..1a8915f 100644 --- a/images/x86_64/amazonlinux2023/6.1/Dockerfile.kernel +++ b/images/x86_64/amazonlinux2023/6.1/Dockerfile.kernel @@ -41,7 +41,7 @@ COPY --from=stage1 /opt/initrd-builder/* /opt/initrd-builder/ RUN dnf groupinstall -y 'Development Tools' && \ cp -v /opt/initrd-builder/Makefile.virtio_mmio Makefile && \ curl -LO 'https://raw.githubusercontent.com/torvalds/linux/v6.1/drivers/virtio/virtio_mmio.c' && \ - KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/6.1.34-58.102.amzn2023.${ARCH}/" make + KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.102.amzn2023.${ARCH}/" make FROM initrd-builder:0.0.1 AS stage2 COPY --from=stage1 /home/ubuntu/extracted /home/ubuntu/extracted/ diff --git a/images/x86_64/archlinux/5.18/Dockerfile b/images/x86_64/archlinux/5.18/Dockerfile index deebaf7..3bd9a57 100644 --- a/images/x86_64/archlinux/5.18/Dockerfile +++ b/images/x86_64/archlinux/5.18/Dockerfile @@ -1,4 +1,4 @@ -FROM archlinux:base-20220807.0.72894 +FROM archlinux/archlinux:base-20220807.0.72894 WORKDIR /home/ubuntu diff --git a/images/x86_64/archlinux/6.0/Dockerfile b/images/x86_64/archlinux/6.0/Dockerfile index 9211a0c..6c3bfd3 100644 --- a/images/x86_64/archlinux/6.0/Dockerfile +++ b/images/x86_64/archlinux/6.0/Dockerfile @@ -1,17 +1,16 @@ -FROM archlinux:base - -ARG VERSION=6.0.12.arch1-1 -ARG URL='https://archive.archlinux.org/packages' +FROM archlinux/archlinux:base-20221211.0.109768 WORKDIR /home/ubuntu -RUN pacman -Syyu --noconfirm && \ +RUN printf 'SigLevel = Never\nServer=https://archive.archlinux.org/repos/2022/12/11/$repo/os/$arch' > /etc/pacman.d/mirrorlist && \ +pacman -Syyu --noconfirm && \ pacman -S --noconfirm \ clang \ cmake \ gcc \ git \ libcap \ + linux-headers \ llvm \ make \ openssh \ @@ -19,9 +18,6 @@ RUN pacman -Syyu --noconfirm && \ rsync \ wget && \ yes | pacman -Scc && \ - curl -Lo headers.tar.zst ${URL}/l/linux-headers/linux-headers-${VERSION}-x86_64.pkg.tar.zst && \ - pacman -U --noconfirm ./headers.tar.zst && \ - rm -v ./headers.tar.zst && \ ln -sf /usr/share/zoneinfo/US/Eastern /etc/localtime && \ echo 'LANG=en_US.UTF-8' > /etc/locale.gen && \ locale-gen && \ diff --git a/images/x86_64/archlinux/6.7/Dockerfile b/images/x86_64/archlinux/6.7/Dockerfile new file mode 100644 index 0000000..49a3ff6 --- /dev/null +++ b/images/x86_64/archlinux/6.7/Dockerfile @@ -0,0 +1,29 @@ +FROM archlinux/archlinux:base-20240124.0.209208 + +WORKDIR /home/ubuntu + +RUN printf 'SigLevel = Never\nServer=https://archive.archlinux.org/repos/2024/01/24/$repo/os/$arch' > /etc/pacman.d/mirrorlist && \ +pacman -Syyu --noconfirm && \ + pacman -S --noconfirm \ + clang \ + cmake \ + gcc \ + git \ + libcap \ + linux-headers \ + llvm \ + make \ + openssh \ + python \ + rsync \ + wget && \ + yes | pacman -Scc && \ + ln -sf /usr/share/zoneinfo/US/Eastern /etc/localtime && \ + echo 'LANG=en_US.UTF-8' > /etc/locale.gen && \ + locale-gen && \ + echo 'LANG=en_US.UTF-8' > /etc/locale.conf && \ + echo 'archlinux' > /etc/hostname && \ + systemctl enable sshd && \ + sed -i -e 's/^AcceptEnv LANG LC_\*$/#AcceptEnv LANG LC_*/' /etc/ssh/sshd_config && \ + echo 'UseDNS no' >> /etc/ssh/sshd_config && \ + echo "root:root" | chpasswd diff --git a/images/x86_64/archlinux/6.7/Dockerfile.kernel b/images/x86_64/archlinux/6.7/Dockerfile.kernel new file mode 100644 index 0000000..16e51f6 --- /dev/null +++ b/images/x86_64/archlinux/6.7/Dockerfile.kernel @@ -0,0 +1,29 @@ +ARG VERSION +ARG URL +ARG ARCH + +FROM initrd-builder:0.0.1 AS builder + +ARG VERSION=6.7.1.arch1-1 +ARG URL='https://archive.archlinux.org/packages/l' +ARG ARCH=x86_64 + +WORKDIR /home/ubuntu + +RUN touch .placeholder && \ + curl -Lo kernel.pkg.tar.zst ${URL}/linux/linux-${VERSION}-${ARCH}.pkg.tar.zst && \ + curl -Lo headers.pkg.tar.zst ${URL}/linux-headers/linux-headers-${VERSION}-${ARCH}.pkg.tar.zst && \ + mkdir extracted && \ + cd extracted && \ + ls ../*.tar.zst | \ + xargs -I@ tar -xaf @ && \ + find . -name '*.zst' -exec zstd -d --rm -f {} \; && \ + mv ./usr/lib . && \ + extract-vmlinux $(find . -name 'vmlinux') > vmlinux && \ + /opt/initrd-builder/create.sh + +FROM scratch + +COPY --from=builder /home/ubuntu/extracted/vmlinux /boot/ +COPY --from=builder /home/ubuntu/out/initrd /boot/ +COPY --from=builder /home/ubuntu/.placeholder /lib/modules/ diff --git a/images/x86_64/centos/3.10/Dockerfile.kernel b/images/x86_64/centos/3.10/Dockerfile.kernel index 111c4a4..5537704 100644 --- a/images/x86_64/centos/3.10/Dockerfile.kernel +++ b/images/x86_64/centos/3.10/Dockerfile.kernel @@ -37,13 +37,13 @@ RUN yum groupinstall -y 'Development Tools' && \ cp -v /opt/initrd-builder/Makefile.virtio_mmio Makefile && \ mkdir src && \ cd src && \ - curl -Lo source.rpm 'https://archive.kernel.org/centos-vault/7.9.2009/os/Source/SPackages/kernel-3.10.0-1160.el7.src.rpm' && \ + curl -Lo source.rpm 'https://archive.kernel.org/centos-vault/7.9.2009/os/Source/SPackages/kernel-${VERSION}.el7.src.rpm' && \ rpm2cpio source.rpm > source.cpio && \ cpio -idmv < source.cpio && \ - tar -xaf 'linux-3.10.0-1160.el7.tar.xz' && \ + tar -xaf 'linux-${VERSION}.el7.tar.xz' && \ cd .. && \ find src -name 'virtio_mmio.c' -exec cp -v {} . \; && \ - KERNEL_DIR='/home/ubuntu/extracted/usr/src/kernels/3.10.0-1160.el7.x86_64/' make + KERNEL_DIR='/home/ubuntu/extracted/usr/src/kernels/${VERSION}.el7.${ARCH}/' make FROM initrd-builder:0.0.1 AS stage2 COPY --from=stage1 /home/ubuntu/extracted /home/ubuntu/extracted/ diff --git a/images/x86_64/centos/4.18/Dockerfile.kernel b/images/x86_64/centos/4.18/Dockerfile.kernel index 30a54ed..ccb90ff 100644 --- a/images/x86_64/centos/4.18/Dockerfile.kernel +++ b/images/x86_64/centos/4.18/Dockerfile.kernel @@ -42,7 +42,7 @@ COPY --from=stage1 /opt/initrd-builder/* /opt/initrd-builder/ RUN dnf groupinstall -y 'Development Tools' && \ cp -v /opt/initrd-builder/Makefile.virtio_mmio Makefile && \ curl -LO 'https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-8/-/raw/c8s/drivers/virtio/virtio_mmio.c' && \ - KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.el8.x86_64" make + KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.el8.${ARCH}" make FROM initrd-builder:0.0.1 AS stage2 COPY --from=stage1 /home/ubuntu/extracted /home/ubuntu/extracted/ diff --git a/images/x86_64/centos/5.14/Dockerfile.kernel b/images/x86_64/centos/5.14/Dockerfile.kernel index 326ab45..18cd3c5 100644 --- a/images/x86_64/centos/5.14/Dockerfile.kernel +++ b/images/x86_64/centos/5.14/Dockerfile.kernel @@ -45,7 +45,7 @@ COPY --from=stage1 /opt/initrd-builder/* /opt/initrd-builder/ RUN dnf groupinstall -y 'Development Tools' && \ cp -v /opt/initrd-builder/Makefile.virtio_mmio Makefile && \ curl -LO 'https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/raw/main/drivers/virtio/virtio_mmio.c' && \ - KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.el9.x86_64" make + KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.el9.${ARCH}" make FROM initrd-builder:0.0.1 AS stage2 COPY --from=stage1 /home/ubuntu/extracted /home/ubuntu/extracted/ diff --git a/images/x86_64/oraclelinux/2.6/Dockerfile.kernel b/images/x86_64/oraclelinux/2.6/Dockerfile.kernel index c91ee5e..90c5e74 100644 --- a/images/x86_64/oraclelinux/2.6/Dockerfile.kernel +++ b/images/x86_64/oraclelinux/2.6/Dockerfile.kernel @@ -1,16 +1,18 @@ ARG VERSION=2.6.39-400.330.1 ARG URL='https://yum.oracle.com/repo/OracleLinux/OL6/UEK/latest/x86_64' +ARG ARCH=x86_64 FROM initrd-builder:0.0.1 AS stage1 ARG VERSION ARG URL +ARG ARCH WORKDIR /home/ubuntu RUN touch .placeholder && \ - curl -L -o kernel.rpm ${URL}/getPackage/kernel-uek-${VERSION}.el6uek.x86_64.rpm && \ - curl -L -o devel.rpm ${URL}/getPackage/kernel-uek-devel-${VERSION}.el6uek.x86_64.rpm && \ + curl -L -o kernel.rpm ${URL}/getPackage/kernel-uek-${VERSION}.el6uek.${ARCH}.rpm && \ + curl -L -o devel.rpm ${URL}/getPackage/kernel-uek-devel-${VERSION}.el6uek.${ARCH}.rpm && \ rpm2cpio kernel.rpm > kernel.cpio && \ rpm2cpio devel.rpm > devel.cpio && \ mkdir extracted && \ @@ -25,13 +27,12 @@ FROM oraclelinux:7 as kmod-builder ARG VERSION ARG URL +ARG ARCH WORKDIR /home/ubuntu COPY --from=stage1 /home/ubuntu/extracted /home/ubuntu/extracted/ COPY --from=stage1 /opt/initrd-builder/* /opt/initrd-builder/ -COPY /virtio_mmio.c /home/ubuntu/virtio_mmio.c - RUN yum groupinstall -y 'Development Tools' && \ yum install -y gcc && \ mkdir src && \ @@ -44,7 +45,7 @@ RUN yum groupinstall -y 'Development Tools' && \ cp -v /opt/initrd-builder/Makefile.virtio_mmio Makefile && \ find src -name virtio_mmio.c -exec cp -v {} . \; && \ sed -ie 's/virtio-mmio/my-virtio-mmio/g' virtio_mmio.c && \ - echo KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.el6uek.x86_64/" make + KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.el6uek.${ARCH}/" make FROM initrd-builder:0.0.1 AS stage2 diff --git a/images/x86_64/oraclelinux/3.10/Dockerfile.kernel b/images/x86_64/oraclelinux/3.10/Dockerfile.kernel index 42a9e58..9a2ef75 100644 --- a/images/x86_64/oraclelinux/3.10/Dockerfile.kernel +++ b/images/x86_64/oraclelinux/3.10/Dockerfile.kernel @@ -45,7 +45,7 @@ RUN yum groupinstall -y 'Development Tools' && \ cp -v /opt/initrd-builder/Makefile.virtio_mmio Makefile && \ find src -name virtio_mmio.c -exec cp -v {} . \; && \ sed -ie 's/virtio-mmio/my-virtio-mmio/g' virtio_mmio.c && \ - KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.el7.x86_64/" make + KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.el7.${ARCH}/" make FROM initrd-builder:0.0.1 AS stage2 diff --git a/images/x86_64/oraclelinux/4.14/Dockerfile.kernel b/images/x86_64/oraclelinux/4.14/Dockerfile.kernel index 8997d23..1335a3a 100644 --- a/images/x86_64/oraclelinux/4.14/Dockerfile.kernel +++ b/images/x86_64/oraclelinux/4.14/Dockerfile.kernel @@ -41,7 +41,7 @@ RUN yum groupinstall -y 'Development Tools' && \ cp -v /opt/initrd-builder/Makefile.virtio_mmio Makefile && \ curl -LO 'https://raw.githubusercontent.com/torvalds/linux/v4.14/drivers/virtio/virtio_mmio.c' && \ sed -ie 's/virtio-mmio/my-virtio-mmio/g' virtio_mmio.c && \ - KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.el7uek.x86_64/" make + KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.el7uek.${ARCH}/" make FROM initrd-builder:0.0.1 AS stage2 diff --git a/images/x86_64/oraclelinux/5.15/Dockerfile b/images/x86_64/oraclelinux/5.15/Dockerfile index d79f42a..f789e6d 100644 --- a/images/x86_64/oraclelinux/5.15/Dockerfile +++ b/images/x86_64/oraclelinux/5.15/Dockerfile @@ -30,7 +30,7 @@ RUN yum install -y \ rm -vf cmake-3.16.7-Linux-x86_64.tar.gz && \ mv cmake-3.16.7-Linux-x86_64 /opt/cmake-3.16.7 && \ ln -sf /opt/cmake-3.16.7/bin/* /usr/bin/ && \ - mkdir -p /lib/modules/5.15.0-8.91.4.1.el9uek.x86_64/ && \ - ln -s /usr/src/kernels/5.15.0-8.91.4.1.el9uek.x86_64/ /lib/modules/5.15.0-8.91.4.1.el9uek.x86_64/build && \ + mkdir -p /lib/modules/${VERSION}.el9uek.x86_64/ && \ + ln -s /usr/src/kernels/${VERSION}.el9uek.x86_64/ /lib/modules/${VERSION}.el9uek.x86_64/build && \ yum clean all && \ rm -rf /var/cache/yum diff --git a/images/x86_64/oraclelinux/5.15/Dockerfile.kernel b/images/x86_64/oraclelinux/5.15/Dockerfile.kernel index f8dc5e9..92ce86f 100644 --- a/images/x86_64/oraclelinux/5.15/Dockerfile.kernel +++ b/images/x86_64/oraclelinux/5.15/Dockerfile.kernel @@ -41,7 +41,7 @@ RUN yum groupinstall -y 'Development Tools' && \ cp -v /opt/initrd-builder/Makefile.virtio_mmio Makefile && \ curl -LO 'https://raw.githubusercontent.com/torvalds/linux/v5.15/drivers/virtio/virtio_mmio.c' && \ sed -ie 's/virtio-mmio/my-virtio-mmio/g' virtio_mmio.c && \ - KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.el9uek.x86_64/" make + KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.el9uek.${ARCH}/" make FROM initrd-builder:0.0.1 AS stage2 diff --git a/images/x86_64/oraclelinux/5.4/Dockerfile b/images/x86_64/oraclelinux/5.4/Dockerfile index 6f99177..59d7964 100644 --- a/images/x86_64/oraclelinux/5.4/Dockerfile +++ b/images/x86_64/oraclelinux/5.4/Dockerfile @@ -29,7 +29,7 @@ RUN yum install -y \ rm -vf cmake-3.16.7-Linux-x86_64.tar.gz && \ mv cmake-3.16.7-Linux-x86_64 /opt/cmake-3.16.7 && \ ln -sf /opt/cmake-3.16.7/bin/* /usr/bin/ && \ - mkdir -p /lib/modules/5.4.17-2136.320.7.1.el8uek.x86_64/ && \ - ln -s /usr/src/kernels/5.4.17-2136.320.7.1.el8uek.x86_64/ /lib/modules/5.4.17-2136.320.7.1.el8uek.x86_64/build && \ + mkdir -p /lib/modules/${VERSION}.el8uek.x86_64/ && \ + ln -s /usr/src/kernels/${VERSION}.el8uek.x86_64/ /lib/modules/${VERSION}.el8uek.x86_64/build && \ yum clean all && \ rm -rf /var/cache/yum diff --git a/images/x86_64/oraclelinux/5.4/Dockerfile.kernel b/images/x86_64/oraclelinux/5.4/Dockerfile.kernel index 89a5e8d..d91cf70 100644 --- a/images/x86_64/oraclelinux/5.4/Dockerfile.kernel +++ b/images/x86_64/oraclelinux/5.4/Dockerfile.kernel @@ -38,7 +38,7 @@ RUN yum groupinstall -y 'Development Tools' && \ cp -v /opt/initrd-builder/Makefile.virtio_mmio Makefile && \ curl -LO 'https://raw.githubusercontent.com/torvalds/linux/v5.4/drivers/virtio/virtio_mmio.c' && \ sed -ie 's/virtio-mmio/my-virtio-mmio/g' virtio_mmio.c && \ - KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.el8uek.x86_64/" make + KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.el8uek.${ARCH}/" make FROM initrd-builder:0.0.1 AS stage2 From 51ad010081d93c1ccb5f599de762cc948ae6f1ee Mon Sep 17 00:00:00 2001 From: Federico Di Pierro Date: Wed, 31 Jan 2024 10:13:49 +0100 Subject: [PATCH 12/17] chore(images): more fixes. Signed-off-by: Federico Di Pierro --- images/aarch64/amazonlinux2/5.4/Dockerfile | 10 +++++----- images/aarch64/amazonlinux2/5.4/Dockerfile.kernel | 13 ++++++++----- images/aarch64/amazonlinux2022/5.15/Dockerfile | 10 +++++----- .../aarch64/amazonlinux2022/5.15/Dockerfile.kernel | 13 ++++++++----- images/aarch64/fedora/6.2/Dockerfile.kernel | 9 +++++++-- images/aarch64/oraclelinux/4.14/Dockerfile.kernel | 7 +++++-- images/aarch64/oraclelinux/5.15/Dockerfile.kernel | 8 ++++++-- images/x86_64/amazonlinux2/4.19/Dockerfile.kernel | 4 ++-- images/x86_64/amazonlinux2/5.10/Dockerfile.kernel | 4 ++-- images/x86_64/amazonlinux2/5.15/Dockerfile.kernel | 4 ++-- images/x86_64/amazonlinux2/5.4/Dockerfile.kernel | 4 ++-- .../x86_64/amazonlinux2022/5.15/Dockerfile.kernel | 8 ++++---- images/x86_64/amazonlinux2023/6.1/Dockerfile.kernel | 8 ++++---- images/x86_64/centos/3.10/Dockerfile.kernel | 6 +++--- images/x86_64/oraclelinux/2.6/Dockerfile.kernel | 2 +- images/x86_64/oraclelinux/3.10/Dockerfile.kernel | 2 +- 16 files changed, 65 insertions(+), 47 deletions(-) diff --git a/images/aarch64/amazonlinux2/5.4/Dockerfile b/images/aarch64/amazonlinux2/5.4/Dockerfile index 6436447..f8286f8 100644 --- a/images/aarch64/amazonlinux2/5.4/Dockerfile +++ b/images/aarch64/amazonlinux2/5.4/Dockerfile @@ -1,6 +1,6 @@ FROM amazonlinux:2 -ARG VERSION=5.4.247-162 +ARG VERSION=5.4.247-162.350 ARG URL='http://amazonlinux.us-east-1.amazonaws.com/2/extras/kernel-5.4/latest/aarch64' RUN yum install -y \ @@ -23,9 +23,9 @@ RUN yum install -y \ URL=$(cat mirror.list) && \ curl -sLO "${URL}"/repodata/primary.xml.gz && \ gunzip primary.xml.gz && \ - grep -E 'kernel-headers-'${VERSION}'.*.rpm' primary.xml | grep href | cut -d\" -f2 | \ + grep -E 'kernel-headers-'${VERSION}'.rpm' primary.xml | grep href | cut -d\" -f2 | \ xargs -I@ curl -Lo headers.rpm ${URL}/@ && \ - grep -E 'kernel-devel-'${VERSION}'.*.rpm' primary.xml | grep href | cut -d\" -f2 | \ + grep -E 'kernel-devel-'${VERSION}'.rpm' primary.xml | grep href | cut -d\" -f2 | \ xargs -I@ curl -Lo sources.rpm ${URL}/@ && \ yum install -y ./*.rpm && \ rm -v ./*.rpm && \ @@ -37,8 +37,8 @@ RUN yum install -y \ rm -vf cmake-3.19.8-Linux-aarch64.tar.gz && \ mv cmake-3.19.8-Linux-aarch64 /opt/cmake-3.19.8 && \ ln -sf /opt/cmake-3.19.8/bin/* /usr/bin/ && \ - mkdir -p /lib/modules/${VERSION}.350.amzn2.aarch64/ && \ - ln -s /usr/src/kernels/${VERSION}.350.amzn2.aarch64/ /lib/modules/${VERSION}.350.amzn2.aarch64/build && \ + mkdir -p /lib/modules/${VERSION}.amzn2.aarch64/ && \ + ln -s /usr/src/kernels/${VERSION}.amzn2.aarch64/ /lib/modules/${VERSION}.amzn2.aarch64/build && \ rm -vf /usr/bin/gcc /usr/bin/g++ && \ update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc10-gcc 100 --slave /usr/bin/g++ g++ /usr/bin/gcc10-c++ && \ update-alternatives --auto gcc && \ diff --git a/images/aarch64/amazonlinux2/5.4/Dockerfile.kernel b/images/aarch64/amazonlinux2/5.4/Dockerfile.kernel index e282570..93d392c 100644 --- a/images/aarch64/amazonlinux2/5.4/Dockerfile.kernel +++ b/images/aarch64/amazonlinux2/5.4/Dockerfile.kernel @@ -1,7 +1,10 @@ +ARG VERSION=5.4.247-162.350 +ARG URL='http://amazonlinux.us-east-1.amazonaws.com/2/extras/kernel-5.4/latest/aarch64' + FROM initrd-builder:0.0.1 AS stage1 -ARG VERSION=5.4.247-162 -ARG URL='http://amazonlinux.us-east-1.amazonaws.com/2/extras/kernel-5.4/latest/aarch64' +ARG VERSION +ARG URL WORKDIR /home/ubuntu @@ -10,9 +13,9 @@ RUN touch .placeholder && \ URL=$(cat mirror.list) && \ curl -sLO "${URL}"/repodata/primary.xml.gz && \ gunzip primary.xml.gz && \ - grep -E 'kernel-${VERSION}.*.rpm' primary.xml | grep href | cut -d\" -f2 | \ + grep -E 'kernel-'${VERSION}'.rpm' primary.xml | grep href | cut -d\" -f2 | \ xargs -I@ curl -Lo kernel.rpm ${URL}/@ && \ - grep -E 'kernel-devel-${VERSION}.*.rpm' primary.xml | grep href | cut -d\" -f2 | \ + grep -E 'kernel-devel-'${VERSION}'.rpm' primary.xml | grep href | cut -d\" -f2 | \ xargs -I@ curl -Lo headers.rpm ${URL}/@ && \ rpm2cpio kernel.rpm > kernel.cpio && \ rpm2cpio headers.rpm > headers.cpio && \ @@ -35,7 +38,7 @@ COPY --from=stage1 /opt/initrd-builder/* /opt/initrd-builder/ RUN yum groupinstall -y 'Development Tools' && \ cp -v /opt/initrd-builder/Makefile.virtio_mmio Makefile && \ curl -LO 'https://raw.githubusercontent.com/torvalds/linux/v5.4/drivers/virtio/virtio_mmio.c' && \ - KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.350.amzn2.aarch64/" make + KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.amzn2.aarch64/" make FROM initrd-builder:0.0.1 AS stage2 COPY --from=stage1 /home/ubuntu/extracted /home/ubuntu/extracted/ diff --git a/images/aarch64/amazonlinux2022/5.15/Dockerfile b/images/aarch64/amazonlinux2022/5.15/Dockerfile index 8b4f340..ec64dc3 100644 --- a/images/aarch64/amazonlinux2022/5.15/Dockerfile +++ b/images/aarch64/amazonlinux2022/5.15/Dockerfile @@ -1,6 +1,6 @@ FROM amazonlinux:2022 -ARG VERSION=5.15.73-45 +ARG VERSION=5.15.73-45.135 ARG URL='https://al2022-repos-us-east-1-9761ab97.s3.dualstack.us-east-1.amazonaws.com/core/mirrors/latest/aarch64' @@ -22,14 +22,14 @@ RUN dnf groupinstall -y 'Development Tools' && \ URL=$(cat mirror.list) && \ curl -sLO "${URL}"repodata/primary.xml.gz && \ gunzip primary.xml.gz && \ - grep -E 'kernel-headers-'${VERSION}'.*.rpm' primary.xml | grep href | cut -d\" -f2 | \ + grep -E 'kernel-headers-'${VERSION}'.rpm' primary.xml | grep href | cut -d\" -f2 | \ xargs -I@ curl -Lo headers.rpm ${URL}@ && \ - grep -E 'kernel-devel-'${VERSION}'.*.rpm' primary.xml | grep href | cut -d\" -f2 | \ + grep -E 'kernel-devel-'${VERSION}'.rpm' primary.xml | grep href | cut -d\" -f2 | \ xargs -I@ curl -Lo sources.rpm ${URL}@ && \ dnf install -y ./*.rpm && \ rm -f ./*.rpm && \ - mkdir -p /lib/modules/${VERSION}.135.amzn2022.aarch64/ && \ - ln -s /usr/src/kernels/${VERSION}.135.amzn2022.aarch64/ /lib/modules/${VERSION}.135.amzn2022.aarch64/build && \ + mkdir -p /lib/modules/${VERSION}.amzn2022.aarch64/ && \ + ln -s /usr/src/kernels/${VERSION}.amzn2022.aarch64/ /lib/modules/${VERSION}.amzn2022.aarch64/build && \ sed -i -e 's/^AcceptEnv LANG LC_\*$/#AcceptEnv LANG LC_*/' /etc/ssh/sshd_config && \ echo 'UseDNS no' >> /etc/ssh/sshd_config && \ echo "root:root" | chpasswd diff --git a/images/aarch64/amazonlinux2022/5.15/Dockerfile.kernel b/images/aarch64/amazonlinux2022/5.15/Dockerfile.kernel index e55a5ff..3ae1df1 100644 --- a/images/aarch64/amazonlinux2022/5.15/Dockerfile.kernel +++ b/images/aarch64/amazonlinux2022/5.15/Dockerfile.kernel @@ -1,7 +1,10 @@ +ARG VERSION=5.15.73-45.135 +ARG URL='https://al2022-repos-us-east-1-9761ab97.s3.dualstack.us-east-1.amazonaws.com/core/mirrors/latest/aarch64' + FROM initrd-builder:0.0.1 AS stage1 -ARG VERSION=5.15.73-45 -ARG URL='https://al2022-repos-us-east-1-9761ab97.s3.dualstack.us-east-1.amazonaws.com/core/mirrors/latest/aarch64' +ARG VERSION +ARG URL WORKDIR /home/ubuntu @@ -10,9 +13,9 @@ RUN touch .placeholder && \ URL=$(cat mirror.list) && \ curl -sLO "${URL}"repodata/primary.xml.gz && \ gunzip primary.xml.gz && \ - grep -E 'kernel-${VERSION}.*.rpm' primary.xml | grep href | cut -d\" -f2 | \ + grep -E 'kernel-'${VERSION}'.rpm' primary.xml | grep href | cut -d\" -f2 | \ xargs -I@ curl -Lo kernel.rpm ${URL}@ && \ - grep -E 'kernel-devel-${VERSION}.*.rpm' primary.xml | grep href | cut -d\" -f2 | \ + grep -E 'kernel-devel-'${VERSION}'.rpm' primary.xml | grep href | cut -d\" -f2 | \ xargs -I@ curl -Lo headers.rpm ${URL}@ && \ rpm2cpio kernel.rpm > kernel.cpio && \ rpm2cpio headers.rpm > headers.cpio && \ @@ -36,7 +39,7 @@ COPY --from=stage1 /opt/initrd-builder/* /opt/initrd-builder/ RUN dnf groupinstall -y 'Development Tools' && \ cp -v /opt/initrd-builder/Makefile.virtio_mmio Makefile && \ curl -LO 'https://raw.githubusercontent.com/torvalds/linux/v5.15/drivers/virtio/virtio_mmio.c' && \ - KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.135.amzn2022.aarch64/" make + KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.amzn2022.aarch64/" make FROM initrd-builder:0.0.1 AS stage2 COPY --from=stage1 /home/ubuntu/extracted /home/ubuntu/extracted/ diff --git a/images/aarch64/fedora/6.2/Dockerfile.kernel b/images/aarch64/fedora/6.2/Dockerfile.kernel index 5beae65..2657d2a 100644 --- a/images/aarch64/fedora/6.2/Dockerfile.kernel +++ b/images/aarch64/fedora/6.2/Dockerfile.kernel @@ -1,10 +1,15 @@ -FROM initrd-builder:0.0.1 AS stage1 - ARG VERSION=6.2.9-300 ARG HVERSION=6.2.6-300 ARG ARCH=aarch64 ARG URL='https://mirrors.kernel.org/fedora/releases/38/Everything/aarch64/os/Packages/k/' +FROM initrd-builder:0.0.1 AS stage1 + +ARG VERSION +ARG HVERSION +ARG ARCH +ARG URL + WORKDIR /home/ubuntu RUN touch .placeholder && \ diff --git a/images/aarch64/oraclelinux/4.14/Dockerfile.kernel b/images/aarch64/oraclelinux/4.14/Dockerfile.kernel index 1080542..fd19f60 100644 --- a/images/aarch64/oraclelinux/4.14/Dockerfile.kernel +++ b/images/aarch64/oraclelinux/4.14/Dockerfile.kernel @@ -1,8 +1,11 @@ -FROM initrd-builder:0.0.1 AS stage1 - ARG VERSION=4.14.35-2047.527.2 ARG URL='https://yum.oracle.com/repo/OracleLinux/OL7/latest/aarch64' +FROM initrd-builder:0.0.1 AS stage1 + +ARG VERSION +ARG URL + WORKDIR /home/ubuntu RUN touch .placeholder && \ diff --git a/images/aarch64/oraclelinux/5.15/Dockerfile.kernel b/images/aarch64/oraclelinux/5.15/Dockerfile.kernel index d505384..2305d07 100644 --- a/images/aarch64/oraclelinux/5.15/Dockerfile.kernel +++ b/images/aarch64/oraclelinux/5.15/Dockerfile.kernel @@ -1,9 +1,13 @@ -FROM initrd-builder:0.0.1 AS stage1 - ARG VERSION=5.15.0-8.91.4.1 ARG URL='https://yum.oracle.com/repo/OracleLinux/OL9/baseos/latest/aarch64' ARG ARCH='aarch64' +FROM initrd-builder:0.0.1 AS stage1 + +ARG VERSION +ARG ARCH +ARG URL + WORKDIR /home/ubuntu RUN touch .placeholder && \ diff --git a/images/x86_64/amazonlinux2/4.19/Dockerfile.kernel b/images/x86_64/amazonlinux2/4.19/Dockerfile.kernel index cab6033..a6e8e0a 100644 --- a/images/x86_64/amazonlinux2/4.19/Dockerfile.kernel +++ b/images/x86_64/amazonlinux2/4.19/Dockerfile.kernel @@ -15,9 +15,9 @@ RUN touch .placeholder && \ URL=$(cat mirror.list) && \ curl -sLO "${URL}"/repodata/primary.xml.gz && \ gunzip primary.xml.gz && \ - grep -E 'kernel-'${VERSION}'.*.rpm' primary.xml | grep href | cut -d\" -f2 | \ + grep -E 'kernel-'${VERSION}'.rpm' primary.xml | grep href | cut -d\" -f2 | \ xargs -I@ curl -Lo kernel.rpm ${URL}/@ && \ - grep -E 'kernel-devel-'${VERSION}'.*.rpm' primary.xml | grep href | cut -d\" -f2 | \ + grep -E 'kernel-devel-'${VERSION}'.rpm' primary.xml | grep href | cut -d\" -f2 | \ xargs -I@ curl -Lo headers.rpm ${URL}/@ && \ rpm2cpio kernel.rpm > kernel.cpio && \ rpm2cpio headers.rpm > headers.cpio && \ diff --git a/images/x86_64/amazonlinux2/5.10/Dockerfile.kernel b/images/x86_64/amazonlinux2/5.10/Dockerfile.kernel index 5d74600..257067f 100644 --- a/images/x86_64/amazonlinux2/5.10/Dockerfile.kernel +++ b/images/x86_64/amazonlinux2/5.10/Dockerfile.kernel @@ -15,9 +15,9 @@ RUN touch .placeholder && \ URL=$(cat mirror.list) && \ curl -sLO "${URL}"/repodata/primary.xml.gz && \ gunzip primary.xml.gz && \ - grep -E 'kernel-'${VERSION}'.*.rpm' primary.xml | grep href | cut -d\" -f2 | \ + grep -E 'kernel-'${VERSION}'.rpm' primary.xml | grep href | cut -d\" -f2 | \ xargs -I@ curl -Lo kernel.rpm ${URL}/@ && \ - grep -E 'kernel-devel-'${VERSION}'.*.rpm' primary.xml | grep href | cut -d\" -f2 | \ + grep -E 'kernel-devel-'${VERSION}'.rpm' primary.xml | grep href | cut -d\" -f2 | \ xargs -I@ curl -Lo headers.rpm ${URL}/@ && \ rpm2cpio kernel.rpm > kernel.cpio && \ rpm2cpio headers.rpm > headers.cpio && \ diff --git a/images/x86_64/amazonlinux2/5.15/Dockerfile.kernel b/images/x86_64/amazonlinux2/5.15/Dockerfile.kernel index d5e9207..dea737f 100644 --- a/images/x86_64/amazonlinux2/5.15/Dockerfile.kernel +++ b/images/x86_64/amazonlinux2/5.15/Dockerfile.kernel @@ -15,9 +15,9 @@ RUN touch .placeholder && \ URL=$(cat mirror.list) && \ curl -sLO "${URL}"/repodata/primary.xml.gz && \ gunzip primary.xml.gz && \ - grep -E 'kernel-'${VERSION}'.*.rpm' primary.xml | grep href | cut -d\" -f2 | \ + grep -E 'kernel-'${VERSION}'.rpm' primary.xml | grep href | cut -d\" -f2 | \ xargs -I@ curl -Lo kernel.rpm ${URL}/@ && \ - grep -E 'kernel-devel-'${VERSION}'.*.rpm' primary.xml | grep href | cut -d\" -f2 | \ + grep -E 'kernel-devel-'${VERSION}'.rpm' primary.xml | grep href | cut -d\" -f2 | \ xargs -I@ curl -Lo headers.rpm ${URL}/@ && \ rpm2cpio kernel.rpm > kernel.cpio && \ rpm2cpio headers.rpm > headers.cpio && \ diff --git a/images/x86_64/amazonlinux2/5.4/Dockerfile.kernel b/images/x86_64/amazonlinux2/5.4/Dockerfile.kernel index 47a7249..ae9fe69 100644 --- a/images/x86_64/amazonlinux2/5.4/Dockerfile.kernel +++ b/images/x86_64/amazonlinux2/5.4/Dockerfile.kernel @@ -15,9 +15,9 @@ RUN touch .placeholder && \ URL=$(cat mirror.list) && \ curl -sLO "${URL}"/repodata/primary.xml.gz && \ gunzip primary.xml.gz && \ - grep -E 'kernel-'${VERSION}'.*.rpm' primary.xml | grep href | cut -d\" -f2 | \ + grep -E 'kernel-'${VERSION}'.rpm' primary.xml | grep href | cut -d\" -f2 | \ xargs -I@ curl -Lo kernel.rpm ${URL}/@ && \ - grep -E 'kernel-devel-'${VERSION}'.*.rpm' primary.xml | grep href | cut -d\" -f2 | \ + grep -E 'kernel-devel-'${VERSION}'.rpm' primary.xml | grep href | cut -d\" -f2 | \ xargs -I@ curl -Lo headers.rpm ${URL}/@ && \ rpm2cpio kernel.rpm > kernel.cpio && \ rpm2cpio headers.rpm > headers.cpio && \ diff --git a/images/x86_64/amazonlinux2022/5.15/Dockerfile.kernel b/images/x86_64/amazonlinux2022/5.15/Dockerfile.kernel index 42caf85..b8e9b26 100644 --- a/images/x86_64/amazonlinux2022/5.15/Dockerfile.kernel +++ b/images/x86_64/amazonlinux2022/5.15/Dockerfile.kernel @@ -1,4 +1,4 @@ -ARG VERSION=5.15.73-45 +ARG VERSION=5.15.73-45.135 ARG URL='https://al2022-repos-us-east-1-9761ab97.s3.dualstack.us-east-1.amazonaws.com/core/mirrors/latest/x86_64' ARG ARCH=x86_64 @@ -15,9 +15,9 @@ RUN touch .placeholder && \ URL=$(cat mirror.list) && \ curl -sLO "${URL}"repodata/primary.xml.gz && \ gunzip primary.xml.gz && \ - grep -E 'kernel-'${VERSION}'.*.rpm' primary.xml | grep href | cut -d\" -f2 | \ + grep -E 'kernel-'${VERSION}'.rpm' primary.xml | grep href | cut -d\" -f2 | \ xargs -I@ curl -Lo kernel.rpm ${URL}@ && \ - grep -E 'kernel-devel-'${VERSION}'.*.rpm' primary.xml | grep href | cut -d\" -f2 | \ + grep -E 'kernel-devel-'${VERSION}'.rpm' primary.xml | grep href | cut -d\" -f2 | \ xargs -I@ curl -Lo headers.rpm "${URL}@" && \ rpm2cpio kernel.rpm > kernel.cpio && \ rpm2cpio headers.rpm > headers.cpio && \ @@ -41,7 +41,7 @@ COPY --from=stage1 /opt/initrd-builder/* /opt/initrd-builder/ RUN dnf groupinstall -y 'Development Tools' && \ cp -v /opt/initrd-builder/Makefile.virtio_mmio Makefile && \ curl -LO 'https://raw.githubusercontent.com/torvalds/linux/v5.15/drivers/virtio/virtio_mmio.c' && \ - KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.135.amzn2022.${ARCH}/" make + KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.amzn2022.${ARCH}/" make FROM initrd-builder:0.0.1 AS stage2 COPY --from=stage1 /home/ubuntu/extracted /home/ubuntu/extracted/ diff --git a/images/x86_64/amazonlinux2023/6.1/Dockerfile.kernel b/images/x86_64/amazonlinux2023/6.1/Dockerfile.kernel index 1a8915f..640a065 100644 --- a/images/x86_64/amazonlinux2023/6.1/Dockerfile.kernel +++ b/images/x86_64/amazonlinux2023/6.1/Dockerfile.kernel @@ -1,4 +1,4 @@ -ARG VERSION=6.1.34-58 +ARG VERSION=6.1.34-58.102 ARG URL='https://cdn.amazonlinux.com/al2023/core/mirrors/latest/x86_64' ARG ARCH=x86_64 @@ -15,9 +15,9 @@ RUN touch .placeholder && \ URL=$(cat mirror.list) && \ curl -sLO "${URL}"repodata/primary.xml.gz && \ gunzip primary.xml.gz && \ - grep -E 'kernel-'${VERSION}'.*.rpm' primary.xml | grep href | cut -d\" -f2 | \ + grep -E 'kernel-'${VERSION}'.rpm' primary.xml | grep href | cut -d\" -f2 | \ xargs -I@ curl -Lo kernel.rpm ${URL}@ && \ - grep -E 'kernel-devel-'${VERSION}'.*.rpm' primary.xml | grep href | cut -d\" -f2 | \ + grep -E 'kernel-devel-'${VERSION}'.rpm' primary.xml | grep href | cut -d\" -f2 | \ xargs -I@ curl -Lo headers.rpm "${URL}@" && \ rpm2cpio kernel.rpm > kernel.cpio && \ rpm2cpio headers.rpm > headers.cpio && \ @@ -41,7 +41,7 @@ COPY --from=stage1 /opt/initrd-builder/* /opt/initrd-builder/ RUN dnf groupinstall -y 'Development Tools' && \ cp -v /opt/initrd-builder/Makefile.virtio_mmio Makefile && \ curl -LO 'https://raw.githubusercontent.com/torvalds/linux/v6.1/drivers/virtio/virtio_mmio.c' && \ - KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.102.amzn2023.${ARCH}/" make + KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.amzn2023.${ARCH}/" make FROM initrd-builder:0.0.1 AS stage2 COPY --from=stage1 /home/ubuntu/extracted /home/ubuntu/extracted/ diff --git a/images/x86_64/centos/3.10/Dockerfile.kernel b/images/x86_64/centos/3.10/Dockerfile.kernel index 5537704..e5ff41c 100644 --- a/images/x86_64/centos/3.10/Dockerfile.kernel +++ b/images/x86_64/centos/3.10/Dockerfile.kernel @@ -37,13 +37,13 @@ RUN yum groupinstall -y 'Development Tools' && \ cp -v /opt/initrd-builder/Makefile.virtio_mmio Makefile && \ mkdir src && \ cd src && \ - curl -Lo source.rpm 'https://archive.kernel.org/centos-vault/7.9.2009/os/Source/SPackages/kernel-${VERSION}.el7.src.rpm' && \ + curl -Lo source.rpm 'https://archive.kernel.org/centos-vault/7.9.2009/os/Source/SPackages/kernel-'${VERSION}'.el7.src.rpm' && \ rpm2cpio source.rpm > source.cpio && \ cpio -idmv < source.cpio && \ - tar -xaf 'linux-${VERSION}.el7.tar.xz' && \ + tar -xaf 'linux-'${VERSION}'.el7.tar.xz' && \ cd .. && \ find src -name 'virtio_mmio.c' -exec cp -v {} . \; && \ - KERNEL_DIR='/home/ubuntu/extracted/usr/src/kernels/${VERSION}.el7.${ARCH}/' make + KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.el7.${ARCH}/" make FROM initrd-builder:0.0.1 AS stage2 COPY --from=stage1 /home/ubuntu/extracted /home/ubuntu/extracted/ diff --git a/images/x86_64/oraclelinux/2.6/Dockerfile.kernel b/images/x86_64/oraclelinux/2.6/Dockerfile.kernel index 90c5e74..0123036 100644 --- a/images/x86_64/oraclelinux/2.6/Dockerfile.kernel +++ b/images/x86_64/oraclelinux/2.6/Dockerfile.kernel @@ -37,7 +37,7 @@ RUN yum groupinstall -y 'Development Tools' && \ yum install -y gcc && \ mkdir src && \ cd src && \ - curl -Lo source.rpm 'https://oss.oracle.com/ol6/SRPMS-updates/kernel-uek-${VERSION}.el6uek.src.rpm' && \ + curl -Lo source.rpm 'https://oss.oracle.com/ol6/SRPMS-updates/kernel-uek-'${VERSION}'.el6uek.src.rpm' && \ rpm2cpio source.rpm > source.cpio && \ cpio -idmv < ./source.cpio && \ tar -xaf linux-2.6.*.tar.bz2 && \ diff --git a/images/x86_64/oraclelinux/3.10/Dockerfile.kernel b/images/x86_64/oraclelinux/3.10/Dockerfile.kernel index 9a2ef75..5f617e5 100644 --- a/images/x86_64/oraclelinux/3.10/Dockerfile.kernel +++ b/images/x86_64/oraclelinux/3.10/Dockerfile.kernel @@ -37,7 +37,7 @@ RUN yum groupinstall -y 'Development Tools' && \ yum install -y gcc elfutils-libelf-devel && \ mkdir src && \ cd src && \ - curl -Lo source.rpm 'https://oss.oracle.com/ol7/SRPMS-updates/kernel-${VERSION}.el7.src.rpm' && \ + curl -Lo source.rpm 'https://oss.oracle.com/ol7/SRPMS-updates/kernel-'${VERSION}'.el7.src.rpm' && \ rpm2cpio source.rpm > source.cpio && \ cpio -idmv < ./source.cpio && \ tar -xaf linux-3.10.*.tar.xz && \ From e8bddbdccd5497d97ad91caacb14015841a05bca Mon Sep 17 00:00:00 2001 From: Federico Di Pierro Date: Wed, 31 Jan 2024 11:04:41 +0100 Subject: [PATCH 13/17] chore(images): more fixes. Signed-off-by: Federico Di Pierro --- images/aarch64/amazonlinux2/5.4/Dockerfile | 4 ++-- images/aarch64/amazonlinux2/5.4/Dockerfile.kernel | 4 ++-- images/aarch64/amazonlinux2022/5.15/Dockerfile | 4 ++-- images/aarch64/amazonlinux2022/5.15/Dockerfile.kernel | 4 ++-- images/x86_64/amazonlinux2/4.19/Dockerfile.kernel | 4 ++-- images/x86_64/amazonlinux2/5.10/Dockerfile.kernel | 4 ++-- images/x86_64/amazonlinux2/5.15/Dockerfile.kernel | 4 ++-- images/x86_64/amazonlinux2/5.4/Dockerfile.kernel | 4 ++-- images/x86_64/amazonlinux2022/5.15/Dockerfile.kernel | 4 ++-- images/x86_64/amazonlinux2023/6.1/Dockerfile.kernel | 4 ++-- 10 files changed, 20 insertions(+), 20 deletions(-) diff --git a/images/aarch64/amazonlinux2/5.4/Dockerfile b/images/aarch64/amazonlinux2/5.4/Dockerfile index f8286f8..757ac30 100644 --- a/images/aarch64/amazonlinux2/5.4/Dockerfile +++ b/images/aarch64/amazonlinux2/5.4/Dockerfile @@ -23,9 +23,9 @@ RUN yum install -y \ URL=$(cat mirror.list) && \ curl -sLO "${URL}"/repodata/primary.xml.gz && \ gunzip primary.xml.gz && \ - grep -E 'kernel-headers-'${VERSION}'.rpm' primary.xml | grep href | cut -d\" -f2 | \ + grep -E 'kernel-headers-'${VERSION}'.*.rpm' primary.xml | grep href | cut -d\" -f2 | \ xargs -I@ curl -Lo headers.rpm ${URL}/@ && \ - grep -E 'kernel-devel-'${VERSION}'.rpm' primary.xml | grep href | cut -d\" -f2 | \ + grep -E 'kernel-devel-'${VERSION}'.*.rpm' primary.xml | grep href | cut -d\" -f2 | \ xargs -I@ curl -Lo sources.rpm ${URL}/@ && \ yum install -y ./*.rpm && \ rm -v ./*.rpm && \ diff --git a/images/aarch64/amazonlinux2/5.4/Dockerfile.kernel b/images/aarch64/amazonlinux2/5.4/Dockerfile.kernel index 93d392c..f9b4238 100644 --- a/images/aarch64/amazonlinux2/5.4/Dockerfile.kernel +++ b/images/aarch64/amazonlinux2/5.4/Dockerfile.kernel @@ -13,9 +13,9 @@ RUN touch .placeholder && \ URL=$(cat mirror.list) && \ curl -sLO "${URL}"/repodata/primary.xml.gz && \ gunzip primary.xml.gz && \ - grep -E 'kernel-'${VERSION}'.rpm' primary.xml | grep href | cut -d\" -f2 | \ + grep -E 'kernel-'${VERSION}'.*.rpm' primary.xml | grep href | cut -d\" -f2 | \ xargs -I@ curl -Lo kernel.rpm ${URL}/@ && \ - grep -E 'kernel-devel-'${VERSION}'.rpm' primary.xml | grep href | cut -d\" -f2 | \ + grep -E 'kernel-devel-'${VERSION}'.*.rpm' primary.xml | grep href | cut -d\" -f2 | \ xargs -I@ curl -Lo headers.rpm ${URL}/@ && \ rpm2cpio kernel.rpm > kernel.cpio && \ rpm2cpio headers.rpm > headers.cpio && \ diff --git a/images/aarch64/amazonlinux2022/5.15/Dockerfile b/images/aarch64/amazonlinux2022/5.15/Dockerfile index ec64dc3..2182368 100644 --- a/images/aarch64/amazonlinux2022/5.15/Dockerfile +++ b/images/aarch64/amazonlinux2022/5.15/Dockerfile @@ -22,9 +22,9 @@ RUN dnf groupinstall -y 'Development Tools' && \ URL=$(cat mirror.list) && \ curl -sLO "${URL}"repodata/primary.xml.gz && \ gunzip primary.xml.gz && \ - grep -E 'kernel-headers-'${VERSION}'.rpm' primary.xml | grep href | cut -d\" -f2 | \ + grep -E 'kernel-headers-'${VERSION}'.*.rpm' primary.xml | grep href | cut -d\" -f2 | \ xargs -I@ curl -Lo headers.rpm ${URL}@ && \ - grep -E 'kernel-devel-'${VERSION}'.rpm' primary.xml | grep href | cut -d\" -f2 | \ + grep -E 'kernel-devel-'${VERSION}'.*.rpm' primary.xml | grep href | cut -d\" -f2 | \ xargs -I@ curl -Lo sources.rpm ${URL}@ && \ dnf install -y ./*.rpm && \ rm -f ./*.rpm && \ diff --git a/images/aarch64/amazonlinux2022/5.15/Dockerfile.kernel b/images/aarch64/amazonlinux2022/5.15/Dockerfile.kernel index 3ae1df1..c8af74e 100644 --- a/images/aarch64/amazonlinux2022/5.15/Dockerfile.kernel +++ b/images/aarch64/amazonlinux2022/5.15/Dockerfile.kernel @@ -13,9 +13,9 @@ RUN touch .placeholder && \ URL=$(cat mirror.list) && \ curl -sLO "${URL}"repodata/primary.xml.gz && \ gunzip primary.xml.gz && \ - grep -E 'kernel-'${VERSION}'.rpm' primary.xml | grep href | cut -d\" -f2 | \ + grep -E 'kernel-'${VERSION}'.*.rpm' primary.xml | grep href | cut -d\" -f2 | \ xargs -I@ curl -Lo kernel.rpm ${URL}@ && \ - grep -E 'kernel-devel-'${VERSION}'.rpm' primary.xml | grep href | cut -d\" -f2 | \ + grep -E 'kernel-devel-'${VERSION}'.*.rpm' primary.xml | grep href | cut -d\" -f2 | \ xargs -I@ curl -Lo headers.rpm ${URL}@ && \ rpm2cpio kernel.rpm > kernel.cpio && \ rpm2cpio headers.rpm > headers.cpio && \ diff --git a/images/x86_64/amazonlinux2/4.19/Dockerfile.kernel b/images/x86_64/amazonlinux2/4.19/Dockerfile.kernel index a6e8e0a..cab6033 100644 --- a/images/x86_64/amazonlinux2/4.19/Dockerfile.kernel +++ b/images/x86_64/amazonlinux2/4.19/Dockerfile.kernel @@ -15,9 +15,9 @@ RUN touch .placeholder && \ URL=$(cat mirror.list) && \ curl -sLO "${URL}"/repodata/primary.xml.gz && \ gunzip primary.xml.gz && \ - grep -E 'kernel-'${VERSION}'.rpm' primary.xml | grep href | cut -d\" -f2 | \ + grep -E 'kernel-'${VERSION}'.*.rpm' primary.xml | grep href | cut -d\" -f2 | \ xargs -I@ curl -Lo kernel.rpm ${URL}/@ && \ - grep -E 'kernel-devel-'${VERSION}'.rpm' primary.xml | grep href | cut -d\" -f2 | \ + grep -E 'kernel-devel-'${VERSION}'.*.rpm' primary.xml | grep href | cut -d\" -f2 | \ xargs -I@ curl -Lo headers.rpm ${URL}/@ && \ rpm2cpio kernel.rpm > kernel.cpio && \ rpm2cpio headers.rpm > headers.cpio && \ diff --git a/images/x86_64/amazonlinux2/5.10/Dockerfile.kernel b/images/x86_64/amazonlinux2/5.10/Dockerfile.kernel index 257067f..5d74600 100644 --- a/images/x86_64/amazonlinux2/5.10/Dockerfile.kernel +++ b/images/x86_64/amazonlinux2/5.10/Dockerfile.kernel @@ -15,9 +15,9 @@ RUN touch .placeholder && \ URL=$(cat mirror.list) && \ curl -sLO "${URL}"/repodata/primary.xml.gz && \ gunzip primary.xml.gz && \ - grep -E 'kernel-'${VERSION}'.rpm' primary.xml | grep href | cut -d\" -f2 | \ + grep -E 'kernel-'${VERSION}'.*.rpm' primary.xml | grep href | cut -d\" -f2 | \ xargs -I@ curl -Lo kernel.rpm ${URL}/@ && \ - grep -E 'kernel-devel-'${VERSION}'.rpm' primary.xml | grep href | cut -d\" -f2 | \ + grep -E 'kernel-devel-'${VERSION}'.*.rpm' primary.xml | grep href | cut -d\" -f2 | \ xargs -I@ curl -Lo headers.rpm ${URL}/@ && \ rpm2cpio kernel.rpm > kernel.cpio && \ rpm2cpio headers.rpm > headers.cpio && \ diff --git a/images/x86_64/amazonlinux2/5.15/Dockerfile.kernel b/images/x86_64/amazonlinux2/5.15/Dockerfile.kernel index dea737f..d5e9207 100644 --- a/images/x86_64/amazonlinux2/5.15/Dockerfile.kernel +++ b/images/x86_64/amazonlinux2/5.15/Dockerfile.kernel @@ -15,9 +15,9 @@ RUN touch .placeholder && \ URL=$(cat mirror.list) && \ curl -sLO "${URL}"/repodata/primary.xml.gz && \ gunzip primary.xml.gz && \ - grep -E 'kernel-'${VERSION}'.rpm' primary.xml | grep href | cut -d\" -f2 | \ + grep -E 'kernel-'${VERSION}'.*.rpm' primary.xml | grep href | cut -d\" -f2 | \ xargs -I@ curl -Lo kernel.rpm ${URL}/@ && \ - grep -E 'kernel-devel-'${VERSION}'.rpm' primary.xml | grep href | cut -d\" -f2 | \ + grep -E 'kernel-devel-'${VERSION}'.*.rpm' primary.xml | grep href | cut -d\" -f2 | \ xargs -I@ curl -Lo headers.rpm ${URL}/@ && \ rpm2cpio kernel.rpm > kernel.cpio && \ rpm2cpio headers.rpm > headers.cpio && \ diff --git a/images/x86_64/amazonlinux2/5.4/Dockerfile.kernel b/images/x86_64/amazonlinux2/5.4/Dockerfile.kernel index ae9fe69..47a7249 100644 --- a/images/x86_64/amazonlinux2/5.4/Dockerfile.kernel +++ b/images/x86_64/amazonlinux2/5.4/Dockerfile.kernel @@ -15,9 +15,9 @@ RUN touch .placeholder && \ URL=$(cat mirror.list) && \ curl -sLO "${URL}"/repodata/primary.xml.gz && \ gunzip primary.xml.gz && \ - grep -E 'kernel-'${VERSION}'.rpm' primary.xml | grep href | cut -d\" -f2 | \ + grep -E 'kernel-'${VERSION}'.*.rpm' primary.xml | grep href | cut -d\" -f2 | \ xargs -I@ curl -Lo kernel.rpm ${URL}/@ && \ - grep -E 'kernel-devel-'${VERSION}'.rpm' primary.xml | grep href | cut -d\" -f2 | \ + grep -E 'kernel-devel-'${VERSION}'.*.rpm' primary.xml | grep href | cut -d\" -f2 | \ xargs -I@ curl -Lo headers.rpm ${URL}/@ && \ rpm2cpio kernel.rpm > kernel.cpio && \ rpm2cpio headers.rpm > headers.cpio && \ diff --git a/images/x86_64/amazonlinux2022/5.15/Dockerfile.kernel b/images/x86_64/amazonlinux2022/5.15/Dockerfile.kernel index b8e9b26..652f9bf 100644 --- a/images/x86_64/amazonlinux2022/5.15/Dockerfile.kernel +++ b/images/x86_64/amazonlinux2022/5.15/Dockerfile.kernel @@ -15,9 +15,9 @@ RUN touch .placeholder && \ URL=$(cat mirror.list) && \ curl -sLO "${URL}"repodata/primary.xml.gz && \ gunzip primary.xml.gz && \ - grep -E 'kernel-'${VERSION}'.rpm' primary.xml | grep href | cut -d\" -f2 | \ + grep -E 'kernel-'${VERSION}'.*.rpm' primary.xml | grep href | cut -d\" -f2 | \ xargs -I@ curl -Lo kernel.rpm ${URL}@ && \ - grep -E 'kernel-devel-'${VERSION}'.rpm' primary.xml | grep href | cut -d\" -f2 | \ + grep -E 'kernel-devel-'${VERSION}'.*.rpm' primary.xml | grep href | cut -d\" -f2 | \ xargs -I@ curl -Lo headers.rpm "${URL}@" && \ rpm2cpio kernel.rpm > kernel.cpio && \ rpm2cpio headers.rpm > headers.cpio && \ diff --git a/images/x86_64/amazonlinux2023/6.1/Dockerfile.kernel b/images/x86_64/amazonlinux2023/6.1/Dockerfile.kernel index 640a065..d4f9639 100644 --- a/images/x86_64/amazonlinux2023/6.1/Dockerfile.kernel +++ b/images/x86_64/amazonlinux2023/6.1/Dockerfile.kernel @@ -15,9 +15,9 @@ RUN touch .placeholder && \ URL=$(cat mirror.list) && \ curl -sLO "${URL}"repodata/primary.xml.gz && \ gunzip primary.xml.gz && \ - grep -E 'kernel-'${VERSION}'.rpm' primary.xml | grep href | cut -d\" -f2 | \ + grep -E 'kernel-'${VERSION}'.*.rpm' primary.xml | grep href | cut -d\" -f2 | \ xargs -I@ curl -Lo kernel.rpm ${URL}@ && \ - grep -E 'kernel-devel-'${VERSION}'.rpm' primary.xml | grep href | cut -d\" -f2 | \ + grep -E 'kernel-devel-'${VERSION}'.*.rpm' primary.xml | grep href | cut -d\" -f2 | \ xargs -I@ curl -Lo headers.rpm "${URL}@" && \ rpm2cpio kernel.rpm > kernel.cpio && \ rpm2cpio headers.rpm > headers.cpio && \ From ec3b44f73b30a282cadf2ac72d6e24eb21834fd0 Mon Sep 17 00:00:00 2001 From: Federico Di Pierro Date: Wed, 31 Jan 2024 13:02:04 +0100 Subject: [PATCH 14/17] chore(images): use `ARCHITECTURE` in place of `ARCH` since `ARCH` might override kernel Makefile variable. Signed-off-by: Federico Di Pierro --- images/aarch64/fedora/6.2/Dockerfile | 10 ++++----- images/aarch64/fedora/6.2/Dockerfile.kernel | 22 +++++++++---------- images/aarch64/oraclelinux/5.15/Dockerfile | 12 +++++----- .../oraclelinux/5.15/Dockerfile.kernel | 15 ++++++------- .../amazonlinux2/4.19/Dockerfile.kernel | 8 +++---- .../amazonlinux2/5.10/Dockerfile.kernel | 8 +++---- .../amazonlinux2/5.15/Dockerfile.kernel | 8 +++---- .../x86_64/amazonlinux2/5.4/Dockerfile.kernel | 8 +++---- .../amazonlinux2022/5.15/Dockerfile.kernel | 8 +++---- .../amazonlinux2023/6.1/Dockerfile.kernel | 8 +++---- .../x86_64/archlinux/5.18/Dockerfile.kernel | 8 +++---- images/x86_64/archlinux/6.0/Dockerfile.kernel | 8 +++---- images/x86_64/archlinux/6.7/Dockerfile.kernel | 8 +++---- images/x86_64/centos/3.10/Dockerfile.kernel | 8 +++---- images/x86_64/centos/4.18/Dockerfile.kernel | 16 +++++++------- images/x86_64/centos/5.14/Dockerfile.kernel | 16 +++++++------- images/x86_64/fedora/5.17/Dockerfile.kernel | 16 +++++++------- images/x86_64/fedora/5.8/Dockerfile.kernel | 16 +++++++------- images/x86_64/fedora/6.2/Dockerfile.kernel | 18 +++++++-------- .../x86_64/oraclelinux/2.6/Dockerfile.kernel | 12 +++++----- .../x86_64/oraclelinux/3.10/Dockerfile.kernel | 12 +++++----- .../x86_64/oraclelinux/4.14/Dockerfile.kernel | 16 +++++++------- .../x86_64/oraclelinux/5.15/Dockerfile.kernel | 14 ++++++------ .../x86_64/oraclelinux/5.4/Dockerfile.kernel | 12 +++++----- 24 files changed, 142 insertions(+), 145 deletions(-) diff --git a/images/aarch64/fedora/6.2/Dockerfile b/images/aarch64/fedora/6.2/Dockerfile index 873090a..8b68e2c 100644 --- a/images/aarch64/fedora/6.2/Dockerfile +++ b/images/aarch64/fedora/6.2/Dockerfile @@ -2,7 +2,7 @@ FROM fedora:38 ARG VERSION=6.2.9-300 ARG HVERSION=6.2.6-300 -ARG ARCH=aarch64 +ARG ARCHITECTURE=aarch64 ARG URL='https://mirrors.kernel.org/fedora/releases/38/Everything/aarch64/os/Packages' RUN dnf groupinstall -y 'Development Tools' && \ @@ -15,12 +15,12 @@ RUN dnf groupinstall -y 'Development Tools' && \ openssh-server \ rsync \ systemd && \ - curl -Lo sources.rpm ${URL}/k/kernel-devel-${VERSION}.fc38.${ARCH}.rpm && \ - curl -Lo headers.rpm ${URL}/k/kernel-headers-${HVERSION}.fc38.${ARCH}.rpm && \ + curl -Lo sources.rpm ${URL}/k/kernel-devel-${VERSION}.fc38.${ARCHITECTURE}.rpm && \ + curl -Lo headers.rpm ${URL}/k/kernel-headers-${HVERSION}.fc38.${ARCHITECTURE}.rpm && \ dnf install -y ./*.rpm && \ rm -v ./*.rpm && \ - mkdir -p /lib/modules/${VERSION}.fc38.${ARCH} && \ - ln -s /usr/src/kernels/${VERSION}.fc38.${ARCH}/ /lib/modules/${VERSION}.fc38.${ARCH}/build && \ + mkdir -p /lib/modules/${VERSION}.fc38.${ARCHITECTURE} && \ + ln -s /usr/src/kernels/${VERSION}.fc38.${ARCHITECTURE}/ /lib/modules/${VERSION}.fc38.${ARCHITECTURE}/build && \ sed -i -e 's/^AcceptEnv LANG LC_\*$/#AcceptEnv LANG LC_*/' /etc/ssh/sshd_config && \ echo 'UseDNS no' >> /etc/ssh/sshd_config && \ echo "root:root" | chpasswd diff --git a/images/aarch64/fedora/6.2/Dockerfile.kernel b/images/aarch64/fedora/6.2/Dockerfile.kernel index 2657d2a..f35cc2a 100644 --- a/images/aarch64/fedora/6.2/Dockerfile.kernel +++ b/images/aarch64/fedora/6.2/Dockerfile.kernel @@ -1,23 +1,23 @@ ARG VERSION=6.2.9-300 ARG HVERSION=6.2.6-300 -ARG ARCH=aarch64 +ARG ARCHITECTURE=aarch64 ARG URL='https://mirrors.kernel.org/fedora/releases/38/Everything/aarch64/os/Packages/k/' FROM initrd-builder:0.0.1 AS stage1 ARG VERSION ARG HVERSION -ARG ARCH +ARG ARCHITECTURE ARG URL WORKDIR /home/ubuntu RUN touch .placeholder && \ - curl -Lo kernel.rpm ${URL}kernel-core-${VERSION}.fc38.${ARCH}.rpm && \ - curl -Lo headers.rpm ${URL}kernel-headers-${HVERSION}.fc38.${ARCH}.rpm && \ - curl -Lo modules.rpm ${URL}kernel-modules-${VERSION}.fc38.${ARCH}.rpm && \ - curl -Lo sources.rpm ${URL}kernel-devel-${VERSION}.fc38.${ARCH}.rpm && \ - curl -Lo modules-core.rpm ${URL}kernel-modules-core-${VERSION}.fc38.${ARCH}.rpm && \ + curl -Lo kernel.rpm ${URL}kernel-core-${VERSION}.fc38.${ARCHITECTURE}.rpm && \ + curl -Lo headers.rpm ${URL}kernel-headers-${HVERSION}.fc38.${ARCHITECTURE}.rpm && \ + curl -Lo modules.rpm ${URL}kernel-modules-${VERSION}.fc38.${ARCHITECTURE}.rpm && \ + curl -Lo sources.rpm ${URL}kernel-devel-${VERSION}.fc38.${ARCHITECTURE}.rpm && \ + curl -Lo modules-core.rpm ${URL}kernel-modules-core-${VERSION}.fc38.${ARCHITECTURE}.rpm && \ rpm2cpio kernel.rpm > kernel.cpio && \ rpm2cpio headers.rpm > headers.cpio && \ rpm2cpio modules.rpm > modules.cpio && \ @@ -32,7 +32,7 @@ RUN touch .placeholder && \ cpio -idmv < ../modules-core.cpio && \ find . -name '*.xz' -exec xz -d {} \; && \ VMLINUX=$(find lib/modules -name vmlinuz) ; \ - SKIP=$(objdump -EL -b binary -D -m ${ARCH} $VMLINUX | \ + SKIP=$(objdump -EL -b binary -D -m ${ARCHITECTURE} $VMLINUX | \ grep '00088b1f' | awk '{print $1}' | cut -d: -f1 | \ tr '[:lower:]' '[:upper:]' | xargs -I@ printf "%d" 0x@ ) ; \ dd if=$VMLINUX of=/home/ubuntu/extracted/vmlinux.gz bs=1 skip=$SKIP && \ @@ -43,9 +43,7 @@ RUN touch .placeholder && \ FROM fedora:38 as kmod-builder ARG VERSION -ARG HVERSION -ARG ARCH -ARG URL +ARG ARCHITECTURE WORKDIR /home/ubuntu COPY --from=stage1 /home/ubuntu/extracted /home/ubuntu/extracted/ @@ -55,7 +53,7 @@ COPY --from=stage1 /opt/initrd-builder/* /opt/initrd-builder/ RUN dnf groupinstall -y 'Development Tools' && \ cp -v /opt/initrd-builder/Makefile.virtio_mmio Makefile && \ curl -LO 'https://gitlab.com/cki-project/kernel-ark/-/raw/fedora-6.2/drivers/virtio/virtio_mmio.c' && \ - KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.fc38.${ARCH}/" make + KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.fc38.${ARCHITECTURE}/" make FROM initrd-builder:0.0.1 AS stage2 diff --git a/images/aarch64/oraclelinux/5.15/Dockerfile b/images/aarch64/oraclelinux/5.15/Dockerfile index 2e5c56c..523e090 100644 --- a/images/aarch64/oraclelinux/5.15/Dockerfile +++ b/images/aarch64/oraclelinux/5.15/Dockerfile @@ -2,7 +2,7 @@ FROM oraclelinux:9 ARG VERSION=5.15.0-8.91.4.1 ARG URL='https://yum.oracle.com/repo/OracleLinux/OL9/baseos/latest/aarch64' -ARG ARCH='aarch64' +ARG ARCHITECTURE='aarch64' RUN yum install -y \ binutils-devel \ @@ -18,9 +18,9 @@ RUN yum install -y \ rsync \ systemd \ tar && \ - curl -L -o kernel.rpm ${URL}/getPackage/kernel-uek-core-${VERSION}.el9uek.${ARCH}.rpm && \ - curl -L -o devel.rpm ${URL}/getPackage/kernel-uek-devel-${VERSION}.el9uek.${ARCH}.rpm && \ - curl -L -o modules.rpm ${URL}/getPackage/kernel-uek-modules-${VERSION}.el9uek.${ARCH}.rpm && \ + curl -L -o kernel.rpm ${URL}/getPackage/kernel-uek-core-${VERSION}.el9uek.${ARCHITECTURE}.rpm && \ + curl -L -o devel.rpm ${URL}/getPackage/kernel-uek-devel-${VERSION}.el9uek.${ARCHITECTURE}.rpm && \ + curl -L -o modules.rpm ${URL}/getPackage/kernel-uek-modules-${VERSION}.el9uek.${ARCHITECTURE}.rpm && \ yum install -y ./kernel.rpm ./devel.rpm ./modules.rpm && \ sed -i -e 's/^AcceptEnv LANG LC_\*$/#AcceptEnv LANG LC_*/' /etc/ssh/sshd_config && \ echo "root:root" | chpasswd && \ @@ -30,5 +30,5 @@ RUN yum install -y \ rm -vf cmake-3.19.8-Linux-aarch64.tar.gz && \ mv cmake-3.19.8-Linux-aarch64 /opt/cmake-3.19.8 && \ ln -sf /opt/cmake-3.19.8/bin/* /usr/bin/ && \ - mkdir -p /lib/modules/5.15.0-8.91.4.1.el9uek.${ARCH}/ && \ - ln -s /usr/src/kernels/5.15.0-8.91.4.1.el9uek.${ARCH}/ /lib/modules/5.15.0-8.91.4.1.el9uek.${ARCH}/build + mkdir -p /lib/modules/5.15.0-8.91.4.1.el9uek.${ARCHITECTURE}/ && \ + ln -s /usr/src/kernels/5.15.0-8.91.4.1.el9uek.${ARCHITECTURE}/ /lib/modules/5.15.0-8.91.4.1.el9uek.${ARCHITECTURE}/build diff --git a/images/aarch64/oraclelinux/5.15/Dockerfile.kernel b/images/aarch64/oraclelinux/5.15/Dockerfile.kernel index 2305d07..93705bb 100644 --- a/images/aarch64/oraclelinux/5.15/Dockerfile.kernel +++ b/images/aarch64/oraclelinux/5.15/Dockerfile.kernel @@ -1,19 +1,19 @@ ARG VERSION=5.15.0-8.91.4.1 ARG URL='https://yum.oracle.com/repo/OracleLinux/OL9/baseos/latest/aarch64' -ARG ARCH='aarch64' +ARG ARCHITECTURE='aarch64' FROM initrd-builder:0.0.1 AS stage1 ARG VERSION -ARG ARCH +ARG ARCHITECTURE ARG URL WORKDIR /home/ubuntu RUN touch .placeholder && \ - curl -L -o kernel.rpm ${URL}/getPackage/kernel-uek-core-${VERSION}.el9uek.${ARCH}.rpm && \ - curl -L -o devel.rpm ${URL}/getPackage/kernel-uek-devel-${VERSION}.el9uek.${ARCH}.rpm && \ - curl -L -o modules.rpm ${URL}/getPackage/kernel-uek-modules-${VERSION}.el9uek.${ARCH}.rpm && \ + curl -L -o kernel.rpm ${URL}/getPackage/kernel-uek-core-${VERSION}.el9uek.${ARCHITECTURE}.rpm && \ + curl -L -o devel.rpm ${URL}/getPackage/kernel-uek-devel-${VERSION}.el9uek.${ARCHITECTURE}.rpm && \ + curl -L -o modules.rpm ${URL}/getPackage/kernel-uek-modules-${VERSION}.el9uek.${ARCHITECTURE}.rpm && \ rpm2cpio kernel.rpm > kernel.cpio && \ rpm2cpio devel.rpm > devel.cpio && \ rpm2cpio modules.rpm > modules.cpio && \ @@ -29,8 +29,7 @@ RUN touch .placeholder && \ FROM oraclelinux:9 as kmod-builder ARG VERSION -ARG ARCH -ARG URL +ARG ARCHITECTURE WORKDIR /home/ubuntu COPY --from=stage1 /home/ubuntu/extracted /home/ubuntu/extracted/ @@ -41,7 +40,7 @@ RUN yum groupinstall -y 'Development Tools' && \ cp -v /opt/initrd-builder/Makefile.virtio_mmio Makefile && \ curl -LO 'https://raw.githubusercontent.com/torvalds/linux/v5.15/drivers/virtio/virtio_mmio.c' && \ sed -ie 's/virtio-mmio/my-virtio-mmio/g' virtio_mmio.c && \ - KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.el9uek.${ARCH}/" make + KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.el9uek.${ARCHITECTURE}/" make FROM initrd-builder:0.0.1 AS stage2 diff --git a/images/x86_64/amazonlinux2/4.19/Dockerfile.kernel b/images/x86_64/amazonlinux2/4.19/Dockerfile.kernel index cab6033..cdd3f4f 100644 --- a/images/x86_64/amazonlinux2/4.19/Dockerfile.kernel +++ b/images/x86_64/amazonlinux2/4.19/Dockerfile.kernel @@ -1,12 +1,12 @@ ARG VERSION=4.19.84-33.70 ARG URL='http://amazonlinux.us-east-1.amazonaws.com/2/extras/kernel-ng/latest/x86_64' -ARG ARCH=x86_64 +ARG ARCHITECTURE=x86_64 FROM initrd-builder:0.0.1 AS stage1 ARG VERSION ARG URL -ARG ARCH +ARG ARCHITECTURE WORKDIR /home/ubuntu @@ -32,7 +32,7 @@ FROM amazonlinux:2 as kmod-builder ARG VERSION ARG URL -ARG ARCH +ARG ARCHITECTURE WORKDIR /home/ubuntu COPY --from=stage1 /home/ubuntu/extracted /home/ubuntu/extracted/ @@ -41,7 +41,7 @@ COPY --from=stage1 /opt/initrd-builder/* /opt/initrd-builder/ RUN yum groupinstall -y 'Development Tools' && \ cp -v /opt/initrd-builder/Makefile.virtio_mmio Makefile && \ curl -LO 'https://raw.githubusercontent.com/torvalds/linux/v4.19/drivers/virtio/virtio_mmio.c' && \ - KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.amzn2.${ARCH}/" make + KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.amzn2.${ARCHITECTURE}/" make FROM initrd-builder:0.0.1 AS stage2 COPY --from=stage1 /home/ubuntu/extracted /home/ubuntu/extracted/ diff --git a/images/x86_64/amazonlinux2/5.10/Dockerfile.kernel b/images/x86_64/amazonlinux2/5.10/Dockerfile.kernel index 5d74600..32ade69 100644 --- a/images/x86_64/amazonlinux2/5.10/Dockerfile.kernel +++ b/images/x86_64/amazonlinux2/5.10/Dockerfile.kernel @@ -1,12 +1,12 @@ ARG VERSION=5.10.184-175.749 ARG URL='http://amazonlinux.us-east-1.amazonaws.com/2/extras/kernel-5.10/latest/x86_64' -ARG ARCH=x86_64 +ARG ARCHITECTURE=x86_64 FROM initrd-builder:0.0.1 AS stage1 ARG VERSION ARG URL -ARG ARCH +ARG ARCHITECTURE WORKDIR /home/ubuntu @@ -32,7 +32,7 @@ FROM amazonlinux:2 as kmod-builder ARG VERSION ARG URL -ARG ARCH +ARG ARCHITECTURE WORKDIR /home/ubuntu COPY --from=stage1 /home/ubuntu/extracted /home/ubuntu/extracted/ @@ -42,7 +42,7 @@ RUN yum groupinstall -y 'Development Tools' && \ yum install -y gcc10 && \ cp -v /opt/initrd-builder/Makefile.virtio_mmio Makefile && \ curl -LO 'https://raw.githubusercontent.com/torvalds/linux/v5.10/drivers/virtio/virtio_mmio.c' && \ - KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.amzn2.${ARCH}/" make + KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.amzn2.${ARCHITECTURE}/" make FROM initrd-builder:0.0.1 AS stage2 COPY --from=stage1 /home/ubuntu/extracted /home/ubuntu/extracted/ diff --git a/images/x86_64/amazonlinux2/5.15/Dockerfile.kernel b/images/x86_64/amazonlinux2/5.15/Dockerfile.kernel index d5e9207..8569dd4 100644 --- a/images/x86_64/amazonlinux2/5.15/Dockerfile.kernel +++ b/images/x86_64/amazonlinux2/5.15/Dockerfile.kernel @@ -1,12 +1,12 @@ ARG VERSION=5.15.117-73.143 ARG URL='http://amazonlinux.us-east-1.amazonaws.com/2/extras/kernel-5.15/latest/x86_64' -ARG ARCH=x86_64 +ARG ARCHITECTURE=x86_64 FROM initrd-builder:0.0.1 AS stage1 ARG VERSION ARG URL -ARG ARCH +ARG ARCHITECTURE WORKDIR /home/ubuntu @@ -32,7 +32,7 @@ FROM amazonlinux:2 as kmod-builder ARG VERSION ARG URL -ARG ARCH +ARG ARCHITECTURE WORKDIR /home/ubuntu COPY --from=stage1 /home/ubuntu/extracted /home/ubuntu/extracted/ @@ -42,7 +42,7 @@ RUN yum groupinstall -y 'Development Tools' && \ yum install -y gcc10 && \ cp -v /opt/initrd-builder/Makefile.virtio_mmio Makefile && \ curl -LO 'https://raw.githubusercontent.com/torvalds/linux/v5.15/drivers/virtio/virtio_mmio.c' && \ - KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.amzn2.${ARCH}/" make + KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.amzn2.${ARCHITECTURE}/" make FROM initrd-builder:0.0.1 AS stage2 COPY --from=stage1 /home/ubuntu/extracted /home/ubuntu/extracted/ diff --git a/images/x86_64/amazonlinux2/5.4/Dockerfile.kernel b/images/x86_64/amazonlinux2/5.4/Dockerfile.kernel index 47a7249..1fef308 100644 --- a/images/x86_64/amazonlinux2/5.4/Dockerfile.kernel +++ b/images/x86_64/amazonlinux2/5.4/Dockerfile.kernel @@ -1,12 +1,12 @@ ARG VERSION=5.4.247-162.350 ARG URL='http://amazonlinux.us-east-1.amazonaws.com/2/extras/kernel-5.4/latest/x86_64' -ARG ARCH=x86_64 +ARG ARCHITECTURE=x86_64 FROM initrd-builder:0.0.1 AS stage1 ARG VERSION ARG URL -ARG ARCH +ARG ARCHITECTURE WORKDIR /home/ubuntu @@ -32,7 +32,7 @@ FROM amazonlinux:2 as kmod-builder ARG VERSION ARG URL -ARG ARCH +ARG ARCHITECTURE WORKDIR /home/ubuntu COPY --from=stage1 /home/ubuntu/extracted /home/ubuntu/extracted/ @@ -41,7 +41,7 @@ COPY --from=stage1 /opt/initrd-builder/* /opt/initrd-builder/ RUN yum groupinstall -y 'Development Tools' && \ cp -v /opt/initrd-builder/Makefile.virtio_mmio Makefile && \ curl -LO 'https://raw.githubusercontent.com/torvalds/linux/v5.4/drivers/virtio/virtio_mmio.c' && \ - KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.amzn2.${ARCH}/" make + KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.amzn2.${ARCHITECTURE}/" make FROM initrd-builder:0.0.1 AS stage2 COPY --from=stage1 /home/ubuntu/extracted /home/ubuntu/extracted/ diff --git a/images/x86_64/amazonlinux2022/5.15/Dockerfile.kernel b/images/x86_64/amazonlinux2022/5.15/Dockerfile.kernel index 652f9bf..d670bab 100644 --- a/images/x86_64/amazonlinux2022/5.15/Dockerfile.kernel +++ b/images/x86_64/amazonlinux2022/5.15/Dockerfile.kernel @@ -1,12 +1,12 @@ ARG VERSION=5.15.73-45.135 ARG URL='https://al2022-repos-us-east-1-9761ab97.s3.dualstack.us-east-1.amazonaws.com/core/mirrors/latest/x86_64' -ARG ARCH=x86_64 +ARG ARCHITECTURE=x86_64 FROM initrd-builder:0.0.1 AS stage1 ARG VERSION ARG URL -ARG ARCH +ARG ARCHITECTURE WORKDIR /home/ubuntu @@ -32,7 +32,7 @@ FROM amazonlinux:2023 as kmod-builder ARG VERSION ARG URL -ARG ARCH +ARG ARCHITECTURE WORKDIR /home/ubuntu COPY --from=stage1 /home/ubuntu/extracted /home/ubuntu/extracted/ @@ -41,7 +41,7 @@ COPY --from=stage1 /opt/initrd-builder/* /opt/initrd-builder/ RUN dnf groupinstall -y 'Development Tools' && \ cp -v /opt/initrd-builder/Makefile.virtio_mmio Makefile && \ curl -LO 'https://raw.githubusercontent.com/torvalds/linux/v5.15/drivers/virtio/virtio_mmio.c' && \ - KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.amzn2022.${ARCH}/" make + KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.amzn2022.${ARCHITECTURE}/" make FROM initrd-builder:0.0.1 AS stage2 COPY --from=stage1 /home/ubuntu/extracted /home/ubuntu/extracted/ diff --git a/images/x86_64/amazonlinux2023/6.1/Dockerfile.kernel b/images/x86_64/amazonlinux2023/6.1/Dockerfile.kernel index d4f9639..17214a3 100644 --- a/images/x86_64/amazonlinux2023/6.1/Dockerfile.kernel +++ b/images/x86_64/amazonlinux2023/6.1/Dockerfile.kernel @@ -1,12 +1,12 @@ ARG VERSION=6.1.34-58.102 ARG URL='https://cdn.amazonlinux.com/al2023/core/mirrors/latest/x86_64' -ARG ARCH=x86_64 +ARG ARCHITECTURE=x86_64 FROM initrd-builder:0.0.1 AS stage1 ARG VERSION ARG URL -ARG ARCH +ARG ARCHITECTURE WORKDIR /home/ubuntu @@ -32,7 +32,7 @@ FROM amazonlinux:2023 as kmod-builder ARG VERSION ARG URL -ARG ARCH +ARG ARCHITECTURE WORKDIR /home/ubuntu COPY --from=stage1 /home/ubuntu/extracted /home/ubuntu/extracted/ @@ -41,7 +41,7 @@ COPY --from=stage1 /opt/initrd-builder/* /opt/initrd-builder/ RUN dnf groupinstall -y 'Development Tools' && \ cp -v /opt/initrd-builder/Makefile.virtio_mmio Makefile && \ curl -LO 'https://raw.githubusercontent.com/torvalds/linux/v6.1/drivers/virtio/virtio_mmio.c' && \ - KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.amzn2023.${ARCH}/" make + KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.amzn2023.${ARCHITECTURE}/" make FROM initrd-builder:0.0.1 AS stage2 COPY --from=stage1 /home/ubuntu/extracted /home/ubuntu/extracted/ diff --git a/images/x86_64/archlinux/5.18/Dockerfile.kernel b/images/x86_64/archlinux/5.18/Dockerfile.kernel index a7fe33a..1983e08 100644 --- a/images/x86_64/archlinux/5.18/Dockerfile.kernel +++ b/images/x86_64/archlinux/5.18/Dockerfile.kernel @@ -1,18 +1,18 @@ ARG VERSION ARG URL -ARG ARCH +ARG ARCHITECTURE FROM initrd-builder:0.0.1 AS builder ARG VERSION=5.18.16.arch1-1 ARG URL='https://archive.archlinux.org/packages/l' -ARG ARCH=x86_64 +ARG ARCHITECTURE=x86_64 WORKDIR /home/ubuntu RUN touch .placeholder && \ - curl -Lo kernel.pkg.tar.zst ${URL}/linux/linux-${VERSION}-${ARCH}.pkg.tar.zst && \ - curl -Lo headers.pkg.tar.zst ${URL}/linux-headers/linux-headers-${VERSION}-${ARCH}.pkg.tar.zst && \ + curl -Lo kernel.pkg.tar.zst ${URL}/linux/linux-${VERSION}-${ARCHITECTURE}.pkg.tar.zst && \ + curl -Lo headers.pkg.tar.zst ${URL}/linux-headers/linux-headers-${VERSION}-${ARCHITECTURE}.pkg.tar.zst && \ mkdir extracted && \ cd extracted && \ ls ../*.tar.zst | \ diff --git a/images/x86_64/archlinux/6.0/Dockerfile.kernel b/images/x86_64/archlinux/6.0/Dockerfile.kernel index b591d57..c810aac 100644 --- a/images/x86_64/archlinux/6.0/Dockerfile.kernel +++ b/images/x86_64/archlinux/6.0/Dockerfile.kernel @@ -1,18 +1,18 @@ ARG VERSION ARG URL -ARG ARCH +ARG ARCHITECTURE FROM initrd-builder:0.0.1 AS builder ARG VERSION=6.0.12.arch1-1 ARG URL='https://archive.archlinux.org/packages/l' -ARG ARCH=x86_64 +ARG ARCHITECTURE=x86_64 WORKDIR /home/ubuntu RUN touch .placeholder && \ - curl -Lo kernel.pkg.tar.zst ${URL}/linux/linux-${VERSION}-${ARCH}.pkg.tar.zst && \ - curl -Lo headers.pkg.tar.zst ${URL}/linux-headers/linux-headers-${VERSION}-${ARCH}.pkg.tar.zst && \ + curl -Lo kernel.pkg.tar.zst ${URL}/linux/linux-${VERSION}-${ARCHITECTURE}.pkg.tar.zst && \ + curl -Lo headers.pkg.tar.zst ${URL}/linux-headers/linux-headers-${VERSION}-${ARCHITECTURE}.pkg.tar.zst && \ mkdir extracted && \ cd extracted && \ ls ../*.tar.zst | \ diff --git a/images/x86_64/archlinux/6.7/Dockerfile.kernel b/images/x86_64/archlinux/6.7/Dockerfile.kernel index 16e51f6..3c0bf76 100644 --- a/images/x86_64/archlinux/6.7/Dockerfile.kernel +++ b/images/x86_64/archlinux/6.7/Dockerfile.kernel @@ -1,18 +1,18 @@ ARG VERSION ARG URL -ARG ARCH +ARG ARCHITECTURE FROM initrd-builder:0.0.1 AS builder ARG VERSION=6.7.1.arch1-1 ARG URL='https://archive.archlinux.org/packages/l' -ARG ARCH=x86_64 +ARG ARCHITECTURE=x86_64 WORKDIR /home/ubuntu RUN touch .placeholder && \ - curl -Lo kernel.pkg.tar.zst ${URL}/linux/linux-${VERSION}-${ARCH}.pkg.tar.zst && \ - curl -Lo headers.pkg.tar.zst ${URL}/linux-headers/linux-headers-${VERSION}-${ARCH}.pkg.tar.zst && \ + curl -Lo kernel.pkg.tar.zst ${URL}/linux/linux-${VERSION}-${ARCHITECTURE}.pkg.tar.zst && \ + curl -Lo headers.pkg.tar.zst ${URL}/linux-headers/linux-headers-${VERSION}-${ARCHITECTURE}.pkg.tar.zst && \ mkdir extracted && \ cd extracted && \ ls ../*.tar.zst | \ diff --git a/images/x86_64/centos/3.10/Dockerfile.kernel b/images/x86_64/centos/3.10/Dockerfile.kernel index e5ff41c..e2ad809 100644 --- a/images/x86_64/centos/3.10/Dockerfile.kernel +++ b/images/x86_64/centos/3.10/Dockerfile.kernel @@ -1,12 +1,12 @@ ARG VERSION=3.10.0-1160 ARG BASEOS_URL='http://mirror.centos.org/centos/7.9.2009/os/x86_64/Packages' -ARG ARCH=x86_64 +ARG ARCHITECTURE=x86_64 FROM initrd-builder:0.0.1 AS stage1 ARG VERSION ARG BASEOS_URL -ARG ARCH +ARG ARCHITECTURE WORKDIR /home/ubuntu @@ -27,7 +27,7 @@ FROM centos:centos7.9.2009 as kmod-builder ARG VERSION ARG BASEOS_URL -ARG ARCH +ARG ARCHITECTURE WORKDIR /home/ubuntu COPY --from=stage1 /home/ubuntu/extracted /home/ubuntu/extracted/ @@ -43,7 +43,7 @@ RUN yum groupinstall -y 'Development Tools' && \ tar -xaf 'linux-'${VERSION}'.el7.tar.xz' && \ cd .. && \ find src -name 'virtio_mmio.c' -exec cp -v {} . \; && \ - KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.el7.${ARCH}/" make + KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.el7.${ARCHITECTURE}/" make FROM initrd-builder:0.0.1 AS stage2 COPY --from=stage1 /home/ubuntu/extracted /home/ubuntu/extracted/ diff --git a/images/x86_64/centos/4.18/Dockerfile.kernel b/images/x86_64/centos/4.18/Dockerfile.kernel index ccb90ff..27e182f 100644 --- a/images/x86_64/centos/4.18/Dockerfile.kernel +++ b/images/x86_64/centos/4.18/Dockerfile.kernel @@ -1,20 +1,20 @@ ARG VERSION=4.18.0-536 ARG BASEOS_URL='http://mirror.centos.org/centos/8-stream/BaseOS/x86_64/os/Packages' -ARG ARCH=x86_64 +ARG ARCHITECTURE=x86_64 FROM initrd-builder:0.0.1 AS stage1 ARG VERSION ARG BASEOS_URL -ARG ARCH +ARG ARCHITECTURE WORKDIR /home/ubuntu RUN touch .placeholder && \ - curl -Lo kernel.rpm ${BASEOS_URL}/kernel-${VERSION}.el8.${ARCH}.rpm && \ - curl -Lo modules.rpm ${BASEOS_URL}/kernel-modules-${VERSION}.el8.${ARCH}.rpm && \ - curl -Lo core.rpm ${BASEOS_URL}/kernel-core-${VERSION}.el8.${ARCH}.rpm && \ - curl -Lo headers.rpm ${BASEOS_URL}/kernel-devel-${VERSION}.el8.${ARCH}.rpm && \ + curl -Lo kernel.rpm ${BASEOS_URL}/kernel-${VERSION}.el8.${ARCHITECTURE}.rpm && \ + curl -Lo modules.rpm ${BASEOS_URL}/kernel-modules-${VERSION}.el8.${ARCHITECTURE}.rpm && \ + curl -Lo core.rpm ${BASEOS_URL}/kernel-core-${VERSION}.el8.${ARCHITECTURE}.rpm && \ + curl -Lo headers.rpm ${BASEOS_URL}/kernel-devel-${VERSION}.el8.${ARCHITECTURE}.rpm && \ rpm2cpio kernel.rpm > kernel.cpio && \ rpm2cpio modules.rpm > modules.cpio && \ rpm2cpio core.rpm > core.cpio && \ @@ -33,7 +33,7 @@ FROM quay.io/centos/centos:stream8 as kmod-builder ARG VERSION ARG BASEOS_URL -ARG ARCH +ARG ARCHITECTURE WORKDIR /home/ubuntu COPY --from=stage1 /home/ubuntu/extracted /home/ubuntu/extracted/ @@ -42,7 +42,7 @@ COPY --from=stage1 /opt/initrd-builder/* /opt/initrd-builder/ RUN dnf groupinstall -y 'Development Tools' && \ cp -v /opt/initrd-builder/Makefile.virtio_mmio Makefile && \ curl -LO 'https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-8/-/raw/c8s/drivers/virtio/virtio_mmio.c' && \ - KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.el8.${ARCH}" make + KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.el8.${ARCHITECTURE}" make FROM initrd-builder:0.0.1 AS stage2 COPY --from=stage1 /home/ubuntu/extracted /home/ubuntu/extracted/ diff --git a/images/x86_64/centos/5.14/Dockerfile.kernel b/images/x86_64/centos/5.14/Dockerfile.kernel index 18cd3c5..17d45dc 100644 --- a/images/x86_64/centos/5.14/Dockerfile.kernel +++ b/images/x86_64/centos/5.14/Dockerfile.kernel @@ -1,22 +1,22 @@ ARG VERSION=5.14.0-412 ARG BASEOS_URL='https://mirror.stream.centos.org/9-stream/BaseOS/x86_64/os/Packages' ARG APPSTR_URL='http://mirror.stream.centos.org/9-stream/AppStream/x86_64/os/Packages' -ARG ARCH=x86_64 +ARG ARCHITECTURE=x86_64 FROM initrd-builder:0.0.1 AS stage1 ARG VERSION ARG BASEOS_URL ARG APPSTR_URL -ARG ARCH +ARG ARCHITECTURE WORKDIR /home/ubuntu RUN touch .placeholder && \ - curl -Lo kernel.rpm ${BASEOS_URL}/kernel-${VERSION}.el9.${ARCH}.rpm && \ - curl -Lo modules.rpm ${BASEOS_URL}/kernel-modules-core-${VERSION}.el9.${ARCH}.rpm && \ - curl -Lo core.rpm ${BASEOS_URL}/kernel-core-${VERSION}.el9.${ARCH}.rpm && \ - curl -Lo headers.rpm ${APPSTR_URL}/kernel-devel-${VERSION}.el9.${ARCH}.rpm && \ + curl -Lo kernel.rpm ${BASEOS_URL}/kernel-${VERSION}.el9.${ARCHITECTURE}.rpm && \ + curl -Lo modules.rpm ${BASEOS_URL}/kernel-modules-core-${VERSION}.el9.${ARCHITECTURE}.rpm && \ + curl -Lo core.rpm ${BASEOS_URL}/kernel-core-${VERSION}.el9.${ARCHITECTURE}.rpm && \ + curl -Lo headers.rpm ${APPSTR_URL}/kernel-devel-${VERSION}.el9.${ARCHITECTURE}.rpm && \ rpm2cpio kernel.rpm > kernel.cpio && \ rpm2cpio modules.rpm > modules.cpio && \ rpm2cpio core.rpm > core.cpio && \ @@ -36,7 +36,7 @@ FROM quay.io/centos/centos:stream9 as kmod-builder ARG VERSION ARG BASEOS_URL ARG APPSTR_URL -ARG ARCH +ARG ARCHITECTURE WORKDIR /home/ubuntu COPY --from=stage1 /home/ubuntu/extracted /home/ubuntu/extracted/ @@ -45,7 +45,7 @@ COPY --from=stage1 /opt/initrd-builder/* /opt/initrd-builder/ RUN dnf groupinstall -y 'Development Tools' && \ cp -v /opt/initrd-builder/Makefile.virtio_mmio Makefile && \ curl -LO 'https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/raw/main/drivers/virtio/virtio_mmio.c' && \ - KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.el9.${ARCH}" make + KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.el9.${ARCHITECTURE}" make FROM initrd-builder:0.0.1 AS stage2 COPY --from=stage1 /home/ubuntu/extracted /home/ubuntu/extracted/ diff --git a/images/x86_64/fedora/5.17/Dockerfile.kernel b/images/x86_64/fedora/5.17/Dockerfile.kernel index 35af1e5..c969a9a 100644 --- a/images/x86_64/fedora/5.17/Dockerfile.kernel +++ b/images/x86_64/fedora/5.17/Dockerfile.kernel @@ -1,22 +1,22 @@ ARG VERSION=5.17.5-300 ARG HVERSION=5.17.0-300 ARG URL='https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/36/Everything/x86_64/os/Packages/k/' -ARG ARCH=x86_64 +ARG ARCHITECTURE=x86_64 FROM initrd-builder:0.0.1 AS stage1 ARG VERSION ARG HVERSION ARG URL -ARG ARCH +ARG ARCHITECTURE WORKDIR /home/ubuntu RUN touch .placeholder && \ - curl -Lo kernel.rpm ${URL}kernel-core-${VERSION}.fc36.${ARCH}.rpm && \ - curl -Lo headers.rpm ${URL}kernel-headers-${HVERSION}.fc36.${ARCH}.rpm && \ - curl -Lo modules.rpm ${URL}kernel-modules-${VERSION}.fc36.${ARCH}.rpm && \ - curl -Lo sources.rpm ${URL}kernel-devel-${VERSION}.fc36.${ARCH}.rpm && \ + curl -Lo kernel.rpm ${URL}kernel-core-${VERSION}.fc36.${ARCHITECTURE}.rpm && \ + curl -Lo headers.rpm ${URL}kernel-headers-${HVERSION}.fc36.${ARCHITECTURE}.rpm && \ + curl -Lo modules.rpm ${URL}kernel-modules-${VERSION}.fc36.${ARCHITECTURE}.rpm && \ + curl -Lo sources.rpm ${URL}kernel-devel-${VERSION}.fc36.${ARCHITECTURE}.rpm && \ rpm2cpio kernel.rpm > kernel.cpio && \ rpm2cpio headers.rpm > headers.cpio && \ rpm2cpio modules.rpm > modules.cpio && \ @@ -35,7 +35,7 @@ FROM fedora:36 as kmod-builder ARG VERSION ARG HVERSION ARG URL -ARG ARCH +ARG ARCHITECTURE WORKDIR /home/ubuntu COPY --from=stage1 /home/ubuntu/extracted /home/ubuntu/extracted/ @@ -44,7 +44,7 @@ COPY --from=stage1 /opt/initrd-builder/* /opt/initrd-builder/ RUN dnf groupinstall -y 'Development Tools' && \ cp -v /opt/initrd-builder/Makefile.virtio_mmio Makefile && \ curl -LO 'https://gitlab.com/cki-project/kernel-ark/-/raw/fedora-5.17/drivers/virtio/virtio_mmio.c' && \ - KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.fc36.${ARCH}/" make + KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.fc36.${ARCHITECTURE}/" make FROM initrd-builder:0.0.1 AS stage2 diff --git a/images/x86_64/fedora/5.8/Dockerfile.kernel b/images/x86_64/fedora/5.8/Dockerfile.kernel index 6eec085..553dffc 100644 --- a/images/x86_64/fedora/5.8/Dockerfile.kernel +++ b/images/x86_64/fedora/5.8/Dockerfile.kernel @@ -1,22 +1,22 @@ ARG VERSION=5.8.15-301 ARG HVERSION=5.8.11-300 ARG URL='https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/33/Everything/x86_64/os/Packages/k/' -ARG ARCH=x86_64 +ARG ARCHITECTURE=x86_64 FROM initrd-builder:0.0.1 AS stage1 ARG VERSION ARG HVERSION ARG URL -ARG ARCH +ARG ARCHITECTURE WORKDIR /home/ubuntu RUN touch .placeholder && \ - curl -Lo kernel.rpm ${URL}kernel-core-${VERSION}.fc33.${ARCH}.rpm && \ - curl -Lo headers.rpm ${URL}kernel-headers-${HVERSION}.fc33.${ARCH}.rpm && \ - curl -Lo modules.rpm ${URL}kernel-modules-${VERSION}.fc33.${ARCH}.rpm && \ - curl -Lo sources.rpm ${URL}kernel-devel-${VERSION}.fc33.${ARCH}.rpm && \ + curl -Lo kernel.rpm ${URL}kernel-core-${VERSION}.fc33.${ARCHITECTURE}.rpm && \ + curl -Lo headers.rpm ${URL}kernel-headers-${HVERSION}.fc33.${ARCHITECTURE}.rpm && \ + curl -Lo modules.rpm ${URL}kernel-modules-${VERSION}.fc33.${ARCHITECTURE}.rpm && \ + curl -Lo sources.rpm ${URL}kernel-devel-${VERSION}.fc33.${ARCHITECTURE}.rpm && \ rpm2cpio kernel.rpm > kernel.cpio && \ rpm2cpio headers.rpm > headers.cpio && \ rpm2cpio modules.rpm > modules.cpio && \ @@ -35,7 +35,7 @@ FROM fedora:33 as kmod-builder ARG VERSION ARG HVERSION ARG URL -ARG ARCH +ARG ARCHITECTURE WORKDIR /home/ubuntu COPY --from=stage1 /home/ubuntu/extracted /home/ubuntu/extracted/ @@ -44,7 +44,7 @@ COPY --from=stage1 /opt/initrd-builder/* /opt/initrd-builder/ RUN dnf groupinstall -y 'Development Tools' && \ cp -v /opt/initrd-builder/Makefile.virtio_mmio Makefile && \ curl -LO 'https://gitlab.com/cki-project/kernel-ark/-/raw/linux-5.8.y/drivers/virtio/virtio_mmio.c' && \ - KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.fc33.${ARCH}/" make && ls -alh /home/ubuntu/extracted/lib/modules/ + KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.fc33.${ARCHITECTURE}/" make && ls -alh /home/ubuntu/extracted/lib/modules/ FROM initrd-builder:0.0.1 AS stage2 diff --git a/images/x86_64/fedora/6.2/Dockerfile.kernel b/images/x86_64/fedora/6.2/Dockerfile.kernel index fd18fd1..62053db 100644 --- a/images/x86_64/fedora/6.2/Dockerfile.kernel +++ b/images/x86_64/fedora/6.2/Dockerfile.kernel @@ -1,23 +1,23 @@ ARG VERSION=6.2.9-300 ARG HVERSION=6.2.6-300 ARG URL='https://mirrors.kernel.org/fedora/releases/38/Everything/x86_64/os/Packages' -ARG ARCH=x86_64 +ARG ARCHITECTURE=x86_64 FROM initrd-builder:0.0.1 AS stage1 ARG VERSION ARG HVERSION ARG URL -ARG ARCH +ARG ARCHITECTURE WORKDIR /home/ubuntu RUN touch .placeholder && \ - curl -Lo kernel.rpm ${URL}/k/kernel-core-${VERSION}.fc38.${ARCH}.rpm && \ - curl -Lo headers.rpm ${URL}/k/kernel-headers-${HVERSION}.fc38.${ARCH}.rpm && \ - curl -Lo modules.rpm ${URL}/k/kernel-modules-${VERSION}.fc38.${ARCH}.rpm && \ - curl -Lo sources.rpm ${URL}/k/kernel-devel-${VERSION}.fc38.${ARCH}.rpm && \ - curl -Lo modules-core.rpm ${URL}/k/kernel-modules-core-${VERSION}.fc38.${ARCH}.rpm && \ + curl -Lo kernel.rpm ${URL}/k/kernel-core-${VERSION}.fc38.${ARCHITECTURE}.rpm && \ + curl -Lo headers.rpm ${URL}/k/kernel-headers-${HVERSION}.fc38.${ARCHITECTURE}.rpm && \ + curl -Lo modules.rpm ${URL}/k/kernel-modules-${VERSION}.fc38.${ARCHITECTURE}.rpm && \ + curl -Lo sources.rpm ${URL}/k/kernel-devel-${VERSION}.fc38.${ARCHITECTURE}.rpm && \ + curl -Lo modules-core.rpm ${URL}/k/kernel-modules-core-${VERSION}.fc38.${ARCHITECTURE}.rpm && \ rpm2cpio kernel.rpm > kernel.cpio && \ rpm2cpio headers.rpm > headers.cpio && \ rpm2cpio modules.rpm > modules.cpio && \ @@ -38,7 +38,7 @@ FROM fedora:38 as kmod-builder ARG VERSION ARG HVERSION ARG URL -ARG ARCH +ARG ARCHITECTURE WORKDIR /home/ubuntu COPY --from=stage1 /home/ubuntu/extracted /home/ubuntu/extracted/ @@ -48,7 +48,7 @@ COPY --from=stage1 /opt/initrd-builder/* /opt/initrd-builder/ RUN dnf groupinstall -y 'Development Tools' && \ cp -v /opt/initrd-builder/Makefile.virtio_mmio Makefile && \ curl -LO 'https://gitlab.com/cki-project/kernel-ark/-/raw/fedora-6.2/drivers/virtio/virtio_mmio.c' && \ - KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.fc38.${ARCH}/" make && \ + KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.fc38.${ARCHITECTURE}/" make && \ find /home/ubuntu/extracted/lib/modules/ -name '*.ko' diff --git a/images/x86_64/oraclelinux/2.6/Dockerfile.kernel b/images/x86_64/oraclelinux/2.6/Dockerfile.kernel index 0123036..a1ccb1f 100644 --- a/images/x86_64/oraclelinux/2.6/Dockerfile.kernel +++ b/images/x86_64/oraclelinux/2.6/Dockerfile.kernel @@ -1,18 +1,18 @@ ARG VERSION=2.6.39-400.330.1 ARG URL='https://yum.oracle.com/repo/OracleLinux/OL6/UEK/latest/x86_64' -ARG ARCH=x86_64 +ARG ARCHITECTURE=x86_64 FROM initrd-builder:0.0.1 AS stage1 ARG VERSION ARG URL -ARG ARCH +ARG ARCHITECTURE WORKDIR /home/ubuntu RUN touch .placeholder && \ - curl -L -o kernel.rpm ${URL}/getPackage/kernel-uek-${VERSION}.el6uek.${ARCH}.rpm && \ - curl -L -o devel.rpm ${URL}/getPackage/kernel-uek-devel-${VERSION}.el6uek.${ARCH}.rpm && \ + curl -L -o kernel.rpm ${URL}/getPackage/kernel-uek-${VERSION}.el6uek.${ARCHITECTURE}.rpm && \ + curl -L -o devel.rpm ${URL}/getPackage/kernel-uek-devel-${VERSION}.el6uek.${ARCHITECTURE}.rpm && \ rpm2cpio kernel.rpm > kernel.cpio && \ rpm2cpio devel.rpm > devel.cpio && \ mkdir extracted && \ @@ -27,7 +27,7 @@ FROM oraclelinux:7 as kmod-builder ARG VERSION ARG URL -ARG ARCH +ARG ARCHITECTURE WORKDIR /home/ubuntu COPY --from=stage1 /home/ubuntu/extracted /home/ubuntu/extracted/ @@ -45,7 +45,7 @@ RUN yum groupinstall -y 'Development Tools' && \ cp -v /opt/initrd-builder/Makefile.virtio_mmio Makefile && \ find src -name virtio_mmio.c -exec cp -v {} . \; && \ sed -ie 's/virtio-mmio/my-virtio-mmio/g' virtio_mmio.c && \ - KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.el6uek.${ARCH}/" make + KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.el6uek.${ARCHITECTURE}/" make FROM initrd-builder:0.0.1 AS stage2 diff --git a/images/x86_64/oraclelinux/3.10/Dockerfile.kernel b/images/x86_64/oraclelinux/3.10/Dockerfile.kernel index 5f617e5..a4a2938 100644 --- a/images/x86_64/oraclelinux/3.10/Dockerfile.kernel +++ b/images/x86_64/oraclelinux/3.10/Dockerfile.kernel @@ -1,18 +1,18 @@ ARG VERSION=3.10.0-1160.92.1.0.2 ARG URL='https://yum.oracle.com/repo/OracleLinux/OL7/MODRHCK/x86_64' -ARG ARCH=x86_64 +ARG ARCHITECTURE=x86_64 FROM initrd-builder:0.0.1 AS stage1 ARG VERSION ARG URL -ARG ARCH +ARG ARCHITECTURE WORKDIR /home/ubuntu RUN touch .placeholder && \ - curl -L -o kernel.rpm ${URL}/getPackage/kernel-${VERSION}.el7.${ARCH}.rpm && \ - curl -L -o devel.rpm ${URL}/getPackage/kernel-devel-${VERSION}.el7.${ARCH}.rpm && \ + curl -L -o kernel.rpm ${URL}/getPackage/kernel-${VERSION}.el7.${ARCHITECTURE}.rpm && \ + curl -L -o devel.rpm ${URL}/getPackage/kernel-devel-${VERSION}.el7.${ARCHITECTURE}.rpm && \ rpm2cpio kernel.rpm > kernel.cpio && \ rpm2cpio devel.rpm > devel.cpio && \ mkdir extracted && \ @@ -27,7 +27,7 @@ FROM oraclelinux:7 as kmod-builder ARG VERSION ARG URL -ARG ARCH +ARG ARCHITECTURE WORKDIR /home/ubuntu COPY --from=stage1 /home/ubuntu/extracted /home/ubuntu/extracted/ @@ -45,7 +45,7 @@ RUN yum groupinstall -y 'Development Tools' && \ cp -v /opt/initrd-builder/Makefile.virtio_mmio Makefile && \ find src -name virtio_mmio.c -exec cp -v {} . \; && \ sed -ie 's/virtio-mmio/my-virtio-mmio/g' virtio_mmio.c && \ - KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.el7.${ARCH}/" make + KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.el7.${ARCHITECTURE}/" make FROM initrd-builder:0.0.1 AS stage2 diff --git a/images/x86_64/oraclelinux/4.14/Dockerfile.kernel b/images/x86_64/oraclelinux/4.14/Dockerfile.kernel index 1335a3a..55b5432 100644 --- a/images/x86_64/oraclelinux/4.14/Dockerfile.kernel +++ b/images/x86_64/oraclelinux/4.14/Dockerfile.kernel @@ -1,18 +1,18 @@ ARG VERSION=4.14.35-2047.526.2 ARG URL='https://yum.oracle.com/repo/OracleLinux/OL7/UEKR5/x86_64' -ARG ARCH=x86_64 +ARG ARCHITECTURE=x86_64 FROM initrd-builder:0.0.1 AS stage1 ARG VERSION ARG URL -ARG ARCH +ARG ARCHITECTURE WORKDIR /home/ubuntu RUN touch .placeholder && \ - curl -L -o kernel.rpm ${URL}/getPackage/kernel-uek-${VERSION}.el7uek.${ARCH}.rpm && \ - curl -L -o devel.rpm ${URL}/getPackage/kernel-uek-devel-${VERSION}.el7uek.${ARCH}.rpm && \ + curl -L -o kernel.rpm ${URL}/getPackage/kernel-uek-${VERSION}.el7uek.${ARCHITECTURE}.rpm && \ + curl -L -o devel.rpm ${URL}/getPackage/kernel-uek-devel-${VERSION}.el7uek.${ARCHITECTURE}.rpm && \ rpm2cpio kernel.rpm > kernel.cpio && \ rpm2cpio devel.rpm > devel.cpio && \ mkdir extracted && \ @@ -27,7 +27,7 @@ FROM oraclelinux:7 as kmod-builder ARG VERSION ARG URL -ARG ARCH +ARG ARCHITECTURE WORKDIR /home/ubuntu COPY --from=stage1 /home/ubuntu/extracted /home/ubuntu/extracted/ @@ -35,13 +35,13 @@ COPY --from=stage1 /opt/initrd-builder/* /opt/initrd-builder/ RUN yum groupinstall -y 'Development Tools' && \ yum install -y gcc elfutils-libelf-devel && \ - curl -Lo libdtrace-devel.rpm ${URL}/getPackage/libdtrace-ctf-devel-1.1.0-2.el7.${ARCH}.rpm && \ - curl -Lo libdtrace.rpm ${URL}/getPackage/libdtrace-ctf-1.1.0-2.el7.${ARCH}.rpm && \ + curl -Lo libdtrace-devel.rpm ${URL}/getPackage/libdtrace-ctf-devel-1.1.0-2.el7.${ARCHITECTURE}.rpm && \ + curl -Lo libdtrace.rpm ${URL}/getPackage/libdtrace-ctf-1.1.0-2.el7.${ARCHITECTURE}.rpm && \ yum install -y --skip-broken ./libdtrace.rpm ./libdtrace-devel.rpm && \ cp -v /opt/initrd-builder/Makefile.virtio_mmio Makefile && \ curl -LO 'https://raw.githubusercontent.com/torvalds/linux/v4.14/drivers/virtio/virtio_mmio.c' && \ sed -ie 's/virtio-mmio/my-virtio-mmio/g' virtio_mmio.c && \ - KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.el7uek.${ARCH}/" make + KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.el7uek.${ARCHITECTURE}/" make FROM initrd-builder:0.0.1 AS stage2 diff --git a/images/x86_64/oraclelinux/5.15/Dockerfile.kernel b/images/x86_64/oraclelinux/5.15/Dockerfile.kernel index 92ce86f..a087729 100644 --- a/images/x86_64/oraclelinux/5.15/Dockerfile.kernel +++ b/images/x86_64/oraclelinux/5.15/Dockerfile.kernel @@ -1,19 +1,19 @@ ARG VERSION=5.15.0-8.91.4.1 ARG URL='https://yum.oracle.com/repo/OracleLinux/OL9/UEKR7/x86_64' -ARG ARCH=x86_64 +ARG ARCHITECTURE=x86_64 FROM initrd-builder:0.0.1 AS stage1 ARG VERSION ARG URL -ARG ARCH +ARG ARCHITECTURE WORKDIR /home/ubuntu RUN touch .placeholder && \ - curl -L -o kernel.rpm ${URL}/getPackage/kernel-uek-core-${VERSION}.el9uek.${ARCH}.rpm && \ - curl -L -o devel.rpm ${URL}/getPackage/kernel-uek-devel-${VERSION}.el9uek.${ARCH}.rpm && \ - curl -L -o modules.rpm ${URL}/getPackage/kernel-uek-modules-${VERSION}.el9uek.${ARCH}.rpm && \ + curl -L -o kernel.rpm ${URL}/getPackage/kernel-uek-core-${VERSION}.el9uek.${ARCHITECTURE}.rpm && \ + curl -L -o devel.rpm ${URL}/getPackage/kernel-uek-devel-${VERSION}.el9uek.${ARCHITECTURE}.rpm && \ + curl -L -o modules.rpm ${URL}/getPackage/kernel-uek-modules-${VERSION}.el9uek.${ARCHITECTURE}.rpm && \ rpm2cpio kernel.rpm > kernel.cpio && \ rpm2cpio devel.rpm > devel.cpio && \ rpm2cpio modules.rpm > modules.cpio && \ @@ -30,7 +30,7 @@ FROM oraclelinux:9 as kmod-builder ARG VERSION ARG URL -ARG ARCH +ARG ARCHITECTURE WORKDIR /home/ubuntu COPY --from=stage1 /home/ubuntu/extracted /home/ubuntu/extracted/ @@ -41,7 +41,7 @@ RUN yum groupinstall -y 'Development Tools' && \ cp -v /opt/initrd-builder/Makefile.virtio_mmio Makefile && \ curl -LO 'https://raw.githubusercontent.com/torvalds/linux/v5.15/drivers/virtio/virtio_mmio.c' && \ sed -ie 's/virtio-mmio/my-virtio-mmio/g' virtio_mmio.c && \ - KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.el9uek.${ARCH}/" make + KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.el9uek.${ARCHITECTURE}/" make FROM initrd-builder:0.0.1 AS stage2 diff --git a/images/x86_64/oraclelinux/5.4/Dockerfile.kernel b/images/x86_64/oraclelinux/5.4/Dockerfile.kernel index d91cf70..2e38235 100644 --- a/images/x86_64/oraclelinux/5.4/Dockerfile.kernel +++ b/images/x86_64/oraclelinux/5.4/Dockerfile.kernel @@ -1,18 +1,18 @@ ARG VERSION=5.4.17-2136.320.7.1 ARG URL='https://yum.oracle.com/repo/OracleLinux/OL8/UEKR6/x86_64/' -ARG ARCH=x86_64 +ARG ARCHITECTURE=x86_64 FROM initrd-builder:0.0.1 AS stage1 ARG VERSION ARG URL -ARG ARCH +ARG ARCHITECTURE WORKDIR /home/ubuntu RUN touch .placeholder && \ - curl -L -o kernel.rpm ${URL}/getPackage/kernel-uek-${VERSION}.el8uek.${ARCH}.rpm && \ - curl -L -o devel.rpm ${URL}/getPackage/kernel-uek-devel-${VERSION}.el8uek.${ARCH}.rpm && \ + curl -L -o kernel.rpm ${URL}/getPackage/kernel-uek-${VERSION}.el8uek.${ARCHITECTURE}.rpm && \ + curl -L -o devel.rpm ${URL}/getPackage/kernel-uek-devel-${VERSION}.el8uek.${ARCHITECTURE}.rpm && \ rpm2cpio kernel.rpm > kernel.cpio && \ rpm2cpio devel.rpm > devel.cpio && \ mkdir extracted && \ @@ -27,7 +27,7 @@ FROM oraclelinux:8 as kmod-builder ARG VERSION ARG URL -ARG ARCH +ARG ARCHITECTURE WORKDIR /home/ubuntu COPY --from=stage1 /home/ubuntu/extracted /home/ubuntu/extracted/ @@ -38,7 +38,7 @@ RUN yum groupinstall -y 'Development Tools' && \ cp -v /opt/initrd-builder/Makefile.virtio_mmio Makefile && \ curl -LO 'https://raw.githubusercontent.com/torvalds/linux/v5.4/drivers/virtio/virtio_mmio.c' && \ sed -ie 's/virtio-mmio/my-virtio-mmio/g' virtio_mmio.c && \ - KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.el8uek.${ARCH}/" make + KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.el8uek.${ARCHITECTURE}/" make FROM initrd-builder:0.0.1 AS stage2 From 777a6d19163647e7475c8de10b19c80d82d77e3e Mon Sep 17 00:00:00 2001 From: Federico Di Pierro Date: Wed, 31 Jan 2024 13:04:42 +0100 Subject: [PATCH 15/17] chore(vars): bumped matrix using falcosecurity images. Also, moved ubuntu-6.3 to 6.5 and added archlinux x86_64 6.7 entry. Finally, renamed `version` in `tag`. Signed-off-by: Federico Di Pierro --- ansible-playbooks/group_vars/all/vars.yml | 63 ++++++++++++----------- images/Makefile | 2 +- 2 files changed, 33 insertions(+), 32 deletions(-) diff --git a/ansible-playbooks/group_vars/all/vars.yml b/ansible-playbooks/group_vars/all/vars.yml index bf13633..49646ee 100644 --- a/ansible-playbooks/group_vars/all/vars.yml +++ b/ansible-playbooks/group_vars/all/vars.yml @@ -10,8 +10,8 @@ user: root # Machine Configuration # ######################### -# Images version to be used. -version: main +# Images tag to be used. +tag: main # Each machine entry requires the following fields # name: the name given to the vm; @@ -19,37 +19,38 @@ version: main # rootfs: reference to an OCI image used as base rootfs for the vm. # arch: architecture of the kernel and base images. (x86_64/aarch64). machines: - - {name: "amazonlinux2022-5.15", kernel: "therealbobo/amazonlinux2022-kernel:5.15-x86_64-{{ version }}", rootfs: "therealbobo/amazonlinux2022-image:5.15-x86_64-{{ version }}", arch: "x86_64"} # noqa: yaml[line-length] - - {name: "amazonlinux2023-6.1", kernel: "therealbobo/amazonlinux2023-kernel:6.1-x86_64-{{ version }}", rootfs: "therealbobo/amazonlinux2023-image:6.1-x86_64-{{ version }}", arch: "x86_64"} # noqa: yaml[line-length] - - {name: "amazonlinux2-4.19", kernel: "therealbobo/amazonlinux2-kernel:4.19-x86_64-{{ version }}", rootfs: "therealbobo/amazonlinux2-image:4.19-x86_64-{{ version }}", arch: "x86_64"} # noqa: yaml[line-length] - - {name: "amazonlinux2-5.10", kernel: "therealbobo/amazonlinux2-kernel:5.10-x86_64-{{ version }}", rootfs: "therealbobo/amazonlinux2-image:5.10-x86_64-{{ version }}", arch: "x86_64"} # noqa: yaml[line-length] - - {name: "amazonlinux2-5.15", kernel: "therealbobo/amazonlinux2-kernel:5.15-x86_64-{{ version }}", rootfs: "therealbobo/amazonlinux2-image:5.15-x86_64-{{ version }}", arch: "x86_64"} # noqa: yaml[line-length] - - {name: "amazonlinux2-5.4", kernel: "therealbobo/amazonlinux2-kernel:5.4-x86_64-{{ version }}", rootfs: "therealbobo/amazonlinux2-image:5.4-x86_64-{{ version }}", arch: "x86_64"} # noqa: yaml[line-length] - - {name: "archlinux-6.0", kernel: "therealbobo/archlinux-kernel:6.0-x86_64-{{ version }}", rootfs: "therealbobo/archlinux-image:6.0-x86_64-{{ version }}", arch: "x86_64"} # noqa: yaml[line-length] - - {name: "centos-3.10", kernel: "therealbobo/centos-kernel:3.10-x86_64-{{ version }}", rootfs: "therealbobo/centos-image:3.10-x86_64-{{ version }}", arch: "x86_64"} # noqa: yaml[line-length] - - {name: "centos-4.18", kernel: "therealbobo/centos-kernel:4.18-x86_64-{{ version }}", rootfs: "therealbobo/centos-image:4.18-x86_64-{{ version }}", arch: "x86_64"} # noqa: yaml[line-length] - - {name: "centos-5.14", kernel: "therealbobo/centos-kernel:5.14-x86_64-{{ version }}", rootfs: "therealbobo/centos-image:5.14-x86_64-{{ version }}", arch: "x86_64"} # noqa: yaml[line-length] - - {name: "fedora-5.17", kernel: "therealbobo/fedora-kernel:5.17-x86_64-{{ version }}", rootfs: "therealbobo/fedora-image:5.17-x86_64-{{ version }}", arch: "x86_64"} # noqa: yaml[line-length] - - {name: "fedora-5.8", kernel: "therealbobo/fedora-kernel:5.8-x86_64-{{ version }}", rootfs: "therealbobo/fedora-image:5.8-x86_64-{{ version }}", arch: "x86_64"} # noqa: yaml[line-length] - - {name: "fedora-6.2", kernel: "therealbobo/fedora-kernel:6.2-x86_64-{{ version }}", rootfs: "therealbobo/fedora-image:6.2-x86_64-{{ version }}", arch: "x86_64"} # noqa: yaml[line-length] - - {name: "oraclelinux-3.10", kernel: "therealbobo/oraclelinux-kernel:3.10-x86_64-{{ version }}", rootfs: "therealbobo/oraclelinux-image:3.10-x86_64-{{ version }}", arch: "x86_64"} # noqa: yaml[line-length] - - {name: "oraclelinux-4.14", kernel: "therealbobo/oraclelinux-kernel:4.14-x86_64-{{ version }}", rootfs: "therealbobo/oraclelinux-image:4.14-x86_64-{{ version }}", arch: "x86_64"} # noqa: yaml[line-length] - - {name: "oraclelinux-5.15", kernel: "therealbobo/oraclelinux-kernel:5.15-x86_64-{{ version }}", rootfs: "therealbobo/oraclelinux-image:5.15-x86_64-{{ version }}", arch: "x86_64"} # noqa: yaml[line-length] - - {name: "oraclelinux-5.4", kernel: "therealbobo/oraclelinux-kernel:5.4-x86_64-{{ version }}", rootfs: "therealbobo/oraclelinux-image:5.4-x86_64-{{ version }}", arch: "x86_64"} # noqa: yaml[line-length] - - {name: "ubuntu-4.15", kernel: "therealbobo/ubuntu-kernel:4.15-x86_64-{{ version }}", rootfs: "therealbobo/ubuntu-image:4.15-x86_64-{{ version }}", arch: "x86_64"} # noqa: yaml[line-length] - - {name: "ubuntu-6.3", kernel: "therealbobo/ubuntu-kernel:6.3-x86_64-{{ version }}", rootfs: "therealbobo/ubuntu-image:6.3-x86_64-{{ version }}", arch: "x86_64"} # noqa: yaml[line-length] - - {name: "amazonlinux2022-5.15", kernel: "therealbobo/amazonlinux2022-kernel:5.15-aarch64-{{ version }}", rootfs: "therealbobo/amazonlinux2022-image:5.15-aarch64-{{ version }}", arch: "aarch64"} # noqa: yaml[line-length] - - {name: "amazonlinux2-5.4", kernel: "therealbobo/amazonlinux2-kernel:5.4-aarch64-{{ version }}", rootfs: "therealbobo/amazonlinux2-image:5.4-aarch64-{{ version }}", arch: "aarch64"} # noqa: yaml[line-length] - - {name: "fedora-6.2", kernel: "therealbobo/fedora-kernel:6.2-aarch64-{{ version }}", rootfs: "therealbobo/fedora-image:6.2-aarch64-{{ version }}", arch: "aarch64"} # noqa: yaml[line-length] - - {name: "oraclelinux-4.14", kernel: "therealbobo/oraclelinux-kernel:4.14-aarch64-{{ version }}", rootfs: "therealbobo/oraclelinux-image:4.14-aarch64-{{ version }}", arch: "aarch64"} # noqa: yaml[line-length] - - {name: "oraclelinux-5.15", kernel: "therealbobo/oraclelinux-kernel:5.15-aarch64-{{ version }}", rootfs: "therealbobo/oraclelinux-image:5.15-aarch64-{{ version }}", arch: "aarch64"} # noqa: yaml[line-length] - - {name: "ubuntu-6.3", kernel: "therealbobo/ubuntu-kernel:6.3-aarch64-{{ version }}", rootfs: "therealbobo/ubuntu-image:6.3-aarch64-{{ version }}", arch: "aarch64"} # noqa: yaml[line-length] + - {name: "amazonlinux2022-5.15", kernel: "ghcr.io/falcosecurity/kernel-testing/amazonlinux2022-kernel:5.15-x86_64-{{ tag }}", rootfs: "ghcr.io/falcosecurity/kernel-testing/amazonlinux2022-image:5.15-x86_64-{{ tag }}", arch: "x86_64"} # noqa: yaml[line-length] + - {name: "amazonlinux2023-6.1", kernel: "ghcr.io/falcosecurity/kernel-testing/amazonlinux2023-kernel:6.1-x86_64-{{ tag }}", rootfs: "ghcr.io/falcosecurity/kernel-testing/amazonlinux2023-image:6.1-x86_64-{{ tag }}", arch: "x86_64"} # noqa: yaml[line-length] + - {name: "amazonlinux2-4.19", kernel: "ghcr.io/falcosecurity/kernel-testing/amazonlinux2-kernel:4.19-x86_64-{{ tag }}", rootfs: "ghcr.io/falcosecurity/kernel-testing/amazonlinux2-image:4.19-x86_64-{{ tag }}", arch: "x86_64"} # noqa: yaml[line-length] + - {name: "amazonlinux2-5.10", kernel: "ghcr.io/falcosecurity/kernel-testing/amazonlinux2-kernel:5.10-x86_64-{{ tag }}", rootfs: "ghcr.io/falcosecurity/kernel-testing/amazonlinux2-image:5.10-x86_64-{{ tag }}", arch: "x86_64"} # noqa: yaml[line-length] + - {name: "amazonlinux2-5.15", kernel: "ghcr.io/falcosecurity/kernel-testing/amazonlinux2-kernel:5.15-x86_64-{{ tag }}", rootfs: "ghcr.io/falcosecurity/kernel-testing/amazonlinux2-image:5.15-x86_64-{{ tag }}", arch: "x86_64"} # noqa: yaml[line-length] + - {name: "amazonlinux2-5.4", kernel: "ghcr.io/falcosecurity/kernel-testing/amazonlinux2-kernel:5.4-x86_64-{{ tag }}", rootfs: "ghcr.io/falcosecurity/kernel-testing/amazonlinux2-image:5.4-x86_64-{{ tag }}", arch: "x86_64"} # noqa: yaml[line-length] + - {name: "archlinux-6.0", kernel: "ghcr.io/falcosecurity/kernel-testing/archlinux-kernel:6.0-x86_64-{{ tag }}", rootfs: "ghcr.io/falcosecurity/kernel-testing/archlinux-image:6.0-x86_64-{{ tag }}", arch: "x86_64"} # noqa: yaml[line-length] + - {name: "archlinux-6.7", kernel: "ghcr.io/falcosecurity/kernel-testing/archlinux-kernel:6.7-x86_64-{{ tag }}", rootfs: "ghcr.io/falcosecurity/kernel-testing/archlinux-image:6.7-x86_64-{{ tag }}", arch: "x86_64"} # noqa: yaml[line-length] + - {name: "centos-3.10", kernel: "ghcr.io/falcosecurity/kernel-testing/centos-kernel:3.10-x86_64-{{ tag }}", rootfs: "ghcr.io/falcosecurity/kernel-testing/centos-image:3.10-x86_64-{{ tag }}", arch: "x86_64"} # noqa: yaml[line-length] + - {name: "centos-4.18", kernel: "ghcr.io/falcosecurity/kernel-testing/centos-kernel:4.18-x86_64-{{ tag }}", rootfs: "ghcr.io/falcosecurity/kernel-testing/centos-image:4.18-x86_64-{{ tag }}", arch: "x86_64"} # noqa: yaml[line-length] + - {name: "centos-5.14", kernel: "ghcr.io/falcosecurity/kernel-testing/centos-kernel:5.14-x86_64-{{ tag }}", rootfs: "ghcr.io/falcosecurity/kernel-testing/centos-image:5.14-x86_64-{{ tag }}", arch: "x86_64"} # noqa: yaml[line-length] + - {name: "fedora-5.17", kernel: "ghcr.io/falcosecurity/kernel-testing/fedora-kernel:5.17-x86_64-{{ tag }}", rootfs: "ghcr.io/falcosecurity/kernel-testing/fedora-image:5.17-x86_64-{{ tag }}", arch: "x86_64"} # noqa: yaml[line-length] + - {name: "fedora-5.8", kernel: "ghcr.io/falcosecurity/kernel-testing/fedora-kernel:5.8-x86_64-{{ tag }}", rootfs: "ghcr.io/falcosecurity/kernel-testing/fedora-image:5.8-x86_64-{{ tag }}", arch: "x86_64"} # noqa: yaml[line-length] + - {name: "fedora-6.2", kernel: "ghcr.io/falcosecurity/kernel-testing/fedora-kernel:6.2-x86_64-{{ tag }}", rootfs: "ghcr.io/falcosecurity/kernel-testing/fedora-image:6.2-x86_64-{{ tag }}", arch: "x86_64"} # noqa: yaml[line-length] + - {name: "oraclelinux-3.10", kernel: "ghcr.io/falcosecurity/kernel-testing/oraclelinux-kernel:3.10-x86_64-{{ tag }}", rootfs: "ghcr.io/falcosecurity/kernel-testing/oraclelinux-image:3.10-x86_64-{{ tag }}", arch: "x86_64"} # noqa: yaml[line-length] + - {name: "oraclelinux-4.14", kernel: "ghcr.io/falcosecurity/kernel-testing/oraclelinux-kernel:4.14-x86_64-{{ tag }}", rootfs: "ghcr.io/falcosecurity/kernel-testing/oraclelinux-image:4.14-x86_64-{{ tag }}", arch: "x86_64"} # noqa: yaml[line-length] + - {name: "oraclelinux-5.15", kernel: "ghcr.io/falcosecurity/kernel-testing/oraclelinux-kernel:5.15-x86_64-{{ tag }}", rootfs: "ghcr.io/falcosecurity/kernel-testing/oraclelinux-image:5.15-x86_64-{{ tag }}", arch: "x86_64"} # noqa: yaml[line-length] + - {name: "oraclelinux-5.4", kernel: "ghcr.io/falcosecurity/kernel-testing/oraclelinux-kernel:5.4-x86_64-{{ tag }}", rootfs: "ghcr.io/falcosecurity/kernel-testing/oraclelinux-image:5.4-x86_64-{{ tag }}", arch: "x86_64"} # noqa: yaml[line-length] + - {name: "ubuntu-4.15", kernel: "ghcr.io/falcosecurity/kernel-testing/ubuntu-kernel:4.15-x86_64-{{ tag }}", rootfs: "ghcr.io/falcosecurity/kernel-testing/ubuntu-image:4.15-x86_64-{{ tag }}", arch: "x86_64"} # noqa: yaml[line-length] + - {name: "ubuntu-6.5", kernel: "ghcr.io/falcosecurity/kernel-testing/ubuntu-kernel:6.5-x86_64-{{ tag }}", rootfs: "ghcr.io/falcosecurity/kernel-testing/ubuntu-image:6.5-x86_64-{{ tag }}", arch: "x86_64"} # noqa: yaml[line-length] + - {name: "amazonlinux2022-5.15", kernel: "ghcr.io/falcosecurity/kernel-testing/amazonlinux2022-kernel:5.15-aarch64-{{ tag }}", rootfs: "ghcr.io/falcosecurity/kernel-testing/amazonlinux2022-image:5.15-aarch64-{{ tag }}", arch: "aarch64"} # noqa: yaml[line-length] + - {name: "amazonlinux2-5.4", kernel: "ghcr.io/falcosecurity/kernel-testing/amazonlinux2-kernel:5.4-aarch64-{{ tag }}", rootfs: "ghcr.io/falcosecurity/kernel-testing/amazonlinux2-image:5.4-aarch64-{{ tag }}", arch: "aarch64"} # noqa: yaml[line-length] + - {name: "fedora-6.2", kernel: "ghcr.io/falcosecurity/kernel-testing/fedora-kernel:6.2-aarch64-{{ tag }}", rootfs: "ghcr.io/falcosecurity/kernel-testing/fedora-image:6.2-aarch64-{{ tag }}", arch: "aarch64"} # noqa: yaml[line-length] + - {name: "oraclelinux-4.14", kernel: "ghcr.io/falcosecurity/kernel-testing/oraclelinux-kernel:4.14-aarch64-{{ tag }}", rootfs: "ghcr.io/falcosecurity/kernel-testing/oraclelinux-image:4.14-aarch64-{{ tag }}", arch: "aarch64"} # noqa: yaml[line-length] + - {name: "oraclelinux-5.15", kernel: "ghcr.io/falcosecurity/kernel-testing/oraclelinux-kernel:5.15-aarch64-{{ tag }}", rootfs: "ghcr.io/falcosecurity/kernel-testing/oraclelinux-image:5.15-aarch64-{{ tag }}", arch: "aarch64"} # noqa: yaml[line-length] + - {name: "ubuntu-6.5", kernel: "ghcr.io/falcosecurity/kernel-testing/ubuntu-kernel:6.5-aarch64-{{ tag }}", rootfs: "ghcr.io/falcosecurity/kernel-testing/ubuntu-image:6.5-aarch64-{{ tag }}", arch: "aarch64"} # noqa: yaml[line-length] builders: - - {name: "centos-builder", kernel: "weaveworks/ignite-kernel:5.14.16", rootfs: "therealbobo/builder:0.0.1-x86_64-{{ version }}", arch: "x86_64"} - - {name: "fedora-builder", kernel: "weaveworks/ignite-kernel:5.14.16", rootfs: "therealbobo/modernprobe-builder:0.0.1-x86_64-{{ version }}", arch: "x86_64"} - - {name: "centos-builder", kernel: "weaveworks/ignite-kernel:5.14.16", rootfs: "therealbobo/builder:0.0.1-aarch64-{{ version }}", arch: "aarch64"} - - {name: "fedora-builder", kernel: "weaveworks/ignite-kernel:5.14.16", rootfs: "therealbobo/modernprobe-builder:0.0.1-aarch64-{{ version }}", arch: "aarch64"} # noqa: yaml[line-length] + - {name: "centos-builder", kernel: "weaveworks/ignite-kernel:5.14.16", rootfs: "ghcr.io/falcosecurity/kernel-testing/builder:x86_64-{{ tag }}", arch: "x86_64"} # noqa: yaml[line-length] + - {name: "fedora-builder", kernel: "weaveworks/ignite-kernel:5.14.16", rootfs: "ghcr.io/falcosecurity/kernel-testing/modernprobe-builder:x86_64-{{ tag }}", arch: "x86_64"} # noqa: yaml[line-length] + - {name: "centos-builder", kernel: "weaveworks/ignite-kernel:5.14.16", rootfs: "ghcr.io/falcosecurity/kernel-testing/builder:aarch64-{{ tag }}", arch: "aarch64"} # noqa: yaml[line-length] + - {name: "fedora-builder", kernel: "weaveworks/ignite-kernel:5.14.16", rootfs: "ghcr.io/falcosecurity/kernel-testing/modernprobe-builder:aarch64-{{ tag }}", arch: "aarch64"} # noqa: yaml[line-length] output_dir: "~/ansible_output" # Number of cpus. diff --git a/images/Makefile b/images/Makefile index 91365be..0e0efa7 100644 --- a/images/Makefile +++ b/images/Makefile @@ -28,7 +28,7 @@ builder: modernprobe-builder: if [ "$(DRY_RUN)" = "true" ]; then \ - echo "Dry run: Building modernprobe-builder image: docker build -t $(REPOSITORY)/modernprobe-builder:$(TAG)-$(ARCH) modernprobe-builder"; \ + echo "Dry run: Building modernprobe-builder image: docker build -t $(REPOSITORY)/modernprobe-builder:$(ARCH)-$(TAG) modernprobe-builder"; \ else \ echo "Building modernprobe-builder image"; \ image=$(REPOSITORY)/modernprobe-builder:$(ARCH); \ From dd97aa495fbbfd4835c0e2b3f519a7333c9e769a Mon Sep 17 00:00:00 2001 From: Federico Di Pierro Date: Wed, 31 Jan 2024 15:17:15 +0100 Subject: [PATCH 16/17] cleanup(images): remove oraclelinux 2.6 that was never meant to be supported. Since virtio_mmio is not supported on this kernel. Signed-off-by: Federico Di Pierro --- images/x86_64/oraclelinux/2.6/Dockerfile | 33 ---------- .../x86_64/oraclelinux/2.6/Dockerfile.kernel | 61 ------------------- 2 files changed, 94 deletions(-) delete mode 100644 images/x86_64/oraclelinux/2.6/Dockerfile delete mode 100644 images/x86_64/oraclelinux/2.6/Dockerfile.kernel diff --git a/images/x86_64/oraclelinux/2.6/Dockerfile b/images/x86_64/oraclelinux/2.6/Dockerfile deleted file mode 100644 index cbbdee8..0000000 --- a/images/x86_64/oraclelinux/2.6/Dockerfile +++ /dev/null @@ -1,33 +0,0 @@ -FROM oraclelinux:7 - -ARG VERSION=3.10.0-1160.92.1.0.2 -ARG URL='https://yum.oracle.com/repo/OracleLinux/OL7/MODRHCK/x86_64' - -RUN yum install -y \ - binutils-devel \ - clang \ - gcc \ - git \ - iproute \ - kmod \ - libcap-devel \ - llvm \ - make \ - openssh-server \ - rsync \ - systemd \ - tar && \ - curl -L -o kernel.rpm ${URL}/getPackage/kernel-${VERSION}.el7.x86_64.rpm && \ - curl -L -o devel.rpm ${URL}/getPackage/kernel-devel-${VERSION}.el7.x86_64.rpm && \ - yum install -y ./*.rpm && \ - rm -f ./*.rpm && \ - sed -i -e 's/^AcceptEnv LANG LC_\*$/#AcceptEnv LANG LC_*/' /etc/ssh/sshd_config && \ - echo 'UseDNS no' >> /etc/ssh/sshd_config && \ - echo "root:root" | chpasswd && \ - curl -LO https://cmake.org/files/v3.16/cmake-3.16.7-Linux-x86_64.tar.gz && \ - tar -xaf cmake-3.16.7-Linux-x86_64.tar.gz && \ - rm -f cmake-3.16.7-Linux-x86_64.tar.gz && \ - mv cmake-3.16.7-Linux-x86_64 /opt/cmake-3.16.7 && \ - ln -sf /opt/cmake-3.16.7/bin/* /usr/bin/ && \ - mkdir -p /lib/modules/${VERSION}.el7.x86_64/ && \ - ln -s /usr/src/kernels/${VERSION}.el7.x86_64/ /lib/modules/${VERSION}.el7.x86_64/build diff --git a/images/x86_64/oraclelinux/2.6/Dockerfile.kernel b/images/x86_64/oraclelinux/2.6/Dockerfile.kernel deleted file mode 100644 index a1ccb1f..0000000 --- a/images/x86_64/oraclelinux/2.6/Dockerfile.kernel +++ /dev/null @@ -1,61 +0,0 @@ -ARG VERSION=2.6.39-400.330.1 -ARG URL='https://yum.oracle.com/repo/OracleLinux/OL6/UEK/latest/x86_64' -ARG ARCHITECTURE=x86_64 - -FROM initrd-builder:0.0.1 AS stage1 - -ARG VERSION -ARG URL -ARG ARCHITECTURE - -WORKDIR /home/ubuntu - -RUN touch .placeholder && \ - curl -L -o kernel.rpm ${URL}/getPackage/kernel-uek-${VERSION}.el6uek.${ARCHITECTURE}.rpm && \ - curl -L -o devel.rpm ${URL}/getPackage/kernel-uek-devel-${VERSION}.el6uek.${ARCHITECTURE}.rpm && \ - rpm2cpio kernel.rpm > kernel.cpio && \ - rpm2cpio devel.rpm > devel.cpio && \ - mkdir extracted && \ - cd extracted && \ - cpio -idmv < ../kernel.cpio && \ - cpio -idmv < ../devel.cpio && \ - find . -name '*.xz' -exec xz -d {} \; && \ - cd .. && \ - extract-vmlinux $(find ./extracted/ -name 'vmlinuz-*') > extracted/vmlinux - -FROM oraclelinux:7 as kmod-builder - -ARG VERSION -ARG URL -ARG ARCHITECTURE - -WORKDIR /home/ubuntu -COPY --from=stage1 /home/ubuntu/extracted /home/ubuntu/extracted/ -COPY --from=stage1 /opt/initrd-builder/* /opt/initrd-builder/ - -RUN yum groupinstall -y 'Development Tools' && \ - yum install -y gcc && \ - mkdir src && \ - cd src && \ - curl -Lo source.rpm 'https://oss.oracle.com/ol6/SRPMS-updates/kernel-uek-'${VERSION}'.el6uek.src.rpm' && \ - rpm2cpio source.rpm > source.cpio && \ - cpio -idmv < ./source.cpio && \ - tar -xaf linux-2.6.*.tar.bz2 && \ - cd .. && \ - cp -v /opt/initrd-builder/Makefile.virtio_mmio Makefile && \ - find src -name virtio_mmio.c -exec cp -v {} . \; && \ - sed -ie 's/virtio-mmio/my-virtio-mmio/g' virtio_mmio.c && \ - KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.el6uek.${ARCHITECTURE}/" make - -FROM initrd-builder:0.0.1 AS stage2 - -COPY --from=stage1 /home/ubuntu/extracted /home/ubuntu/extracted/ -COPY --from=kmod-builder /home/ubuntu/virtio_mmio.ko /home/ubuntu/ -RUN cd /home/ubuntu/extracted && \ - /opt/initrd-builder/create.sh - -FROM scratch - -COPY --from=stage1 /home/ubuntu/extracted/vmlinux /boot/ -COPY --from=stage2 /home/ubuntu/out/initrd /boot/ -COPY --from=stage1 /home/ubuntu/.placeholder /lib/modules/ From 56a25ddd1d87743581994db92a4c70e96683705c Mon Sep 17 00:00:00 2001 From: Federico Di Pierro Date: Tue, 6 Feb 2024 11:58:38 +0100 Subject: [PATCH 17/17] chore: small improvements plus added docs for new images Makefile env variables. Signed-off-by: Federico Di Pierro --- .github/workflows/reusable_build_images.yml | 6 +- ansible-playbooks/group_vars/all/vars.yml | 63 +++++++++++---------- images/Makefile | 31 ++++++---- images/README.md | 22 ++++++- 4 files changed, 75 insertions(+), 47 deletions(-) diff --git a/.github/workflows/reusable_build_images.yml b/.github/workflows/reusable_build_images.yml index 0f49231..be27cd3 100644 --- a/.github/workflows/reusable_build_images.yml +++ b/.github/workflows/reusable_build_images.yml @@ -52,6 +52,10 @@ jobs: run: | echo "TAG=${{ inputs.version }}" >> $GITHUB_ENV + - name: Set CLEANUP env var (CI only, because of limited disk space) + run: | + echo "CLEANUP=true" >> $GITHUB_ENV + - name: Build images working-directory: ./images run: | @@ -65,5 +69,3 @@ jobs: cat failed.txt exit 1; fi - - diff --git a/ansible-playbooks/group_vars/all/vars.yml b/ansible-playbooks/group_vars/all/vars.yml index 49646ee..ffc109b 100644 --- a/ansible-playbooks/group_vars/all/vars.yml +++ b/ansible-playbooks/group_vars/all/vars.yml @@ -13,44 +13,47 @@ user: root # Images tag to be used. tag: main +# Image repository to be used. +repo: "ghcr.io/falcosecurity/kernel-testing" + # Each machine entry requires the following fields # name: the name given to the vm; # kernel: reference to an OCI image containing a kernel; # rootfs: reference to an OCI image used as base rootfs for the vm. # arch: architecture of the kernel and base images. (x86_64/aarch64). machines: - - {name: "amazonlinux2022-5.15", kernel: "ghcr.io/falcosecurity/kernel-testing/amazonlinux2022-kernel:5.15-x86_64-{{ tag }}", rootfs: "ghcr.io/falcosecurity/kernel-testing/amazonlinux2022-image:5.15-x86_64-{{ tag }}", arch: "x86_64"} # noqa: yaml[line-length] - - {name: "amazonlinux2023-6.1", kernel: "ghcr.io/falcosecurity/kernel-testing/amazonlinux2023-kernel:6.1-x86_64-{{ tag }}", rootfs: "ghcr.io/falcosecurity/kernel-testing/amazonlinux2023-image:6.1-x86_64-{{ tag }}", arch: "x86_64"} # noqa: yaml[line-length] - - {name: "amazonlinux2-4.19", kernel: "ghcr.io/falcosecurity/kernel-testing/amazonlinux2-kernel:4.19-x86_64-{{ tag }}", rootfs: "ghcr.io/falcosecurity/kernel-testing/amazonlinux2-image:4.19-x86_64-{{ tag }}", arch: "x86_64"} # noqa: yaml[line-length] - - {name: "amazonlinux2-5.10", kernel: "ghcr.io/falcosecurity/kernel-testing/amazonlinux2-kernel:5.10-x86_64-{{ tag }}", rootfs: "ghcr.io/falcosecurity/kernel-testing/amazonlinux2-image:5.10-x86_64-{{ tag }}", arch: "x86_64"} # noqa: yaml[line-length] - - {name: "amazonlinux2-5.15", kernel: "ghcr.io/falcosecurity/kernel-testing/amazonlinux2-kernel:5.15-x86_64-{{ tag }}", rootfs: "ghcr.io/falcosecurity/kernel-testing/amazonlinux2-image:5.15-x86_64-{{ tag }}", arch: "x86_64"} # noqa: yaml[line-length] - - {name: "amazonlinux2-5.4", kernel: "ghcr.io/falcosecurity/kernel-testing/amazonlinux2-kernel:5.4-x86_64-{{ tag }}", rootfs: "ghcr.io/falcosecurity/kernel-testing/amazonlinux2-image:5.4-x86_64-{{ tag }}", arch: "x86_64"} # noqa: yaml[line-length] - - {name: "archlinux-6.0", kernel: "ghcr.io/falcosecurity/kernel-testing/archlinux-kernel:6.0-x86_64-{{ tag }}", rootfs: "ghcr.io/falcosecurity/kernel-testing/archlinux-image:6.0-x86_64-{{ tag }}", arch: "x86_64"} # noqa: yaml[line-length] - - {name: "archlinux-6.7", kernel: "ghcr.io/falcosecurity/kernel-testing/archlinux-kernel:6.7-x86_64-{{ tag }}", rootfs: "ghcr.io/falcosecurity/kernel-testing/archlinux-image:6.7-x86_64-{{ tag }}", arch: "x86_64"} # noqa: yaml[line-length] - - {name: "centos-3.10", kernel: "ghcr.io/falcosecurity/kernel-testing/centos-kernel:3.10-x86_64-{{ tag }}", rootfs: "ghcr.io/falcosecurity/kernel-testing/centos-image:3.10-x86_64-{{ tag }}", arch: "x86_64"} # noqa: yaml[line-length] - - {name: "centos-4.18", kernel: "ghcr.io/falcosecurity/kernel-testing/centos-kernel:4.18-x86_64-{{ tag }}", rootfs: "ghcr.io/falcosecurity/kernel-testing/centos-image:4.18-x86_64-{{ tag }}", arch: "x86_64"} # noqa: yaml[line-length] - - {name: "centos-5.14", kernel: "ghcr.io/falcosecurity/kernel-testing/centos-kernel:5.14-x86_64-{{ tag }}", rootfs: "ghcr.io/falcosecurity/kernel-testing/centos-image:5.14-x86_64-{{ tag }}", arch: "x86_64"} # noqa: yaml[line-length] - - {name: "fedora-5.17", kernel: "ghcr.io/falcosecurity/kernel-testing/fedora-kernel:5.17-x86_64-{{ tag }}", rootfs: "ghcr.io/falcosecurity/kernel-testing/fedora-image:5.17-x86_64-{{ tag }}", arch: "x86_64"} # noqa: yaml[line-length] - - {name: "fedora-5.8", kernel: "ghcr.io/falcosecurity/kernel-testing/fedora-kernel:5.8-x86_64-{{ tag }}", rootfs: "ghcr.io/falcosecurity/kernel-testing/fedora-image:5.8-x86_64-{{ tag }}", arch: "x86_64"} # noqa: yaml[line-length] - - {name: "fedora-6.2", kernel: "ghcr.io/falcosecurity/kernel-testing/fedora-kernel:6.2-x86_64-{{ tag }}", rootfs: "ghcr.io/falcosecurity/kernel-testing/fedora-image:6.2-x86_64-{{ tag }}", arch: "x86_64"} # noqa: yaml[line-length] - - {name: "oraclelinux-3.10", kernel: "ghcr.io/falcosecurity/kernel-testing/oraclelinux-kernel:3.10-x86_64-{{ tag }}", rootfs: "ghcr.io/falcosecurity/kernel-testing/oraclelinux-image:3.10-x86_64-{{ tag }}", arch: "x86_64"} # noqa: yaml[line-length] - - {name: "oraclelinux-4.14", kernel: "ghcr.io/falcosecurity/kernel-testing/oraclelinux-kernel:4.14-x86_64-{{ tag }}", rootfs: "ghcr.io/falcosecurity/kernel-testing/oraclelinux-image:4.14-x86_64-{{ tag }}", arch: "x86_64"} # noqa: yaml[line-length] - - {name: "oraclelinux-5.15", kernel: "ghcr.io/falcosecurity/kernel-testing/oraclelinux-kernel:5.15-x86_64-{{ tag }}", rootfs: "ghcr.io/falcosecurity/kernel-testing/oraclelinux-image:5.15-x86_64-{{ tag }}", arch: "x86_64"} # noqa: yaml[line-length] - - {name: "oraclelinux-5.4", kernel: "ghcr.io/falcosecurity/kernel-testing/oraclelinux-kernel:5.4-x86_64-{{ tag }}", rootfs: "ghcr.io/falcosecurity/kernel-testing/oraclelinux-image:5.4-x86_64-{{ tag }}", arch: "x86_64"} # noqa: yaml[line-length] - - {name: "ubuntu-4.15", kernel: "ghcr.io/falcosecurity/kernel-testing/ubuntu-kernel:4.15-x86_64-{{ tag }}", rootfs: "ghcr.io/falcosecurity/kernel-testing/ubuntu-image:4.15-x86_64-{{ tag }}", arch: "x86_64"} # noqa: yaml[line-length] - - {name: "ubuntu-6.5", kernel: "ghcr.io/falcosecurity/kernel-testing/ubuntu-kernel:6.5-x86_64-{{ tag }}", rootfs: "ghcr.io/falcosecurity/kernel-testing/ubuntu-image:6.5-x86_64-{{ tag }}", arch: "x86_64"} # noqa: yaml[line-length] - - {name: "amazonlinux2022-5.15", kernel: "ghcr.io/falcosecurity/kernel-testing/amazonlinux2022-kernel:5.15-aarch64-{{ tag }}", rootfs: "ghcr.io/falcosecurity/kernel-testing/amazonlinux2022-image:5.15-aarch64-{{ tag }}", arch: "aarch64"} # noqa: yaml[line-length] - - {name: "amazonlinux2-5.4", kernel: "ghcr.io/falcosecurity/kernel-testing/amazonlinux2-kernel:5.4-aarch64-{{ tag }}", rootfs: "ghcr.io/falcosecurity/kernel-testing/amazonlinux2-image:5.4-aarch64-{{ tag }}", arch: "aarch64"} # noqa: yaml[line-length] - - {name: "fedora-6.2", kernel: "ghcr.io/falcosecurity/kernel-testing/fedora-kernel:6.2-aarch64-{{ tag }}", rootfs: "ghcr.io/falcosecurity/kernel-testing/fedora-image:6.2-aarch64-{{ tag }}", arch: "aarch64"} # noqa: yaml[line-length] - - {name: "oraclelinux-4.14", kernel: "ghcr.io/falcosecurity/kernel-testing/oraclelinux-kernel:4.14-aarch64-{{ tag }}", rootfs: "ghcr.io/falcosecurity/kernel-testing/oraclelinux-image:4.14-aarch64-{{ tag }}", arch: "aarch64"} # noqa: yaml[line-length] - - {name: "oraclelinux-5.15", kernel: "ghcr.io/falcosecurity/kernel-testing/oraclelinux-kernel:5.15-aarch64-{{ tag }}", rootfs: "ghcr.io/falcosecurity/kernel-testing/oraclelinux-image:5.15-aarch64-{{ tag }}", arch: "aarch64"} # noqa: yaml[line-length] - - {name: "ubuntu-6.5", kernel: "ghcr.io/falcosecurity/kernel-testing/ubuntu-kernel:6.5-aarch64-{{ tag }}", rootfs: "ghcr.io/falcosecurity/kernel-testing/ubuntu-image:6.5-aarch64-{{ tag }}", arch: "aarch64"} # noqa: yaml[line-length] + - {name: "amazonlinux2022-5.15", kernel: "{{ repo }}/amazonlinux2022-kernel:5.15-x86_64-{{ tag }}", rootfs: "{{ repo }}/amazonlinux2022-image:5.15-x86_64-{{ tag }}", arch: "x86_64"} # noqa: yaml[line-length] + - {name: "amazonlinux2023-6.1", kernel: "{{ repo }}/amazonlinux2023-kernel:6.1-x86_64-{{ tag }}", rootfs: "{{ repo }}/amazonlinux2023-image:6.1-x86_64-{{ tag }}", arch: "x86_64"} # noqa: yaml[line-length] + - {name: "amazonlinux2-4.19", kernel: "{{ repo }}/amazonlinux2-kernel:4.19-x86_64-{{ tag }}", rootfs: "{{ repo }}/amazonlinux2-image:4.19-x86_64-{{ tag }}", arch: "x86_64"} # noqa: yaml[line-length] + - {name: "amazonlinux2-5.10", kernel: "{{ repo }}/amazonlinux2-kernel:5.10-x86_64-{{ tag }}", rootfs: "{{ repo }}/amazonlinux2-image:5.10-x86_64-{{ tag }}", arch: "x86_64"} # noqa: yaml[line-length] + - {name: "amazonlinux2-5.15", kernel: "{{ repo }}/amazonlinux2-kernel:5.15-x86_64-{{ tag }}", rootfs: "{{ repo }}/amazonlinux2-image:5.15-x86_64-{{ tag }}", arch: "x86_64"} # noqa: yaml[line-length] + - {name: "amazonlinux2-5.4", kernel: "{{ repo }}/amazonlinux2-kernel:5.4-x86_64-{{ tag }}", rootfs: "{{ repo }}/amazonlinux2-image:5.4-x86_64-{{ tag }}", arch: "x86_64"} # noqa: yaml[line-length] + - {name: "archlinux-6.0", kernel: "{{ repo }}/archlinux-kernel:6.0-x86_64-{{ tag }}", rootfs: "{{ repo }}/archlinux-image:6.0-x86_64-{{ tag }}", arch: "x86_64"} # noqa: yaml[line-length] + - {name: "archlinux-6.7", kernel: "{{ repo }}/archlinux-kernel:6.7-x86_64-{{ tag }}", rootfs: "{{ repo }}/archlinux-image:6.7-x86_64-{{ tag }}", arch: "x86_64"} # noqa: yaml[line-length] + - {name: "centos-3.10", kernel: "{{ repo }}/centos-kernel:3.10-x86_64-{{ tag }}", rootfs: "{{ repo }}/centos-image:3.10-x86_64-{{ tag }}", arch: "x86_64"} # noqa: yaml[line-length] + - {name: "centos-4.18", kernel: "{{ repo }}/centos-kernel:4.18-x86_64-{{ tag }}", rootfs: "{{ repo }}/centos-image:4.18-x86_64-{{ tag }}", arch: "x86_64"} # noqa: yaml[line-length] + - {name: "centos-5.14", kernel: "{{ repo }}/centos-kernel:5.14-x86_64-{{ tag }}", rootfs: "{{ repo }}/centos-image:5.14-x86_64-{{ tag }}", arch: "x86_64"} # noqa: yaml[line-length] + - {name: "fedora-5.17", kernel: "{{ repo }}/fedora-kernel:5.17-x86_64-{{ tag }}", rootfs: "{{ repo }}/fedora-image:5.17-x86_64-{{ tag }}", arch: "x86_64"} # noqa: yaml[line-length] + - {name: "fedora-5.8", kernel: "{{ repo }}/fedora-kernel:5.8-x86_64-{{ tag }}", rootfs: "{{ repo }}/fedora-image:5.8-x86_64-{{ tag }}", arch: "x86_64"} # noqa: yaml[line-length] + - {name: "fedora-6.2", kernel: "{{ repo }}/fedora-kernel:6.2-x86_64-{{ tag }}", rootfs: "{{ repo }}/fedora-image:6.2-x86_64-{{ tag }}", arch: "x86_64"} # noqa: yaml[line-length] + - {name: "oraclelinux-3.10", kernel: "{{ repo }}/oraclelinux-kernel:3.10-x86_64-{{ tag }}", rootfs: "{{ repo }}/oraclelinux-image:3.10-x86_64-{{ tag }}", arch: "x86_64"} # noqa: yaml[line-length] + - {name: "oraclelinux-4.14", kernel: "{{ repo }}/oraclelinux-kernel:4.14-x86_64-{{ tag }}", rootfs: "{{ repo }}/oraclelinux-image:4.14-x86_64-{{ tag }}", arch: "x86_64"} # noqa: yaml[line-length] + - {name: "oraclelinux-5.15", kernel: "{{ repo }}/oraclelinux-kernel:5.15-x86_64-{{ tag }}", rootfs: "{{ repo }}/oraclelinux-image:5.15-x86_64-{{ tag }}", arch: "x86_64"} # noqa: yaml[line-length] + - {name: "oraclelinux-5.4", kernel: "{{ repo }}/oraclelinux-kernel:5.4-x86_64-{{ tag }}", rootfs: "{{ repo }}/oraclelinux-image:5.4-x86_64-{{ tag }}", arch: "x86_64"} # noqa: yaml[line-length] + - {name: "ubuntu-4.15", kernel: "{{ repo }}/ubuntu-kernel:4.15-x86_64-{{ tag }}", rootfs: "{{ repo }}/ubuntu-image:4.15-x86_64-{{ tag }}", arch: "x86_64"} # noqa: yaml[line-length] + - {name: "ubuntu-6.5", kernel: "{{ repo }}/ubuntu-kernel:6.5-x86_64-{{ tag }}", rootfs: "{{ repo }}/ubuntu-image:6.5-x86_64-{{ tag }}", arch: "x86_64"} # noqa: yaml[line-length] + - {name: "amazonlinux2022-5.15", kernel: "{{ repo }}/amazonlinux2022-kernel:5.15-aarch64-{{ tag }}", rootfs: "{{ repo }}/amazonlinux2022-image:5.15-aarch64-{{ tag }}", arch: "aarch64"} # noqa: yaml[line-length] + - {name: "amazonlinux2-5.4", kernel: "{{ repo }}/amazonlinux2-kernel:5.4-aarch64-{{ tag }}", rootfs: "{{ repo }}/amazonlinux2-image:5.4-aarch64-{{ tag }}", arch: "aarch64"} # noqa: yaml[line-length] + - {name: "fedora-6.2", kernel: "{{ repo }}/fedora-kernel:6.2-aarch64-{{ tag }}", rootfs: "{{ repo }}/fedora-image:6.2-aarch64-{{ tag }}", arch: "aarch64"} # noqa: yaml[line-length] + - {name: "oraclelinux-4.14", kernel: "{{ repo }}/oraclelinux-kernel:4.14-aarch64-{{ tag }}", rootfs: "{{ repo }}/oraclelinux-image:4.14-aarch64-{{ tag }}", arch: "aarch64"} # noqa: yaml[line-length] + - {name: "oraclelinux-5.15", kernel: "{{ repo }}/oraclelinux-kernel:5.15-aarch64-{{ tag }}", rootfs: "{{ repo }}/oraclelinux-image:5.15-aarch64-{{ tag }}", arch: "aarch64"} # noqa: yaml[line-length] + - {name: "ubuntu-6.5", kernel: "{{ repo }}/ubuntu-kernel:6.5-aarch64-{{ tag }}", rootfs: "{{ repo }}/ubuntu-image:6.5-aarch64-{{ tag }}", arch: "aarch64"} # noqa: yaml[line-length] builders: - - {name: "centos-builder", kernel: "weaveworks/ignite-kernel:5.14.16", rootfs: "ghcr.io/falcosecurity/kernel-testing/builder:x86_64-{{ tag }}", arch: "x86_64"} # noqa: yaml[line-length] - - {name: "fedora-builder", kernel: "weaveworks/ignite-kernel:5.14.16", rootfs: "ghcr.io/falcosecurity/kernel-testing/modernprobe-builder:x86_64-{{ tag }}", arch: "x86_64"} # noqa: yaml[line-length] - - {name: "centos-builder", kernel: "weaveworks/ignite-kernel:5.14.16", rootfs: "ghcr.io/falcosecurity/kernel-testing/builder:aarch64-{{ tag }}", arch: "aarch64"} # noqa: yaml[line-length] - - {name: "fedora-builder", kernel: "weaveworks/ignite-kernel:5.14.16", rootfs: "ghcr.io/falcosecurity/kernel-testing/modernprobe-builder:aarch64-{{ tag }}", arch: "aarch64"} # noqa: yaml[line-length] + - {name: "centos-builder", kernel: "weaveworks/ignite-kernel:5.14.16", rootfs: "{{ repo }}/builder:x86_64-{{ tag }}", arch: "x86_64"} # noqa: yaml[line-length] + - {name: "fedora-builder", kernel: "weaveworks/ignite-kernel:5.14.16", rootfs: "{{ repo }}/modernprobe-builder:x86_64-{{ tag }}", arch: "x86_64"} # noqa: yaml[line-length] + - {name: "centos-builder", kernel: "weaveworks/ignite-kernel:5.14.16", rootfs: "{{ repo }}/builder:aarch64-{{ tag }}", arch: "aarch64"} # noqa: yaml[line-length] + - {name: "fedora-builder", kernel: "weaveworks/ignite-kernel:5.14.16", rootfs: "{{ repo }}/modernprobe-builder:aarch64-{{ tag }}", arch: "aarch64"} # noqa: yaml[line-length] output_dir: "~/ansible_output" # Number of cpus. diff --git a/images/Makefile b/images/Makefile index 0e0efa7..e5f56f7 100644 --- a/images/Makefile +++ b/images/Makefile @@ -1,10 +1,11 @@ -DRY_RUN := false -PUSH := false -LATEST := false +DRY_RUN ?= false +PUSH ?= false +LATEST ?= false TAG ?= main -REPOSITORY := ghcr.io/falcosecurity/kernel-testing +CLEANUP ?= false +REPOSITORY ?= ghcr.io/falcosecurity/kernel-testing ARCH ?= $(shell uname -m) -YAML_FILE := images.yaml +YAML_FILE ?= images.yaml .PHONY: build-rootfs build-kernel generate-yaml build-all initrd-builder modernprobe-builder builder @@ -12,7 +13,7 @@ builder: if [ "$(DRY_RUN)" = "true" ]; then \ echo "Dry run: Building builder image: docker build -t $(REPOSITORY)/builder:$(ARCH)-$(TAG)"; \ else \ - echo "Building modernprobe-builder image"; \ + echo "Building builder image"; \ image=$(REPOSITORY)/builder:$(ARCH); \ docker build -t $$image-$(TAG) builder || echo "FAIL: $$image-$(TAG)" >> failed.txt; \ if [ "$(PUSH)" = "true" ]; then \ @@ -72,9 +73,12 @@ build-rootfs: docker push $$image-latest; \ fi; \ fi; \ - docker image rm -f $$image-$(TAG); \ - docker image rm -f $$image-latest; \ - docker builder prune -f -a; \ + if [ "$(CLEANUP)" = "true" ]; then \ + echo "Cleaning image: $$image-$(TAG)"; \ + docker image rm -f $$image-$(TAG); \ + docker image rm -f $$image-latest; \ + docker system prune -f; \ + fi; \ fi; \ done @@ -97,9 +101,12 @@ build-kernel: initrd-builder docker push $$image-latest; \ fi; \ fi; \ - docker image rm -f $$image-$(TAG); \ - docker image rm -f $$image-latest; \ - docker builder prune -f -a; \ + if [ "$(CLEANUP)" = "true" ]; then \ + echo "Cleaning image: $$image-$(TAG)"; \ + docker image rm -f $$image-$(TAG); \ + docker image rm -f $$image-latest; \ + docker system prune -f; \ + fi; \ fi; \ done diff --git a/images/README.md b/images/README.md index 71fa1ac..7d04874 100644 --- a/images/README.md +++ b/images/README.md @@ -23,12 +23,22 @@ The Makefile provides several targets, each serving a specific purpose: - `build-rootfs` and `build-kernel`: These targets build root filesystem and kernel images, respectively. The `build-kernel` target depends on `initrd-builder`, which must be built first. -- `docker-push`: This target pushes the built images to a Docker Hub registry. You can use this step to make the images accessible to other systems. - - `generate-yaml`: This target generates a YAML file named `images.yaml`, which contains information about the built images. The YAML file includes details about the kernel and rootfs images for each version and distribution. This generated YAML file can be conveniently copied to the variables file of Ansible to keep the test environment up to date. - `build-all`: This target is a convenience target that sequentially builds both root filesystem and kernel images. +By default, no images will be pushed. You need to set the `PUSH` variable to `true` to enable images push to remote registry. +Also, the default images tag will be `main` and the images name will be built as: +``` +{{ repo }} /{{ distro }}-kernel:{{ kernelversion }}-{{ arch }}-{{ tag }} +``` +for kernel images, or +``` +{{ repo }} /{{ distro }}-image:{{ kernelversion }}-{{ arch }}-{{ tag }} +``` +for rootfs images. +Eg: `ghcr.io/falcosecurity/kernel-testing/amazonlinux2022-kernel:5.15-x86_64-main`. + ## Usage The typical workflow for using this Makefile is as follows: @@ -72,7 +82,13 @@ You can customize the Makefile to suit your specific requirements. The variables - `DRY_RUN`: Set this variable to `true` for a dry run, where the build commands will be printed but not executed. -- `PUSH`: Set this variable to `true` when executing build to also push built image to remote registry. +- `PUSH`: Set this variable to `true` to also push built images to remote registry. Disabled by default. + +- `LATEST`: Set this variable to `true` to also push built images as latest tag. Disabled by default. + +- `TAG`: Set this variable to the images tag name. Defaults to `main`. + +- `CLEANUP`: Set this variable to `true` to cleanup images right after they get built. This is useful to test images build in CI, where disk space might be limited. - `REPOSITORY`: The Docker repository where the built images will be tagged and pushed.