Skip to content

feat(build): upgrade kernel from 6.12.95 to 6.18.38 - #12

Merged
AprilNEA merged 6 commits into
masterfrom
feat/kernel-6.18
Jul 19, 2026
Merged

feat(build): upgrade kernel from 6.12.95 to 6.18.38#12
AprilNEA merged 6 commits into
masterfrom
feat/kernel-6.18

Conversation

@AprilNEA

Copy link
Copy Markdown
Member

Summary

Moves the default kernel from 6.12.95 to 6.18.38, the current LTS (EOL Dec 2028, same horizon as 6.12) — picking up the btrfs, EROFS, and virtiofs performance work from 6.13–6.18.

Config migration (audited, not guessed)

Both config fragments were resolved through olddefconfig against real 6.12.95 and 6.18.38 sources, and every symbol's disposition was diffed between the two. Excluding noise identical on both versions, exactly two regressions surfaced, both fixed:

  1. Legacy iptables gates. 6.18 moved ip_tables/ip6_tables behind new gate symbols: NETFILTER_XTABLES_LEGACYIP_NF_IPTABLES_LEGACY / IP6_NF_IPTABLES_LEGACY. Without them, every IP_NF_*/IP6_NF_* table silently resolves away — and the guest rootfs ships a static iptables-legacy (xtables-legacy-multi), so dockerd would lose filter/nat entirely. All three gates added to both fragments.
  2. LIBCRC32C was removed upstream in 6.15 (folded into the CRC32 lib); dropped from both fragments.

The post-olddefconfig assertion is now a symbol list including IP_NF_NAT/IP6_NF_NAT, which transitively cover the whole legacy xtables chain — the next silent dependency-gate change fails the build instead of shipping a kernel without iptables.

Code changes

  • arcbox_hvc_blk: dropped BLK_MQ_F_SHOULD_MERGE (removed upstream in 6.13; merging is now unconditional). Sole compile failure on 6.18.
  • vsock rx-budget patch: applies and compiles cleanly on 6.18.38 — virtio_transport_rx_work structure (out: label, virtio_vsock_rx_fill) is unchanged. Comment updated.
  • curl retry for kernel.org downloads (hit a mid-transfer connection reset during verification).

Verification

  • Full arm64 build of 6.18.38 in Docker: passes, produces a valid 18MB ARM64 boot Image (6.12.95 release was 17.7MB, +2%).
  • Patch injection + config assertions all green in the build log.
  • x86_64 is covered by the PR build on native runners.

Follow-ups (pre-existing, out of scope)

  • BRIDGE_VLAN_FILTERING=y has never actually resolved (missing VLAN_8021Q dependency) — on 6.12 too.
  • The rootfs ships ebtables but BRIDGE_NF_EBTABLES was never enabled in the fragments (also needs the legacy gate on 6.18+).

AprilNEA added 3 commits July 18, 2026 15:19
6.18 is the current LTS (EOL Dec 2028, same as 6.12) and carries the
btrfs/EROFS/virtiofs performance work from 6.13-6.18.

Config migration, verified by resolving both fragments through
olddefconfig on real 6.12.95 and 6.18.38 sources and diffing every
symbol's disposition:

- Legacy iptables gates: 6.18 moved ip_tables/ip6_tables behind
  NETFILTER_XTABLES_LEGACY + IP_NF_IPTABLES_LEGACY +
  IP6_NF_IPTABLES_LEGACY. Without them every IP_NF_*/IP6_NF_* table
  silently resolves away and dockerd in the guest (static
  iptables-legacy) loses filter/nat. Added all three gates.
- LIBCRC32C: removed upstream in 6.15 (folded into the CRC32 lib);
  dropped from both fragments.

The post-olddefconfig assertion now checks a symbol list including
IP_NF_NAT/IP6_NF_NAT, which transitively cover the whole legacy
xtables chain, so the next silent dependency-gate change fails the
build instead of shipping a kernel without iptables.

The out-of-tree vsock rx-budget patch applies cleanly on 6.18.38.
cdn.kernel.org intermittently resets connections mid-transfer; a
truncated tarball previously failed the build with a confusing xz
error.
The flag was removed upstream in 6.13; request merging is now
unconditional, so tag_set.flags stays zeroed.
@greptile-apps

greptile-apps Bot commented Jul 18, 2026

Copy link
Copy Markdown

Greptile Summary

This PR upgrades the default ArcBox kernel build to Linux 6.18.38. The main changes are:

  • Workflow, docs, and build script defaults now point at 6.18.38 or 6.18.0 examples.
  • ARM64 and x86_64 config fragments switch to CONFIG_PREEMPT_LAZY.
  • Legacy xtables gate symbols are added so iptables-legacy NAT/filter configs still resolve after olddefconfig.
  • Removed CONFIG_LIBCRC32C from both config fragments.
  • The custom HVC block driver guards BLK_MQ_F_SHOULD_MERGE for older kernel override builds.
  • Kernel downloads now use curl retry flags, and config assertions cover SquashFS, legacy NAT, and supported lazy preemption.

Confidence Score: 5/5

Safe to merge with minimal risk.

The changes are focused on the kernel version bump and compatibility migration. The updated assertions catch the key resolved config symbols after olddefconfig. The prior PREEMPT_LAZY override issue is addressed by checking CONFIG_ARCH_HAS_PREEMPT_LAZY before failing the build.

No files require special attention.

T-Rex T-Rex Logs

