Skip to content

fix(runtime): select the top-level kernel during filesystem sync - #18

Open
Hanabi9248 wants to merge 1 commit into
IvorySQL:mainfrom
Hanabi9248:codex/sync-root-kernel
Open

Hanabi9248 wants to merge 1 commit into
IvorySQL:mainfrom
Hanabi9248:codex/sync-root-kernel

Conversation

@Hanabi9248

Copy link
Copy Markdown

With the documented menuconfig workflow, enabling Buildroot 2022.08's BR2_LINUX_KERNEL_INSTALL_TARGET installs the kernel at /boot/bzImage. This project's post-image step also places it at /bzImage. The current global grep matches both filesystem records, producing a newline in the replacement and an unterminated sed command. The default configuration leaves this option disabled.

Select the top-level bzImage record with jq, using the same query already present in packages/runtime/update-img.sh. The normal filename and copy behavior stay the same. #17's missing-source protection is independent and should be retained; #15 changes the build/cache workflow rather than this selection.

The regression runs the complete sync script and the unchanged copy-to-sha256.py/fs2json.py generators. It creates genuine generated metadata with the root kernel and an optional /boot copy, then checks the full HTML replacement, copied files and an outside canary from both the runtime directory and an unrelated working directory. Payloads model the generated layout and are not bootable kernels.

Main validation: Windows Python 3.14 with existing Git Bash utilities and the real jq CLI, under one CPU / 768 MiB / 16 processes. Baseline: two installed-kernel cases fail in sed; both default-layout controls pass. Candidate: all four pass. Black/isort and Ruff pass; the test keeps explicit subprocess pipes with a narrow UP022 annotation. Formatting did not require repeating accepted product tests.

The test requires Python 3.9+ and explicit existing tool/private-work paths: WASM_SOURCE_ROOT, WASM_BASH, WASM_UTILITY_BIN, WASM_JQ, WASM_WORK_ROOT; run python tests/test_sync_kernel_selection.py -v. The work root must be an owned, non-root temporary directory. The test verifies its cleanup boundary before removing fixtures.

No full Buildroot/Docker/kernel build, Linux run, browser/v86 boot, hosted CI or combined state with unmerged #17 was run.

Use the existing jq query to exclude a Buildroot-installed /boot/bzImage
from the runtime boot-image replacement. Cover real generated metadata
with both kernel layouts and two working directories.

Signed-off-by: Hanabi <317387557+Hanabi9248@users.noreply.github.com>
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