Skip to content

ci: add GitHub Action to build kvm_x86_64 ONIE image #1

ci: add GitHub Action to build kvm_x86_64 ONIE image

ci: add GitHub Action to build kvm_x86_64 ONIE image #1

Workflow file for this run

name: Build ONIE (kvm_x86_64)
# Builds the generic amd64 ONIE image for the kvm_x86_64 target, intended
# to run as a VM under KVM/QEMU. The build follows the upstream-recommended
# containerized flow (see contrib/build-env and machine/kvm_x86_64/INSTALL),
# with secure boot disabled so no signing keys are required.
on:
workflow_dispatch:
push:
paths:
- 'build-config/**'
- 'machine/kvm_x86_64/**'
- '.github/workflows/build-onie.yml'
- '.github/onie-build/**'
pull_request:
paths:
- 'build-config/**'
- 'machine/kvm_x86_64/**'
- '.github/workflows/build-onie.yml'
- '.github/onie-build/**'
jobs:
build:
name: Build kvm_x86_64
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build the ONIE build-environment image
run: |
docker build \
-t onie-build-env \
--build-arg UID=$(id -u) \
--build-arg GID=$(id -g) \
.github/onie-build
- name: Disable secure boot in the kernel config
# The kvm_x86_64 kernel config defaults to expecting signing keys.
# The repo ships a config-insecure variant for non-secure-boot builds.
run: cp machine/kvm_x86_64/kernel/config-insecure machine/kvm_x86_64/kernel/config
- name: Build ONIE
run: |
docker run --rm --privileged \
-v "${PWD}:/onie" \
onie-build-env \
bash -lc 'cd build-config && make -j"$(nproc)" \
MACHINE=kvm_x86_64 \
SECURE_BOOT_ENABLE=no \
SECURE_BOOT_EXT=no \
SECURE_GRUB=no \
all recovery-iso'