mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-26 11:39:29 +00:00
Merge pull request #11001 from RuoqingHe/enable-riscv-kernel-build
kernel: Support and enable riscv kernel build
This commit is contained in:
commit
592d58ca52
1
.github/actionlint.yaml
vendored
1
.github/actionlint.yaml
vendored
@ -18,6 +18,7 @@ self-hosted-runner:
|
|||||||
- k8s-ppc64le
|
- k8s-ppc64le
|
||||||
- metrics
|
- metrics
|
||||||
- ppc64le
|
- ppc64le
|
||||||
|
- riscv-builder
|
||||||
- sev
|
- sev
|
||||||
- sev-snp
|
- sev-snp
|
||||||
- s390x
|
- s390x
|
||||||
|
79
.github/workflows/build-kata-static-tarball-riscv64.yaml
vendored
Normal file
79
.github/workflows/build-kata-static-tarball-riscv64.yaml
vendored
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
name: CI | Build kata-static tarball for riscv64
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
stage:
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
default: test
|
||||||
|
tarball-suffix:
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
push-to-registry:
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
default: no
|
||||||
|
commit-hash:
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
target-branch:
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
default: ""
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-asset:
|
||||||
|
runs-on: riscv-builder
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
packages: write
|
||||||
|
id-token: write
|
||||||
|
attestations: write
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
asset:
|
||||||
|
- kernel
|
||||||
|
- virtiofsd
|
||||||
|
steps:
|
||||||
|
- name: Login to Kata Containers quay.io
|
||||||
|
if: ${{ inputs.push-to-registry == 'yes' }}
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: quay.io
|
||||||
|
username: ${{ secrets.QUAY_DEPLOYER_USERNAME }}
|
||||||
|
password: ${{ secrets.QUAY_DEPLOYER_PASSWORD }}
|
||||||
|
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: ${{ inputs.commit-hash }}
|
||||||
|
fetch-depth: 0 # This is needed in order to keep the commit ids history
|
||||||
|
|
||||||
|
- name: Rebase atop of the latest target branch
|
||||||
|
run: |
|
||||||
|
./tests/git-helper.sh "rebase-atop-of-the-latest-target-branch"
|
||||||
|
env:
|
||||||
|
TARGET_BRANCH: ${{ inputs.target-branch }}
|
||||||
|
|
||||||
|
- name: Build ${{ matrix.asset }}
|
||||||
|
run: |
|
||||||
|
make "${KATA_ASSET}-tarball"
|
||||||
|
build_dir=$(readlink -f build)
|
||||||
|
# store-artifact does not work with symlink
|
||||||
|
mkdir -p kata-build && cp "${build_dir}"/kata-static-"${KATA_ASSET}"*.tar.* kata-build/.
|
||||||
|
env:
|
||||||
|
KATA_ASSET: ${{ matrix.asset }}
|
||||||
|
TAR_OUTPUT: ${{ matrix.asset }}.tar.gz
|
||||||
|
PUSH_TO_REGISTRY: ${{ inputs.push-to-registry }}
|
||||||
|
ARTEFACT_REGISTRY: ghcr.io
|
||||||
|
ARTEFACT_REGISTRY_USERNAME: ${{ github.actor }}
|
||||||
|
ARTEFACT_REGISTRY_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
TARGET_BRANCH: ${{ inputs.target-branch }}
|
||||||
|
RELEASE: ${{ inputs.stage == 'release' && 'yes' || 'no' }}
|
||||||
|
|
||||||
|
- name: store-artifact ${{ matrix.asset }}
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: kata-artifacts-arm64-${{ matrix.asset }}${{ inputs.tarball-suffix }}
|
||||||
|
path: kata-build/kata-static-${{ matrix.asset }}.tar.xz
|
||||||
|
retention-days: 15
|
||||||
|
if-no-files-found: error
|
@ -94,7 +94,7 @@ Commands:
|
|||||||
|
|
||||||
Options:
|
Options:
|
||||||
|
|
||||||
-a <arch> : Arch target to build the kernel, such as aarch64/ppc64le/s390x/x86_64.
|
-a <arch> : Arch target to build the kernel, such as aarch64/ppc64le/riscv64/s390x/x86_64.
|
||||||
-b <type> : Enable optional config type.
|
-b <type> : Enable optional config type.
|
||||||
-c <path> : Path to config file to build the kernel.
|
-c <path> : Path to config file to build the kernel.
|
||||||
-D <vendor> : DPU/SmartNIC vendor, only nvidia.
|
-D <vendor> : DPU/SmartNIC vendor, only nvidia.
|
||||||
@ -124,6 +124,7 @@ arch_to_kernel() {
|
|||||||
case "$arch" in
|
case "$arch" in
|
||||||
aarch64) echo "arm64" ;;
|
aarch64) echo "arm64" ;;
|
||||||
ppc64le) echo "powerpc" ;;
|
ppc64le) echo "powerpc" ;;
|
||||||
|
riscv64) echo "riscv" ;;
|
||||||
s390x) echo "s390" ;;
|
s390x) echo "s390" ;;
|
||||||
x86_64) echo "$arch" ;;
|
x86_64) echo "$arch" ;;
|
||||||
*) die "unsupported architecture: $arch" ;;
|
*) die "unsupported architecture: $arch" ;;
|
||||||
@ -551,7 +552,7 @@ install_kata() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Install uncompressed kernel
|
# Install uncompressed kernel
|
||||||
if [ "${arch_target}" = "arm64" ]; then
|
if [ "${arch_target}" = "arm64" ] || [ "${arch_target}" = "riscv" ]; then
|
||||||
install --mode 0644 -D "arch/${arch_target}/boot/Image" "${install_path}/${vmlinux}"
|
install --mode 0644 -D "arch/${arch_target}/boot/Image" "${install_path}/${vmlinux}"
|
||||||
elif [ "${arch_target}" = "s390" ]; then
|
elif [ "${arch_target}" = "s390" ]; then
|
||||||
install --mode 0644 -D "arch/${arch_target}/boot/vmlinux" "${install_path}/${vmlinux}"
|
install --mode 0644 -D "arch/${arch_target}/boot/vmlinux" "${install_path}/${vmlinux}"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# !s390x !powerpc
|
# !s390x !powerpc !riscv
|
||||||
|
|
||||||
# enable ACPI support.
|
# enable ACPI support.
|
||||||
# This could do with REVIEW
|
# This could do with REVIEW
|
||||||
|
5
tools/packaging/kernel/configs/fragments/riscv/base.conf
Normal file
5
tools/packaging/kernel/configs/fragments/riscv/base.conf
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
CONFIG_RISCV=y
|
||||||
|
CONFIG_64BIT=y
|
||||||
|
|
||||||
|
CONFIG_VIRTUALIZATION=y
|
||||||
|
CONFIG_KVM=y
|
6
tools/packaging/kernel/configs/fragments/riscv/mmu.conf
Normal file
6
tools/packaging/kernel/configs/fragments/riscv/mmu.conf
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
# riscv specific memory related items
|
||||||
|
|
||||||
|
CONFIG_NUMA=y
|
||||||
|
CONFIG_SPARSEMEM=y
|
||||||
|
CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
|
||||||
|
CONFIG_MEMORY_HOTPLUG=y
|
4
tools/packaging/kernel/configs/fragments/riscv/pci.conf
Normal file
4
tools/packaging/kernel/configs/fragments/riscv/pci.conf
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
CONFIG_PCI_HOST_COMMON=y
|
||||||
|
CONFIG_PCI_HOST_GENERIC=y
|
||||||
|
|
||||||
|
CONFIG_PCI_MSI_IRQ_DOMAIN=y
|
@ -1 +1 @@
|
|||||||
149
|
150
|
||||||
|
Loading…
Reference in New Issue
Block a user