What T-Rex did

  • Verified kernel configuration validation shows all required symbols resolve to '=y' in both config fragments and scripts/build-kernel.sh, with KERNEL_VERSION set to 6.18.38.
  • Confirmed the shell syntax check passes for the changed scripts (bash -n) and that both scripts are executable.
  • Ran the build-script smoke test for USE_DOCKER=0 on arm64, confirming the vsock patch application/driver injection succeeded while noting environment blockers (missing flex and aarch64-linux-gnu-gcc, and Docker is unavailable).
  • Reviewed the artifact manifest which lists the captured proof artifacts and their checksums.

View all artifacts

T-Rex Ran code and verified through T-Rex

Important Files Changed

Filename Overview
.github/workflows/build.yml Updates the default workflow kernel version to 6.18.38; no issues found in the changed lines.
CLAUDE.md Updates the documented kernel override example to 6.18.0; no issues found.
README.md Updates the README build example to use a 6.18 kernel override; no issues found.
configs/arcbox-arm64.config Migrates ARM64 config to PREEMPT_LAZY, adds legacy xtables gates, and removes LIBCRC32C; no issues found.
configs/arcbox-x86_64.config Migrates x86_64 config to PREEMPT_LAZY, adds legacy xtables gates, and removes LIBCRC32C; no issues found.
drivers/arcbox_hvc_blk.c Adds a kernel-version guard around the removed blk-mq merge flag to preserve older override support; no issues found.
patches/0001-vsock-rx-budget.sh Updates the vsock RX budget patch applicability comment for 6.18; no issues found.
scripts/build-kernel.sh Bumps the default kernel version, adds resolved-config assertions, preserves older PREEMPT_LAZY override behavior, and retries kernel downloads; no issues found.

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
participant User as Builder/CI
participant Script as scripts/build-kernel.sh
participant Kernel as Linux 6.18.38 source
participant Config as arcbox-<arch>.config
participant Assert as post-olddefconfig checks
participant Output as output/kernel-<arch>

User->>Script: Start build with KERNEL_VERSION default 6.18.38
Script->>Kernel: Download source with curl retries
Script->>Kernel: Inject custom drivers and vsock patch
Script->>Config: Copy arch config fragment
Script->>Kernel: make olddefconfig
Kernel-->>Script: Resolved .config
Script->>Assert: Require SquashFS and legacy NAT symbols
Script->>Assert: Require PREEMPT_LAZY when arch supports it
Assert-->>Script: Build may continue
Script->>Kernel: make Image/bzImage
Kernel-->>Output: Kernel artifact
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
participant User as Builder/CI
participant Script as scripts/build-kernel.sh
participant Kernel as Linux 6.18.38 source
participant Config as arcbox-<arch>.config
participant Assert as post-olddefconfig checks
participant Output as output/kernel-<arch>

User->>Script: Start build with KERNEL_VERSION default 6.18.38
Script->>Kernel: Download source with curl retries
Script->>Kernel: Inject custom drivers and vsock patch
Script->>Config: Copy arch config fragment
Script->>Kernel: make olddefconfig
Kernel-->>Script: Resolved .config
Script->>Assert: Require SquashFS and legacy NAT symbols
Script->>Assert: Require PREEMPT_LAZY when arch supports it
Assert-->>Script: Build may continue
Script->>Kernel: make Image/bzImage
Kernel-->>Output: Kernel artifact
Loading

Reviews (4): Last reviewed commit: "fix(build): assert PREEMPT_LAZY only whe..." | Re-trigger Greptile

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0bf8704cd4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread drivers/arcbox_hvc_blk.c
AprilNEA added 2 commits July 19, 2026 13:28
6.18 unlocks PREEMPT_LAZY on arm64 (arch selects ARCH_HAS_PREEMPT_LAZY);
it keeps throughput close to voluntary while cutting worst-case
scheduling latency for interactive guest work — container exec,
port-forward first byte. This is the headline arm64 win the version bump
exists to reach, so it ships with it rather than as a later release.

Also forward-compatible: 7.0 removes the voluntary model for
lazy-capable arches, so olddefconfig would otherwise silently fall back.
Both fragments now pin PREEMPT_LAZY=y and the post-olddefconfig assertion
gained CONFIG_PREEMPT_LAZY, so a future arch/Kconfig change that drops it
fails the build instead of shipping a NONE-preempt kernel.
The earlier commit removed the flag outright to fix the 6.18 build, but
a KERNEL_VERSION=6.12/6.13 override rebuild of arcbox_hvc_blk still needs
it: pre-6.14 the tag set must opt into blk-mq bio merging, and without it
the driver issues every small bio separately (throughput regression).

The flag is an enum member (not a macro), so an #ifdef guard can never
see it — use a LINUX_VERSION_CODE guard. Removal boundary verified from
source: present in v6.13, gone in v6.14 (the earlier message's '6.13+'
was off by one). On 6.14+ the block is compiled out, so the default
6.18 build is unchanged.
Comment thread scripts/build-kernel.sh Outdated
The unconditional CONFIG_PREEMPT_LAZY assertion broke the documented
KERNEL_VERSION override for older kernels (the symbol needs arch wiring:
x86 6.13+, arm64 6.16+) — the exact bisect workflow the previous commit
version-guarded the driver for. Gate the assertion on the resolved
CONFIG_ARCH_HAS_PREEMPT_LAZY capability bit instead of version
arithmetic, and warn when the preemption choice falls back to its
kconfig default on such builds.
@AprilNEA
AprilNEA merged commit c5540c8 into master Jul 19, 2026
7 checks passed
@linear-code

linear-code Bot commented Jul 19, 2026

Copy link
Copy Markdown

ABX-457

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant