Skip to content

Commit dc00bdd

Browse files
deps: PR opencomputeproject#1129 (toolchain: Debian 13 / GCC 14 / crosstool-NG 1.28 / uClibc-ng 1.0.54 + secure-boot)
Squashed content of PR opencomputeproject#1129, pulled in as a dependency. Signed-off-by: Brad House <bhouse@nexthop.ai>
1 parent 1a24708 commit dc00bdd

640 files changed

Lines changed: 2639 additions & 89614 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/onie-build/Dockerfile

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
# ONIE build environment for CI.
22
#
3-
# Debian 11 is required: onie/build-config/Makefile still pulls in
4-
# python2-era tooling (python-all-dev) that is unavailable on newer
5-
# Debian releases.
3+
# Debian 13 (trixie) host for the modernized toolchain. Required because
4+
# kernel 6.18's objtool needs a newer host libelf than Debian 11 ships
5+
# (0.183 fails with "elf_update: invalid section alignment"), and
6+
# crosstool-NG 1.28 / GCC 14 align with the trixie host toolchain. (The
7+
# old crosstool-NG 1.24 / GCC 8.3 toolchain could NOT build on trixie.)
68
#
79
# This image builds the generic kvm_x86_64 target with secure boot
8-
# enabled. It includes the secure-boot key-generation and EFI signing
9-
# tooling (gnupg2, efitools, sbsigntool), the NSS command-line tools the
10-
# shim signing step shells out to (libnss3-tools: pk12util/certutil), and
11-
# the build dependencies for the pesign that ONIE compiles from source
12-
# (NSS/NSPR dev packages).
13-
FROM debian:11
10+
# enabled. It includes the secure-boot tooling needed to exercise the SB
11+
# build path -- pesign, efitools, sbsigntool and gnupg2 (for key
12+
# generation and EFI signing).
13+
FROM debian:13
1414
WORKDIR /onie
1515

1616
# Tolerate transient Debian mirror hiccups (connection resets mid-fetch).
@@ -24,7 +24,7 @@ RUN apt-get update && apt-get install -y \
2424
autopoint \
2525
bc \
2626
bison \
27-
bsdmainutils \
27+
bsdextrautils \
2828
build-essential \
2929
coreutils \
3030
cpio \
@@ -43,19 +43,15 @@ RUN apt-get update && apt-get install -y \
4343
libelf-dev \
4444
libexpat1 \
4545
libexpat1-dev \
46-
libncurses5 \
47-
libncurses5-dev \
48-
libnspr4-dev \
49-
libnss3-dev \
50-
libnss3-tools \
46+
libncurses-dev \
5147
libpopt-dev \
5248
libssl-dev \
5349
libtool \
5450
libtool-bin \
5551
locales \
5652
mtools \
53+
pesign \
5754
pkgconf \
58-
python-all-dev \
5955
python3-all-dev \
6056
python3-sphinx \
6157
python3-venv \

.github/workflows/build-onie.yml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,17 @@ name: Build ONIE (kvm_x86_64)
1212
# filtering would risk skipping validation on build-affecting changes.
1313
on:
1414
workflow_dispatch:
15+
inputs:
16+
oce_scope:
17+
description: >-
18+
OCE compliance test scope: "default" (a fast representative
19+
subset, also what push/PR runs) or "full" (the entire OCE
20+
installer+updater sweep, tests 3-121 -- slow, many VM boots).
21+
type: choice
22+
default: default
23+
options:
24+
- default
25+
- full
1526
push:
1627
pull_request:
1728

@@ -29,6 +40,18 @@ jobs:
2940
- name: Checkout
3041
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3142

43+
# The GCC 14 / Debian 13 toolchain build plus the full image (restored
44+
# x-tools cache + every package + kernel + recovery ISO) exceeds the
45+
# ~14 GB free on a stock ubuntu-latest runner. Reclaim ~25 GB of
46+
# preinstalled toolchains we do not use so the build has headroom.
47+
- name: Free up runner disk space
48+
run: |
49+
echo "Disk before cleanup:"; df -h /
50+
sudo rm -rf /usr/local/lib/android /opt/hostedtoolcache /usr/share/dotnet \
51+
/usr/local/.ghcup /usr/share/swift /usr/local/share/powershell \
52+
/usr/local/lib/node_modules || true
53+
echo "Disk after cleanup:"; df -h /
54+
3255
- name: Set up Docker Buildx
3356
uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4.1.0
3457

