Repository navigation
ci: build the hi3536dv100 kernel modules against the board's kernel - #267
Conversation
PR Summary by QodoBuild and verify hi3536dv100 kernel modules in CI
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
Code Review by Qodo
1.
|
Two Qodo findings on #267: - make ran through tee without pipefail, so a failed build that never printed "undefined!" passed the step; - the OSAL check compared only the count, so swapping one export for another still passed. Set pipefail, and diff open_osal.ko's export names against .github/expected/hi3536dv100-osal-exports.txt, which is the SDK's prebuilt hi_osal.ko list. Locally, a renamed export and a make that fails both now fail their step.
firmware's hisilicon-opensdk does not build hi3536dv100 yet, so the usual br-hisilicon-opensdk step cannot cover it. A kmod_only matrix entry builds firmware's kernel with br-linux, then builds kernel/ against it with CHIPARCH=hi3536dv100. modpost only warns about an import that nothing exports when it builds external modules, and make still exits 0, so the step fails on "undefined!" itself. The verify step checks that all six open_*.ko exist and carry the board kernel's vermagic. It also checks that open_osal still exports the 213 symbols the SDK's hi_osal.ko does: nothing in this tree imports them, and a dropped one would only show up when a prebuilt MPP module failed to load on a camera.
Two Qodo findings on #267: - make ran through tee without pipefail, so a failed build that never printed "undefined!" passed the step; - the OSAL check compared only the count, so swapping one export for another still passed. Set pipefail, and diff open_osal.ko's export names against .github/expected/hi3536dv100-osal-exports.txt, which is the SDK's prebuilt hi_osal.ko list. Locally, a renamed export and a make that fails both now fail their step.
…ll 27 modules The first run on #267 failed after the kernel had built: the step looked for the cross compiler in output/host/bin. Firmware builds with per-package directories, and output/host/ is only assembled at the end of a full build, so after br-linux alone the toolchain is in output/per-package/linux/host/bin. The local check had run against a tree that had finished a full build, which is why it passed. With #268 in, the verify step lists all 27 modules: the six built from source, and the 21 closed MPP modules relinked from the SDK's .ko files. Checked in a layout with only per-package/ and build/, as CI has after br-linux: both steps pass, with 27 modules found.
7531b6a to
87d5634
Compare
The second run on #267 built all 27 modules and found them all, then failed the export check on order alone. The expected list was sorted in en_US.UTF-8, while the runner sorts in C.UTF-8, and the two place '_' differently. Sort both sides with LC_ALL=C. The step now passes under either locale locally.
Two Qodo findings on #267: - make ran through tee without pipefail, so a failed build that never printed "undefined!" passed the step; - the OSAL check compared only the count, so swapping one export for another still passed. Set pipefail, and diff open_osal.ko's export names against .github/expected/hi3536dv100-osal-exports.txt, which is the SDK's prebuilt hi_osal.ko list. Locally, a renamed export and a make that fails both now fail their step.
…ll 27 modules The first run on #267 failed after the kernel had built: the step looked for the cross compiler in output/host/bin. Firmware builds with per-package directories, and output/host/ is only assembled at the end of a full build, so after br-linux alone the toolchain is in output/per-package/linux/host/bin. The local check had run against a tree that had finished a full build, which is why it passed. With #268 in, the verify step lists all 27 modules: the six built from source, and the 21 closed MPP modules relinked from the SDK's .ko files. Checked in a layout with only per-package/ and build/, as CI has after br-linux: both steps pass, with 27 modules found.
Problem
#266 added hi3536dv100, but CI doesn't build it. Every matrix entry goes through firmware's
hisilicon-opensdk(br-hisilicon-opensdk), and that package doesn't know the family yet. So nothing would catch a broken kbuild line, a mirror file that stops compiling, or an OSAL export lost to an edit.Change
kmod_only: truematrix entry forhi3536dv100/hi3536dv100_lite. The opensdk step skipskmod_onlyentries.make BOARD=hi3536dv100_lite br-linuxin firmware, thenmake -C <linux> M=$GITHUB_WORKSPACE/kernel CHIPARCH=hi3536dv100with Buildroot's cross compiler.undefined!, because for external modules modpost only warns and make still exits 0.open_*.koexist: the six built from source (osal, sys_config, wdt, hi_ir, hi_cipher, tlv_320aic31) and the 21 closed MPP modules relinked by hi3536dv100: build the closed MPP modules from the SDK's .ko files #268.open_osal.koexports the same 213 names as the SDK's prebuilthi_osal.ko, checked against.github/expected/hi3536dv100-osal-exports.txt. Nothing in this tree imports them; the prebuilt MPP modules in firmware do, so a dropped export would otherwise only surface when one fails to load on a camera.No existing entry changes behaviour.
Testing
Ran both new steps'
run:blocks as written, extracted from the YAML, against a localhi3536dv100_litefirmware build. Onlybr-linuxwas stubbed, because the kernel was already built:Negative check: I added a call to a symbol nothing exports to a copy of
hiir.c. make exited 0, and modpost printedWARNING: "openipc_ci_no_such_symbol" [.../open_hi_ir.ko] undefined!, which the new step turns into a failure.Update
output/host/bin. Firmware uses per-package directories, andoutput/host/is assembled only at the end of a full build, so afterbr-linuxalone the toolchain is inoutput/per-package/linux/host/bin.per-package/andbuild/: both steps pass, with 27 modules found.pipefail, and the export check by name.