-
Notifications
You must be signed in to change notification settings - Fork 1
AMS Module Development
Matthew DaLuz edited this page Apr 19, 2026
·
3 revisions
This page describes the module format currently accepted by ModuleManager.
Required contents:
module-info.json
overlay/
Optional contents:
overlay/system/
overlay/vendor/
overlay/product/
install.sh
post-fs-data.sh
service.sh
overlay/ must exist even if only one target subtree is populated.
The installer accepts either:
- a flat archive root where
module-info.jsonis at archive root - one nested top-level folder that contains the real module root
Anything more complex is not auto-detected.
Recognized fields:
-
namerequired versionauthordescription-
mountboolean, defaulttrue -
post_fs_databoolean, defaultfalse -
serviceboolean, defaultfalse -
install-shboolean, defaultfalse
Notes:
- booleans can be JSON booleans or
"true"/"false"strings -
nullis accepted and behaves like an unset/default value for recognized fields - numbers, arrays, and objects are not accepted by the lightweight parser
Allowed characters:
a-zA-Z0-9._-
If name is missing or contains unsupported characters, install fails.
module-info.json:
{
"name": "example-fonts",
"version": "1.0.0",
"author": "you",
"description": "Example AMS module",
"mount": true,
"post_fs_data": false,
"service": false,
"install-sh": false
}Directory tree:
example-fonts/
module-info.json
overlay/
system/
fonts/
MyFont.ttf
From inside the module root:
zip -r ../example-fonts.zip .Install:
apm module-install /path/to/example-fonts.zipOther lifecycle commands:
apm module-list
apm module-disable example-fonts
apm module-enable example-fonts
apm module-remove example-fontsImportant current behavior:
- install writes
state.jsonwithenabled=true - overlays are rebuilt as part of install
- successful install runs declared
post-fs-data.shandservice.shhooks immediately after the overlay rebuild - enabling a disabled module also rebuilds overlays and runs declared hooks
- only runs when
install-sh: true - must exist when enabled
- runs during install
- failure aborts install and triggers rollback
- runs synchronously when
post_fs_data: true - runs after overlays are rebuilt during install, enable, and daemon startup
- runs in the background when
service: true - starts after
post-fs-data.shduring install, enable, and daemon startup
All scripts run through /system/bin/sh.
Script output is appended to:
/data/ams/logs/<module>.log
AMS writes state.json in the module root with:
enabledinstalled_atupdated_atlast_error
It also creates:
workdir/system/workdir/vendor/workdir/product/
- keep overlays additive and easy to reason about
- test each target subtree independently
- match the target filesystem shape at the top level; the bind backend expects top-level overlay entries to correspond to existing target files or directories
- prefer placing new files under existing directories instead of trying to create brand-new top-level target entries
- if using
install-sh, make it idempotent and fail loudly - check
/data/ams/logs/<module>.logafter install or enable - if boot-time partitions were not ready when you enabled a module,
amsdmay need a reboot or partition-monitor retry window before the overlay fully appears