@@ -300,3 +323,63 @@ jobs:
300323
name: onie-install-serial-log
301324
path: onie-install-*.log
302325
retention-days: 7
326+
327+
# Run ONIE's own OCE (ONIE Compliance Environment, contrib/oce) compliance
328+
# suite against the image. Where install-test hands ONIE the installer URL
329+
# directly (install_url=), OCE exercises the REAL OCP discovery path: it
330+
# stands up isc-dhcp-server advertising the ONIE VIVSO vendor option (DHCP
331+
# option 125) plus an nginx HTTP server, and ONIE must DHCP, read the VIVSO
332+
# installer URL, and fetch+install the image itself. OCE needs L2 to the DUT
333+
# (it validates the DUT shares the host interface's subnet), so the VM is on a
334+
# tap interface rather than user-mode SLIRP. contrib/oce is python3 (it was
335+
# ported in the python2-to-3 PR this is stacked on). See
336+
# emulation/ci-oce-test.sh.
337+
oce-test:
338+
name: OCE compliance kvm_x86_64
339+
# Chained after install-test (not parallel) so only one VM-heavy job runs
340+
# at a time, keeping CI resource use low.
341+
needs: install-test
342+
runs-on: ubuntu-latest
343+
steps:
344+
- name: Checkout
345+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
346+
- name: Enable KVM (grant /dev/kvm access)
347+
run: |
348+
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' \
349+
| sudo tee /etc/udev/rules.d/99-kvm4all.rules
350+
sudo udevadm control --reload-rules
351+
sudo udevadm trigger --name-match=kvm
352+
- name: Install QEMU + OCE service backends + python deps
353+
run: |
354+
sudo apt-get update
355+
sudo apt-get install -y --no-install-recommends \
356+
qemu-system-x86 qemu-utils isc-dhcp-server nginx-light tftpd-hpa \
357+
dnsmasq dosfstools python3-venv
358+
python3 -m venv /tmp/oce-venv
359+
/tmp/oce-venv/bin/pip install --quiet jinja2 netifaces psutil
360+
- name: Download install-test images
361+
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
362+
with:
363+
name: onie-kvm-install-images
364+
path: build/images
365+
- name: Run OCE compliance test (full install/update via OCP discovery)
366+
run: |
367+
# On push/PR (no dispatch input) run the fast "default" subset; a
368+
# human can manually dispatch this workflow with oce_scope=full to
369+
# run the entire OCE installer+updater sweep.
370+
SCOPE="${{ inputs.oce_scope }}"
371+
[ -z "$SCOPE" ] && SCOPE=default
372+
OCE_PYTHON=/tmp/oce-venv/bin/python SERIAL_PREFIX="$PWD/onie-oce" \
373+
emulation/ci-oce-test.sh \
374+
build/images/kvm_x86_64-r0.vmlinuz \
375+
build/images/kvm_x86_64-r0.initrd \
376+
build/images/demo-installer-x86_64-kvm_x86_64-r0.bin \
377+
build/images/onie-updater-x86_64-kvm_x86_64-r0 \
378+
"$SCOPE"
379+
- name: Upload OCE serial logs
380+
if: always()
381+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
382+
with:
383+
name: onie-oce-serial-log
384+
path: onie-oce-*.log
385+
retention-days: 7
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: git-stats (gitdm)
2+
3+
# Validate the contrib/git-stats tooling. gitdm is no longer vendored in the
4+
# tree: onie-git-stats auto-installs a pinned python3 gitdm on first run, and
5+
# honors $GITDM to use a pre-existing install instead. This check exercises
6+
# both paths end-to-end (a report is actually generated), so the change can be
7+
# trusted without manual testing. Scoped to contrib/git-stats (and this
8+
# workflow file) since nothing else affects it.
9+
on:
10+
workflow_dispatch:
11+
push:
12+
paths:
13+
- 'contrib/git-stats/**'
14+
- '.github/workflows/git-stats-test.yml'
15+
pull_request:
16+
paths:
17+
- 'contrib/git-stats/**'
18+
- '.github/workflows/git-stats-test.yml'
19+
20+
# Cancel an in-progress run when a newer commit is pushed to the same ref.
21+
concurrency:
22+
group: ${{ github.workflow }}-${{ github.ref }}
23+
cancel-in-progress: true
24+
25+
jobs:
26+
git-stats:
27+
name: onie-git-stats
28+
runs-on: ubuntu-latest
29+
steps:
30+
- name: Checkout
31+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
32+
with:
33+
# onie-git-stats runs "git log <range>"; fetch enough history for it.
34+
fetch-depth: 50
35+
36+
- name: Auto-install path (clone a python3 gitdm, generate a report)
37+
working-directory: contrib/git-stats
38+
run: |
39+
set -eu
40+
./onie-git-stats HEAD~10..HEAD ci
41+
test -d .gitdm # auto-install actually happened
42+
test -s /tmp/ci-results.txt # non-empty text report
43+
test -s /tmp/ci-results.html # non-empty html report
44+
grep -q "Processed" /tmp/ci-results.txt
45+
echo "auto-install path OK"
46+
47+
- name: Override path ($GITDM bypasses the auto-install)
48+
working-directory: contrib/git-stats
49+
run: |
50+
set -eu
51+
# Reuse the gitdm cloned above as a "pre-existing" install, drop the
52+
# auto-install cache, and confirm the override does NOT re-clone it.
53+
mv .gitdm "$RUNNER_TEMP/gitdm"
54+
GITDM="$RUNNER_TEMP/gitdm/gitdm" ./onie-git-stats HEAD~10..HEAD ci2
55+
test ! -e .gitdm # override must skip the clone
56+
test -s /tmp/ci2-results.txt
57+
grep -q "Processed" /tmp/ci2-results.txt
58+
echo "override path OK"

