[Deepin-Kernel-SIG] [linux 6.18.y] ci: Add workflow to build loonggpu DKMS module against the kernel - #2076
Conversation
Build the loonggpu DKMS package on every push and pull request so that DRM/KAPI changes breaking the out-of-tree module build (e.g. the drm_buddy_* and drm_fb_helper_*_fbi renames) are caught early. The DKMS source is taken from the deepin package pool: the workflow fetches the directory index of the loonggpu-kernel-dkms pool, picks the newest loong64 deb and unpacks it, so DKMS package updates require no changes to this file. The kernel is cross-compiled the same way as in build-kernel-loong64.yml to provide headers and Module.symvers, then the DKMS module is built through its own Makefile entry point (with its conftest-based API detection), which is equivalent to the compile step of a dkms build. Assisted-by: kimi:Kimi-K3 Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
Reviewer's GuideAdds a GitHub Actions workflow that cross-compiles the loongarch kernel and then builds the out-of-tree loonggpu DKMS module on every push, PR, and manual dispatch to detect DRM/KAPI incompatibilities early. Sequence diagram for the build-dkms-loonggpu CI workflowsequenceDiagram
actor Developer
participant GitHub
participant Runner
participant DeepinRepo
participant KernelTree
participant DKMS_Source
Developer->>GitHub: push / pull_request / workflow_dispatch
GitHub->>Runner: start build-dkms-loonggpu job
Runner->>GitHub: actions_checkout@v6 (path kernel)
GitHub-->>Runner: kernel source
Runner->>DeepinRepo: curl LOONGGPU_DKMS_POOL index
DeepinRepo-->>Runner: deb listing
Runner->>DeepinRepo: curl loonggpu-kernel-dkms_<version>_loong64.deb
DeepinRepo-->>Runner: DKMS deb
Runner->>DKMS_Source: dpkg-deb -x loonggpu-dkms.deb
Runner->>DKMS_Source: locate Makefile in usr/src/loonggpu-*
Runner->>KernelTree: make deepin_loongarch_desktop_defconfig
Runner->>KernelTree: make ARCH=loongarch CROSS_COMPILE=loongarch64-linux-gnu-
Runner->>DKMS_Source: make modules SYSSRC=kernel ARCH=loongarch CROSS_COMPILE=loongarch64-linux-gnu-
Runner->>Runner: rm -rf dkms_workdir
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The logic that fetches and selects the newest loonggpu-kernel-dkms deb from the package pool should defensively filter by architecture and expected filename pattern to avoid accidentally picking an unintended artifact if the index format changes.
- Consider factoring out the cross-compilation steps shared with build-kernel-loong64.yml into a reusable composite action or a shared job template to reduce duplication and keep kernel build configuration consistent across workflows.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The logic that fetches and selects the newest loonggpu-kernel-dkms deb from the package pool should defensively filter by architecture and expected filename pattern to avoid accidentally picking an unintended artifact if the index format changes.
- Consider factoring out the cross-compilation steps shared with build-kernel-loong64.yml into a reusable composite action or a shared job template to reduce duplication and keep kernel build configuration consistent across workflows.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
There was a problem hiding this comment.
Pull request overview
Adds CI validation for loonggpu DKMS compatibility with the LoongArch kernel.
Changes:
- Downloads and extracts the latest loonggpu DKMS package.
- Cross-compiles the kernel and builds the external module.
- Cleans temporary build files.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
|
||
| on: | ||
| push: | ||
| pull_request: |
| deb=$(curl -fsSL "$LOONGGPU_DKMS_POOL/" \ | ||
| | grep -oE 'loonggpu-kernel-dkms_[^"]*_loong64\.deb' \ | ||
| | sort -uV | tail -1) | ||
| [ -n "$deb" ] || { echo "no loonggpu-kernel-dkms deb found in $LOONGGPU_DKMS_POOL"; exit 1; } |
Build the loonggpu DKMS package on every push and pull request so that DRM/KAPI changes breaking the out-of-tree module build (e.g. the drm_buddy_* and drm_fb_helper_*_fbi renames) are caught early.
The DKMS source is taken from the deepin package pool: the workflow fetches the directory index of the loonggpu-kernel-dkms pool, picks the newest loong64 deb and unpacks it, so DKMS package updates require no changes to this file. The kernel is cross-compiled the same way as in build-kernel-loong64.yml to provide headers and Module.symvers, then the DKMS module is built through its own Makefile entry point (with its conftest-based API detection), which is equivalent to the compile step of a dkms build.
Assisted-by: kimi:Kimi-K3
Summary by Sourcery
CI: