Fix build #54: FINAL umount -> sys_umount fix for kernel 4.9 - #32
Conversation
The pre-patched core_hook.c.patched file contains umount() calls that don't exist in kernel 4.9. This fix adds a v39 script that runs AFTER the pre-patched file is applied to ensure ALL umount() calls are replaced with sys_umount(). Issue: Build #53 failed with undefined reference to 'umount' at line 566 Root Cause: Pre-patched file overwrites v38 fixes Solution: Run v39 fix after pre-patched file application Changes: - Added fix_kernelsu_49_v39.py with aggressive umount() replacement - Updated workflow to run v39 after pre-patched file application - Ensures sys_umount declaration is added for kernel 4.9
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughAdds a CI workflow step and a new Python fixer that scans kernel source for Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/crdroid-plus-kernel-build.yml:
- Around line 447-450: The fallback invocation passes the wrong path string
(uses ~/kernel_build with an underscore) which will fail to locate the kernel
tree; update the command that runs fix_kernelsu_49_v39.py so the directory
argument and KERNEL_DIR environment value use the correct hyphenated path
(~/kernel-build/android_kernel_oneplus_sdm845) to match the rest of the workflow
and ensure core_hook.c files are found.
In `@build-scripts/fix_kernelsu_49_v39.py`:
- Around line 89-119: The function process_core_hook_files currently iterates
possible_paths and may process the same real file multiple times; change it to
deduplicate by tracking resolved real paths (e.g., a seen set) before processing
each entry: after computing real_path, skip the iteration if real_path is
already in seen, otherwise add real_path to seen and proceed with
aggressive_umount_fix and ensure_sys_umount_declaration, ensuring results only
contain one tuple per real_path; reference process_core_hook_files,
possible_paths, real_path, results, aggressive_umount_fix and
ensure_sys_umount_declaration when making the change.
- Around line 147-151: The loop unpacks (path, fixed, declared) from results but
never uses declared; update the summary inside the for loop (the for path,
fixed, declared in results block) to include declaration info — e.g. compute
status = "FIXED" if fixed else "OK" and append ", DECLARED" when declared is
truthy (or similar like status += " (declared)" ), then print f" [{status}]
{path}"; alternatively if you intentionally discard declared, rename the third
unpack to _declared to signal it's unused (change for path, fixed, declared in
results to for path, fixed, _declared in results).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: def65740-7967-46cb-81ec-f861a5781b42
📒 Files selected for processing (2)
.github/workflows/crdroid-plus-kernel-build.ymlbuild-scripts/fix_kernelsu_49_v39.py
📜 Review details
🧰 Additional context used
🪛 Ruff (0.15.7)
build-scripts/fix_kernelsu_49_v39.py
[warning] 23-23: Unnecessary mode argument
Remove mode argument
(UP015)
[warning] 54-54: Unnecessary else after return statement
Remove unnecessary else
(RET505)
[warning] 61-61: Unnecessary mode argument
Remove mode argument
(UP015)
[warning] 148-148: Loop control variable declared not used within loop body
Rename unused declared to _declared
(B007)
[warning] 153-153: Unnecessary else after return statement
Remove unnecessary else
(RET505)
🔇 Additional comments (2)
build-scripts/fix_kernelsu_49_v39.py (2)
17-55: LGTM! The regex pattern correctly fixes the lookbehind issue from v38.The pattern
(?<!sys_)(?<!try_)\bumountproperly excludes already-prefixed calls, unlike v38's malformed(?<!)try_). The capture group and replacement logic are correct.Minor style notes from static analysis (optional to address):
- Line 23:
open(file_path, 'r')→open(file_path)(mode 'r' is default)- Line 54:
elseafterreturnis unnecessary
58-86: LGTM! Declaration insertion logic is sound for kernel source files.The check for existing declarations and insertion after the last
#includeis appropriate. Minor note: if no#includelines exist,insert_idxwould be 0 (inserting at file start), but this is an unlikely edge case for kernel C files.
- Fixed path typo: kernel_build -> kernel-build (underscore to hyphen) - Added deduplication for core_hook.c file processing (seen_paths set) - Renamed unused 'declared' variable to '_declared' to signal intentional discard
Automated fix for crDroid++ kernel build failure.
Issue: Build #53 failed with undefined reference to 'umount' at line 566
Root Cause:
Fix:
Changes:
Related: Build #54 (attempt #54 overall, #53 failed with umount error)
cc: @coderabbitai
Summary by CodeRabbit