build-config/Makefile

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -358,8 +358,6 @@ SECURE_GRUB ?= no
358358

359359
ifeq ($(SECURE_BOOT_ENABLE),yes)
360360
SHIM_ENABLE = yes
361-
PESIGN_ENABLE = yes
362-
GNU_EFI_ENABLE = yes
363361
OPENSSL_ENABLE = yes
364362
MOKUTIL_ENABLE = yes
365363
KEYUTILS_ENABLE = yes
@@ -374,9 +372,6 @@ ifeq ($(XTOOLS_ENABLE),yes)
374372
include make/xtools.make
375373
endif
376374
include make/sysroot.make
377-
ifeq ($(GNU_EFI_ENABLE),yes)
378-
include make/gnu-efi.make
379-
endif
380375
include make/kernel.make
381376
ifeq ($(UBOOT_ENABLE),yes)
382377
include make/u-boot.make
@@ -398,6 +393,8 @@ ifeq ($(GPT_ENABLE),yes)
398393
include make/gptfdisk.make
399394
endif
400395
ifeq ($(LVM2_ENABLE),yes)
396+
# lvm2 >= 2.03 requires libaio for its bcache I/O engine.
397+
include make/libaio.make
401398
include make/lvm2.make
402399
endif
403400
ifeq ($(PARTED_ENABLE),yes)
@@ -420,6 +417,8 @@ ifeq ($(DMIDECODE_ENABLE),yes)
420417
include make/dmidecode.make
421418
endif
422419
ifeq ($(ETHTOOL_ENABLE),yes)
420+
# ethtool's netlink interface needs libmnl.
421+
include make/libmnl.make
423422
include make/ethtool.make
424423
endif
425424
ifeq ($(MTREE_ENABLE),yes)
@@ -441,9 +440,6 @@ endif
441440
ifeq ($(IPMITOOL_ENABLE),yes)
442441
include make/ipmitool.make
443442
endif
444-
ifeq ($(PESIGN_ENABLE),yes)
445-
include make/pesign.make
446-
endif
447443
ifeq ($(OPENSSL_ENABLE),yes)
448444
include make/openssl.make
449445
endif
@@ -515,13 +511,11 @@ ifeq ($(FIRMWARE_UPDATE_ENABLE),yes)
515511
include make/firmware-update.make
516512
endif
517513

518-
# Pre Debian 11 environments just had /usr/bin/python
519-
# Now the environment distinguishes between python2 and python3
520-
# If 'python' is not present, default to python2
521-
ifeq (, $(shell which python ))
522-
export PYTHON=python2
523-
endif
524-
514+
# Some sub-package build scripts (notably grub's autogen.sh) invoke the
515+
# interpreter as "${PYTHON:-python}". A bare "python" no longer exists on
516+
# modern systems now that python2 is gone, so point $(PYTHON) at python3.
517+
# (grub's build scripts -- gentpl.py, import_gcry.py -- are python3-safe.)
518+
export PYTHON ?= python3
525519

526520
#-------------------------------------------------------------------------------
527521
#
@@ -594,11 +588,11 @@ machine-prefix:
594588
# The onie/build-config/scripts/onie-build-targets.json file lists
595589
# platforms and known working build environments.
596590
DEBIAN_BUILD_HOST_PACKAGES = build-essential stgit u-boot-tools util-linux \
597-
gperf device-tree-compiler python-all-dev xorriso \
591+
gperf device-tree-compiler python3-all-dev xorriso \
598592
autoconf automake bison flex texinfo libtool libtool-bin \
599593
gawk libncurses5 libncurses5-dev bc \
600594
dosfstools mtools pkg-config git wget help2man libexpat1 \
601-
libexpat1-dev fakeroot python-sphinx rst2pdf \
595+
libexpat1-dev fakeroot python3-sphinx rst2pdf \
602596
libefivar-dev libnss3-tools libnss3-dev libpopt-dev \
603597
libssl-dev sbsigntool uuid-runtime uuid-dev cpio \
604598
bsdmainutils unzip

0 commit comments

Comments
 (0)