tree: c2ee6c778a19eb1ad9b80f34287b372d3b5565a4 [search]
  1. android_usb/
  2. ashmem/
  3. battery_manager/
  4. binderfs/
  5. boot/
  6. cgroupfs/
  7. consent_sync/
  8. debugfs/
  9. device_mapper/
  10. devpts/
  11. erofs/
  12. ext4/
  13. fastrpc/
  14. framebuffer/
  15. functionfs/
  16. fuse/
  17. goog_chip_info/
  18. gpu/
  19. gralloc/
  20. hvdcp_opti/
  21. inotify/
  22. input/
  23. iouring/
  24. kgsl/
  25. layeredfs/
  26. loop/
  27. magma/
  28. mmcblk_stub/
  29. nanohub/
  30. nmfs/
  31. odpm/
  32. overlayfs/
  33. perfetto_consumer/
  34. power_residency/
  35. procfs/
  36. pstore/
  37. rtc/
  38. selinuxfs/
  39. serial/
  40. syscalls/
  41. thermal/
  42. touch_power_policy/
  43. tracefs/
  44. tun/
  45. usbfs/
  46. userfaultfd/
  47. wakeup_test/
  48. zram/
  49. BUILD.gn
  50. lib.rs
  51. README.md
  52. TESTING.json5
src/starnix/modules/README.md

Starnix Modules

Starnix modules are crates that are statically linked into the Starnix kernel and provide self-contained functionality.

Dependencies

Starnix modules can depend on starnix_core but starnix_core cannot depend on any modules. A Starnix module cannot depend on another Starnix module. If you need to share code between two modules, please either put that code in //src/starnix/lib, if the code does not need to depend on starnix_core, or in //src/starnix/kernel, if the code does need to depend on starnix_core.

Use cases

Two common use cases for Starnix modules are device drivers and file systems.

Container configuration

Containers configure which modules to initialize via program.modules in their component manifest (.cml):

  • "<module> [key=value...]" enables <module> with optional modprobe-style key=value options (e.g. "boot_notifier cpu_boost_secs=45", "framebuffer aspect_ratio=1:1").
  • Standard Linux kernel modules listed in DEFAULT_MODULES (in //src/starnix/modules/lib.rs) are enabled by default for all containers.
  • "-<module>" explicitly disables a module that would otherwise be enabled by default or by an included manifest shard.

Build configuration

To ensure code quality and consistency across all Starnix modules, each module's BUILD.gn file must include the common clippy lint configuration and other compiler flags.

This is done by adding the following to the configs list of your rustc_library target:

  configs += [ "//src/starnix/build:kernel_library_config" ]

This configuration enforces a standard set of lints and aligns other flags with the library's use in the Starnix kernel binary.