From 0001218d6ebd278d5de5b5090c285e35d6d6fa99 Mon Sep 17 00:00:00 2001 From: Tobias Jungel Date: Thu, 17 Sep 2026 11:14:59 +0200 Subject: [PATCH 1/4] Remove chost image from flavors (#340) This is no longer in use Backport of 58f2e38a3dfb93b5f633d59f77f21b164af2d972 Signed-off-by: Tobias Jungel <1773291+toanju@users.noreply.github.com> Co-authored-by: Tobias Jungel <1773291+toanju@users.noreply.github.com> --- flavors.yaml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/flavors.yaml b/flavors.yaml index 8ed403a..c7fda61 100644 --- a/flavors.yaml +++ b/flavors.yaml @@ -2,14 +2,6 @@ targets: - name: metal category: baremetal flavors: - - features: - - chost - - _pxe - arch: amd64 - build: true - test: true - test-platform: false - publish: false - features: - sci - _pxe From 9cb8342d5572dca5254ae2bbc42c4ab555fa9f31 Mon Sep 17 00:00:00 2001 From: Tobias Jungel Date: Thu, 17 Sep 2026 11:15:08 +0200 Subject: [PATCH 2/4] Update github actions (#339) * upload-artifact v4 -> v7 * oras-project/setup-oras v1 -> v2 Backport of 1da70f9b6c721657c2a7701accd1aa0a5429495d Signed-off-by: Tobias Jungel <1773291+toanju@users.noreply.github.com> Co-authored-by: Tobias Jungel <1773291+toanju@users.noreply.github.com> --- .github/actions/test/integration/collect-logs/action.yml | 4 ++-- .github/actions/test/integration/dependencies/action.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/actions/test/integration/collect-logs/action.yml b/.github/actions/test/integration/collect-logs/action.yml index 0974c81..acba525 100644 --- a/.github/actions/test/integration/collect-logs/action.yml +++ b/.github/actions/test/integration/collect-logs/action.yml @@ -69,13 +69,13 @@ runs: done - name: Upload debug logs - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: debug-logs path: "*.log" - name: Upload coredumps (if any exist) - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 if: ${{ hashFiles('coredumps-*/**') != '' }} with: name: coredumps diff --git a/.github/actions/test/integration/dependencies/action.yml b/.github/actions/test/integration/dependencies/action.yml index 65fb700..d92f0d2 100644 --- a/.github/actions/test/integration/dependencies/action.yml +++ b/.github/actions/test/integration/dependencies/action.yml @@ -27,7 +27,7 @@ runs: sudo systemctl restart libvirtd - name: oras - uses: oras-project/setup-oras@v1 + uses: oras-project/setup-oras@1d808f7d7f6995cc68b7bf507bfe5c5446e1dc9d # v2 with: version: 1.2.2 From e553446358ab2d5b179c1f2b36789d0caf37a2ce Mon Sep 17 00:00:00 2001 From: Tobias Jungel Date: Thu, 17 Sep 2026 12:56:29 +0200 Subject: [PATCH 3/4] Disable USB ethernet modules (#341) In case the actual Ethernet driver takes longer to initialize we want to prevent that a system is marked online before it actually is. Backport of 897e2c5acdc42311c8f787466dcffc31f5db18bb Signed-off-by: Tobias Jungel <1773291+toanju@users.noreply.github.com> Co-authored-by: Tobias Jungel <1773291+toanju@users.noreply.github.com> --- .../file.include/etc/modprobe.d/disabled_usb_ether.conf | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 features/_scicommon/file.include/etc/modprobe.d/disabled_usb_ether.conf diff --git a/features/_scicommon/file.include/etc/modprobe.d/disabled_usb_ether.conf b/features/_scicommon/file.include/etc/modprobe.d/disabled_usb_ether.conf new file mode 100644 index 0000000..a19783a --- /dev/null +++ b/features/_scicommon/file.include/etc/modprobe.d/disabled_usb_ether.conf @@ -0,0 +1,2 @@ +blacklist cdc_ether +blacklist cdc_ncm From f8f24a43d3835df3079b437f7f47631e21418b8d Mon Sep 17 00:00:00 2001 From: Tobias Jungel Date: Fri, 18 Sep 2026 16:07:17 +0200 Subject: [PATCH 4/4] Disable intel_idle driver to prevent CPU from entering idle states (#335) Ensure that the CPU remains in an active state and does not enter low-power modes that could affect performance. This is only applied for Intel CPUs and only for the `_usi` feature. Details in https://docs.kernel.org/admin-guide/pm/intel_idle.html Backport of 11cfae8bd2e188259770910a8e9a1254f5ba6887 Signed-off-by: Tobias Jungel <1773291+toanju@users.noreply.github.com> Co-authored-by: Tobias Jungel <1773291+toanju@users.noreply.github.com> --- features/_usi/initrd.include/usr/bin/persist | 127 +++++++++++++++++-- 1 file changed, 113 insertions(+), 14 deletions(-) diff --git a/features/_usi/initrd.include/usr/bin/persist b/features/_usi/initrd.include/usr/bin/persist index 26fcaca..aa7dd4a 100755 --- a/features/_usi/initrd.include/usr/bin/persist +++ b/features/_usi/initrd.include/usr/bin/persist @@ -25,9 +25,10 @@ case "$(uname -m)" in esac # prepare bootloader -esp_dir="/sysroot/efi" +sysroot="/sysroot" +esp_dir="$sysroot/efi" mkdir -p "$esp_dir/EFI/BOOT" -cp "/sysroot/usr/lib/systemd/boot/efi/systemd-boot$(tr '[:upper:]' '[:lower:]' <<< "$uefi_arch").efi" "$esp_dir/EFI/BOOT/BOOT$uefi_arch.EFI" +cp "$sysroot/usr/lib/systemd/boot/efi/systemd-boot$(tr '[:upper:]' '[:lower:]' <<< "$uefi_arch").efi" "$esp_dir/EFI/BOOT/BOOT$uefi_arch.EFI" mkdir -p "$esp_dir/loader" cat > "$esp_dir/loader/loader.conf" << EOF @@ -84,19 +85,117 @@ OCI_TAG=${OCI_TAG//_/-} # replace underscores with dashes UKI_SHA=$(oras manifest fetch "$OCI_REPO:${OCI_TAG}" | jq -r '.layers[] | select(.mediaType=="application/io.gardenlinux.uki") | .digest') oras blob fetch "$OCI_REPO@$UKI_SHA" -o "$esp_dir/EFI/Linux/${GARDENLINUX_CNAME}.efi" +addon_dir="$esp_dir/loader/addons" + +create_addon_from_stub() { + local name=${1:?usage: make_systemd_cmdline_addon NAME 'CMDLINE'} + local cmdline=${2:?usage: make_systemd_cmdline_addon NAME 'CMDLINE'} + + # Target installation root and the systemd EFI addon template. + local stub="$sysroot/usr/lib/systemd/boot/efi/addonx64.efi.stub" + + local addon cmdline_file + local alignment_hex alignment + local idx section size_hex vma_hex + local size vma end max_end next_vma next_vma_hex + + # Keep writes confined to addon_dir. Permit "foo" or "foo.addon.efi". + [[ $name != */* && $name != .* && -n $name ]] || { + printf 'Invalid addon name: %q\n' "$name" >&2 + return 2 + } + + [[ $name == *.addon.efi ]] || name="${name}.addon.efi" + + [[ -r $stub ]] || { + printf 'Cannot read systemd addon stub: %s\n' "$stub" >&2 + return 1 + } + + mkdir -p -- "$addon_dir" || return 1 + addon="$addon_dir/$name" + + tmpdir="/tmp/$(basename "$0").$RANDOM" + trap 'rm -rf -- "$tmpdir"' RETURN + mkdir -p "$tmpdir" + cmdline_file="$tmpdir/cmdline" + + # systemd-stub expects UTF-8/ASCII kernel parameters as a NUL-terminated + # string in the PE .cmdline section. Do not add a trailing newline. + printf '%s\0' "$cmdline" >"$cmdline_file" || return 1 + + # BusyBox awk-compatible: it only extracts the field; Bash converts hex. + alignment_hex=$( + objdump -p "$stub" | + awk '$1 == "SectionAlignment" { print $2; exit }' + ) + + [[ $alignment_hex =~ ^[0-9A-Fa-f]+$ ]] || { + printf 'Could not read PE SectionAlignment from: %s\n' "$stub" >&2 + return 1 + } + + alignment=$((16#$alignment_hex)) + + (( alignment > 0 )) || { + printf 'Invalid PE SectionAlignment: %s\n' "$alignment_hex" >&2 + return 1 + } + + # Compute: + # + # max_end = max(existing_section_VMA + existing_section_size) + # next_vma = align_up(max_end, SectionAlignment) + # + # This avoids assuming objdump lists sections in VMA order. BusyBox awk + # filters/prints fields only; Bash handles all hexadecimal arithmetic. + max_end=0 + + while read -r idx section size_hex vma_hex; do + [[ $idx =~ ^[0-9]+$ ]] || continue + [[ $size_hex =~ ^[0-9A-Fa-f]+$ ]] || continue + [[ $vma_hex =~ ^[0-9A-Fa-f]+$ ]] || continue + + size=$((16#$size_hex)) + vma=$((16#$vma_hex)) + end=$((vma + size)) + + (( end > max_end )) && max_end=$end + done < <( + objdump -h "$stub" | + awk '$1 ~ /^[0-9]+$/ { print $1, $2, $3, $4 }' + ) + + (( max_end > 0 )) || { + printf 'Could not determine existing PE section layout: %s\n' "$stub" >&2 + return 1 + } + + next_vma=$(( (max_end + alignment - 1) / alignment * alignment )) + printf -v next_vma_hex '0x%x' "$next_vma" + + # Build to a temporary pathname and atomically move it into place. + objcopy \ + --add-section ".cmdline=$cmdline_file" \ + --change-section-vma ".cmdline=$next_vma_hex" \ + --set-section-alignment ".cmdline=$alignment" \ + --set-section-flags ".cmdline=alloc,load,readonly,data,contents" \ + "$stub" "$tmpdir/$name" || return 1 + + mv -f -- "$tmpdir/$name" "$addon" || return 1 + + printf 'Created addon: %s\n' "$addon" + printf ' SectionAlignment: 0x%x\n' "$alignment" + printf ' .cmdline RVA: %s\n' "$next_vma_hex" +} + +# if intel cpu +if grep -q "GenuineIntel" /proc/cpuinfo; then + create_addon_from_stub "disable-intel-idle-states" "intel_idle.max_cstate=0" +fi + if [ "$ENABLE_HUGEPAGE_SETUP" = "true" ]; then - echo "hugepagesz=2MB hugepages=$hugepages" > /tmp/cmdlinef - addon="/sysroot/usr/lib/systemd/boot/efi/addonx64.efi.stub" - offs=$(objdump -h $addon | awk 'NF==7 {size=$3;offset=$4} END {print "16#"size" + 16#"offset}') - if [[ $offs -eq 0 ]]; then - echo "the offset can't be calculated for the stub addon" - exit 1 - fi - align=$(objdump -p $addon | grep Section | awk '{ print "16#"$2}') - offs=$((offs + "$align" - offs % "$align")) - addon_dir="$esp_dir/loader/addons" - mkdir -p "$addon_dir" - objcopy --add-section .cmdline=/tmp/cmdlinef --change-section-vma .cmdline=$(printf 0x%x $offs) $addon "$addon_dir/hugepages.addon.efi" + create_addon_from_stub "hugepages" "hugepagesz=2MB hugepages=$hugepages" fi # debug container