Skip to content

Fix build #49: Replace umount with sys_umount for kernel 4.9 - #27

Merged
Crybyte merged 1 commit into
mainfrom
fix/build-49-umount-sys
Mar 28, 2026
Merged

Fix build #49: Replace umount with sys_umount for kernel 4.9#27
Crybyte merged 1 commit into
mainfrom
fix/build-49-umount-sys

Conversation

@Crybyte

@Crybyte Crybyte commented Mar 28, 2026

Copy link
Copy Markdown
Owner

Automated fix for crDroid++ kernel build failure.

Issue: Build #48 failed with undefined reference to umount in function ksu_umount_mnt at core_hook.c:566

Root Cause: The ksu_umount_mnt function calls umount() which does not exist in kernel 4.9. Previous fix v34 attempted to use ksys_umount but that also is not available.

Fix:

  • Added fix_kernelsu_49_v35.py script that replaces umount() with sys_umount()
  • Added proper includes (linux/syscalls.h) and declarations
  • Updated workflow to run v35 fix AFTER the pre-patched file override to catch any remaining issues

Related: Build #48 failed with linker error

cc: @coderabbitai

Summary by CodeRabbit

  • Bug Fixes
    • Critical fix for kernel 4.9 compatibility with system call handling in kernel builds.

…ility

The kernel 4.9 build was failing with 'undefined reference to umount'.
The v34 fix attempted to use ksys_umount but kernel 4.9 requires sys_umount.

Changes:
- Added fix_kernelsu_49_v35.py to replace umount() with sys_umount()
- Updated workflow to run v35 fix after pre-patched file override
- Added proper includes and declarations for sys_umount

This fix addresses the linker error in ksu_umount_mnt function at core_hook.c:566
@coderabbitai

coderabbitai Bot commented Mar 28, 2026

Copy link
Copy Markdown

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

A new kernel 4.9 compatibility patch (v35) was added to fix umount() function usage in KernelSU's core_hook.c. The changes include a GitHub Actions workflow step that executes a new Python script to replace umount() calls with sys_umount() and inject the necessary syscall declaration.

Changes

Cohort / File(s) Summary
Workflow Enhancement
.github/workflows/crdroid-plus-kernel-build.yml
Added "CRITICAL FIX v35" step to execute kernel 4.9 compatibility patch script after v34 pre-patched core_hook.c override, before verification of line 591.
Kernel 4.9 Compatibility Script
build-scripts/fix_kernelsu_49_v35.py
New Python script that locates core_hook.c, replaces kernel-4.9-incompatible umount() calls with sys_umount(), and injects #include <linux/syscalls.h> with an asmlinkage long sys_umount() declaration when needed.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 Hops through kernel land with glee,
Fixing umount for 4.9's spree,
sys_umount now shall reign supreme,
Declarations flowing like a dream! 🌙✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and specifically describes the main change: replacing umount with sys_umount for kernel 4.9 compatibility, which is the core purpose of this PR.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/build-49-umount-sys

Comment @coderabbitai help to get the list of available commands and usage tips.

@Crybyte
Crybyte merged commit 64e96b3 into main Mar 28, 2026
1 check was pending
Crybyte added a commit that referenced this pull request Mar 30, 2026
#2)

Build #26 failed with 'flags' undeclared in try_umount function.

The v11 fix had issues with function boundary detection. v12 uses a

simplified perl approach with -0777 slurp mode to completely replace

the try_umount function without complex brace counting.

Changes:

- Added fix-kernelsu-49-v12.sh with simplified perl-based replacement

- Updated workflow to check for v12 first

- More aggressive removal of flags references

This ensures kernel 4.9 compatibility with KernelSU-Next v1.0.7.

Co-authored-by: Oracle Public Cloud User <opc@auranode.subnet09041427.vcn09041427.oraclevcn.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