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 new file mode 100644 index 0000000..d918deb --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,20 @@ +name: Main CI +on: + push: + branches: + - main + paths: + - 'images/**' + +concurrency: + group: main_push_images + cancel-in-progress: true + +jobs: + push-images: + 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..be27cd3 --- /dev/null +++ b/.github/workflows/reusable_build_images.yml @@ -0,0 +1,71 @@ +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: Set CLEANUP env var (CI only, because of limited disk space) + run: | + echo "CLEANUP=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 diff --git a/ansible-playbooks/group_vars/all/vars.yml b/ansible-playbooks/group_vars/all/vars.yml index b6fac76..ffc109b 100644 --- a/ansible-playbooks/group_vars/all/vars.yml +++ b/ansible-playbooks/group_vars/all/vars.yml @@ -10,43 +10,50 @@ user: root # Machine Configuration # ######################### +# 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: "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: "{{ 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: "therealbobo/centos-kernel:5.14-x86_64", 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: "{{ 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 611c55c..e5f56f7 100644 --- a/images/Makefile +++ b/images/Makefile @@ -1,32 +1,57 @@ -DRY_RUN := false -REPOSITORY := falcosecurity/kernel-testing +DRY_RUN ?= false +PUSH ?= false +LATEST ?= false +TAG ?= main +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 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 \ - 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 "Building builder image"; \ + image=$(REPOSITORY)/builder:$(ARCH); \ + docker build -t $$image-$(TAG) builder || echo "FAIL: $$image-$(TAG)" >> failed.txt; \ + if [ "$(PUSH)" = "true" ]; then \ + 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:$(ARCH)-$(TAG) modernprobe-builder"; \ else \ echo "Building modernprobe-builder image"; \ - docker build -t $(REPOSITORY)/modernprobe-builder:0.0.1-$(ARCH) modernprobe-builder; \ + 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: $$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"; \ 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: @@ -35,10 +60,25 @@ 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 "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-$(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; \ + 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 @@ -48,47 +88,60 @@ 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"; \ - 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"; \ + echo "Dry run: Building kernel image: docker build -t $$image-$(TAG) -f $$kernel_dir/Dockerfile.kernel $$kernel_dir"; \ else \ - echo "Pushing image: $$image"; \ - docker push $$image; \ + 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-$(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; \ + 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 %: 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; \ + 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; \ + 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) @@ -102,4 +155,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..7d04874 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 @@ -24,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: @@ -73,6 +82,14 @@ 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` 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. - `ARCH`: The architecture for which the images will be built. By default, it will use the output of `uname -p`. diff --git a/images/aarch64/amazonlinux2/5.4/Dockerfile b/images/aarch64/amazonlinux2/5.4/Dockerfile index 6436447..757ac30 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 \ @@ -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 c119c29..f9b4238 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-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 +28,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 +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/5.4.247-162.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 366f934..2182368 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' @@ -26,12 +26,10 @@ 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/ && \ - 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}.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 daddc94..c8af74e 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-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 +29,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 +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/5.15.73-45.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/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 b/images/aarch64/fedora/6.2/Dockerfile index 837d1a0..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,13 +15,12 @@ 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 && \ + 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 f1a2cad..f35cc2a 100644 --- a/images/aarch64/fedora/6.2/Dockerfile.kernel +++ b/images/aarch64/fedora/6.2/Dockerfile.kernel @@ -1,18 +1,23 @@ -FROM initrd-builder:0.0.1 AS stage1 - 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 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 && \ @@ -27,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 aarch64 $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 && \ @@ -37,6 +42,9 @@ RUN touch .placeholder && \ FROM fedora:38 as kmod-builder +ARG VERSION +ARG ARCHITECTURE + WORKDIR /home/ubuntu COPY --from=stage1 /home/ubuntu/extracted /home/ubuntu/extracted/ COPY --from=stage1 /opt/initrd-builder/* /opt/initrd-builder/ @@ -45,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/6.2.9-300.fc38.aarch64/" 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/4.14/Dockerfile.kernel b/images/aarch64/oraclelinux/4.14/Dockerfile.kernel index 18fe76c..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 && \ @@ -20,6 +23,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 +35,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 +51,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 b/images/aarch64/oraclelinux/5.15/Dockerfile index e90ec1d..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,11 +18,10 @@ 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 bpftool.rpm ${URL}/getPackage/bpftool-${VERSION}.el9uek.${ARCH}.rpm && \ - yum install -y ./kernel.rpm ./devel.rpm ./modules.rpm ./bpftool.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 && \ echo 'UseDNS no' >> /etc/ssh/sshd_config && \ @@ -31,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 a8016e7..93705bb 100644 --- a/images/aarch64/oraclelinux/5.15/Dockerfile.kernel +++ b/images/aarch64/oraclelinux/5.15/Dockerfile.kernel @@ -1,15 +1,19 @@ -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' +ARG ARCHITECTURE='aarch64' + +FROM initrd-builder:0.0.1 AS stage1 + +ARG VERSION +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 && \ @@ -24,6 +28,9 @@ RUN touch .placeholder && \ FROM oraclelinux:9 as kmod-builder +ARG VERSION +ARG ARCHITECTURE + WORKDIR /home/ubuntu COPY --from=stage1 /home/ubuntu/extracted /home/ubuntu/extracted/ COPY --from=stage1 /opt/initrd-builder/* /opt/initrd-builder/ @@ -33,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/5.15.0-8.91.4.1.el9uek.aarch64/" 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/aarch64/ubuntu/6.3/Dockerfile b/images/aarch64/ubuntu/6.5/Dockerfile similarity index 92% rename from images/aarch64/ubuntu/6.3/Dockerfile rename to images/aarch64/ubuntu/6.5/Dockerfile index 083f27b..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 @@ -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/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 diff --git a/images/x86_64/amazonlinux2/4.19/Dockerfile.kernel b/images/x86_64/amazonlinux2/4.19/Dockerfile.kernel index 537a581..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.x86_64/" 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 bea40cd..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.x86_64/" 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 af38f6a..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.x86_64/" 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 c3b9120..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.x86_64/" 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 b/images/x86_64/amazonlinux2022/5.15/Dockerfile index cb9013e..64d44c5 100644 --- a/images/x86_64/amazonlinux2022/5.15/Dockerfile +++ b/images/x86_64/amazonlinux2022/5.15/Dockerfile @@ -25,14 +25,12 @@ 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 && \ 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..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 +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/5.15.73-45.135.amzn2022.x86_64/" 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 b/images/x86_64/amazonlinux2023/6.1/Dockerfile index 82694e4..b429ed6 100644 --- a/images/x86_64/amazonlinux2023/6.1/Dockerfile +++ b/images/x86_64/amazonlinux2023/6.1/Dockerfile @@ -25,14 +25,12 @@ 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/ && \ - 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..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 +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/6.1.34-58.102.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 b/images/x86_64/archlinux/5.18/Dockerfile index d783ff0..3bd9a57 100644 --- a/images/x86_64/archlinux/5.18/Dockerfile +++ b/images/x86_64/archlinux/5.18/Dockerfile @@ -1,11 +1,10 @@ -FROM archlinux:base +FROM archlinux/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 \ - bpf \ clang \ cmake \ gcc \ diff --git a/images/x86_64/archlinux/5.18/Dockerfile.kernel b/images/x86_64/archlinux/5.18/Dockerfile.kernel index 40cf0c5..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=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 +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 b/images/x86_64/archlinux/6.0/Dockerfile index dd9b49e..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,11 +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 && \ - 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 && \ 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.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 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..3c0bf76 --- /dev/null +++ b/images/x86_64/archlinux/6.7/Dockerfile.kernel @@ -0,0 +1,29 @@ +ARG VERSION +ARG URL +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 ARCHITECTURE=x86_64 + +WORKDIR /home/ubuntu + +RUN touch .placeholder && \ + 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 | \ + 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..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/ @@ -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.${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 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..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-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 +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/4.18.0-497.el8.x86_64" 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 b/images/x86_64/centos/5.14/Dockerfile index 43db49b..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' && \ @@ -17,7 +16,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/centos/5.14/Dockerfile.kernel b/images/x86_64/centos/5.14/Dockerfile.kernel index a02ff8d..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-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 +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/5.14.0-325.el9.x86_64" 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 b/images/x86_64/fedora/5.17/Dockerfile index 90e4ae2..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 \ @@ -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.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 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/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 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/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 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 7137044..0000000 --- a/images/x86_64/oraclelinux/2.6/Dockerfile.kernel +++ /dev/null @@ -1,53 +0,0 @@ -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' - -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 && \ - 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 - -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 && \ - cd src && \ - curl -Lo source.rpm 'https://oss.oracle.com/ol6/SRPMS-updates/kernel-uek-2.6.39-400.330.1.el6uek.src.rpm' && \ - rpm2cpio source.rpm > source.cpio && \ - cpio -idmv < ./source.cpio && \ - tar -xaf linux-2.6.39.tar.bz2 && \ - cd .. && \ - cp -v /opt/initrd-builder/Makefile.virtio_mmio Makefile && \ - 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/ diff --git a/images/x86_64/oraclelinux/3.10/Dockerfile.kernel b/images/x86_64/oraclelinux/3.10/Dockerfile.kernel index bdd3f9b..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/ @@ -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.${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 d43f49f..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/4.14.35-2047.526.2.el7uek.x86_64/" 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 b/images/x86_64/oraclelinux/5.15/Dockerfile index 76c28a2..f789e6d 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 && \ @@ -31,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 10ff9f4..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/5.15.0-8.91.4.1.el9uek.x86_64/" 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 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 f7b8563..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/5.4.17-2136.320.7.1.el8uek.x86_64/" make + KERNEL_DIR="/home/ubuntu/extracted/usr/src/kernels/${VERSION}.el8uek.${ARCHITECTURE}/" 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 e6c17c0..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-26-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 da1aa91..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-26-generic +ARG VERSION=6.2.0-36-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