Conversation
db4fcca to
30df6ed
Compare
Kernel module development previously required a bare Linux machine or manual VM setup. This adds self-contained devtools/ directory that boots a minimal QEMU guest with the project tree shared via 9p virtfs, so modules built on the host are instantly visible inside the guest. Skip kbleds in QEMU tests (no virtual console in headless VM) kbleds accesses vc_cons[fg_console].d->port.tty to blink keyboard LEDs. In QEMU -nographic mode there is no virtual console, so this dereferences NULL and triggers a kernel oops. The module works on bare-metal CI runners (which have a virtual console), so it must not be added to .ci/non-working. Add devtools/non-working as a QEMU-specific exclusion list. The guest-test.sh script now checks both .ci/non-working and devtools/non-working before loading each module. check.sh validates entries in both lists.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Kernel module development previously required a bare Linux machine or manual VM setup. This adds self-contained devtools/ directory that boots a minimal QEMU guest with the project tree shared via 9p virtfs, so modules built on the host are instantly visible inside the guest.
Summary by cubic
Adds a self-contained
devtools/to boot a minimal QEMU guest with the repo shared via 9p for fast, isolated module testing. Also adds prebuilts and CI hooks to cut setup time, fixes out-of-tree symbol resolution, and skipskbledsin QEMU to avoid a kernel oops.New Features
devtools/setup.shbuilds kernel (6.12.6) + static BusyBox, creates initramfs; auto-downloads matching prebuilt kernel-build from GitHub Releases; copiesvmlinux.symverstoModule.symversfor out-of-tree builds.devtools/boot.shlaunches QEMU with--gdb,--test, extra args; shares the repo at/mnt/lkmpg/(test cmd is base64-encoded to avoid cmdline splitting).devtools/guest-test.shruns insmod/rmmod in-guest.devtools/build-modules.shcompilesexamples/against the dev kernel.devtools/test-modules.shruns non-interactive tests with--no-buildand--timeout; respects.ci/non-workinganddevtools/non-working(QEMU-only);kbledsis excluded in QEMU.devtools/check.shadds fast offline validation (shell syntax, shellcheck, config/interface checks, non-working list consistency); fixes word-splitting in list iteration.devtools/pack-prebuilt.shproduces minimal tarballs (kbuild headers/scripts/tools,bzImage, initramfs; novmlinux).devtools-releasebuilds/publishes prebuilts;status-checkaddsdevtools-check(offline) anddevtools-qemu(kernel+QEMU tests), required whendevtools/**,examples/**, or.ci/non-workingchange..gitignoreexcludesdevtools/.cache/anddevtools/config.local.Migration
devtools/setup.sh→devtools/build-modules.sh→devtools/boot.sh(interactive) ordevtools/test-modules.sh(CI-style).Written for commit 7f03cd3. Summary will update on new commits.