Conversation
aviraxp
reviewed
May 20, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds end-to-end support for module-provided init.rc injection by generating a consolidated modules.rc file in /metadata[/watchdog]/ksu/ from enabled modules and having the kernel’s init.rc read hook append that file at boot.
Changes:
- Userspace: generate and refresh
/metadata[/watchdog]/ksu/modules.rcby concatenating*.rcfrom enabled modules (and a commoninitrc.ddirectory), with refresh triggered on module state changes andpost-fs-data. - CLI: add
ksud initrc refreshto manually regenerate the preinit rc file. - Kernel: extend the init.rc read/stat hook to append
modules.rc(loaded once into a bounded buffer) after the built-inKERNEL_SU_RC.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| userspace/ksud/src/utils.rs | Uninstall cleanup now removes the new preinit rc directories. |
| userspace/ksud/src/module.rs | Implements modules.rc regeneration and hooks it into module install/enable/disable/remove flows. |
| userspace/ksud/src/init_event.rs | Regenerates modules.rc during post-fs-data as a safety net. |
| userspace/ksud/src/defs.rs | Adds constants for preinit directories and rc file naming. |
| userspace/ksud/src/cli.rs | Adds initrc refresh subcommand to regenerate modules.rc. |
| kernel/runtime/ksud_integration.c | Appends module-provided rc content to init.rc via the existing read/stat hook. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+456
to
+463
| let mut out_file = File::create(&out_path)?; | ||
| out_file.write_all(&tmp)?; | ||
| } | ||
|
|
||
| // SELinux label so the kernel's filp_open in init context can read it. | ||
| if let Err(e) = crate::restorecon::lsetfilecon(&out_path, METADATA_FILE_CON) { | ||
| debug!("set context on {} failed: {e}", out_path.display()); | ||
| } |
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.
No description provided.