Where the AMX data model lives: memory, ODL and UCI boundaries
Grow through practice
No need to finish reading — test nowShort answer: the AMX data model lives in memory by default, not in a database.
amxrtsaves only objects/parameters marked%persistentas an ODL file; UCI is a separate persistence layer.
Four layers, not one
| Thing | Location / form | Survives process exit? |
|---|---|---|
| ODL schema / defaults | /etc/amx/<name>/*.odl | Yes |
Runtime object tree amxd_dm | amxrt process memory | No |
%persistent values | ${name}.odl under odl.directory | Yes, if saving is enabled |
| UCI configuration | /etc/config/* | Yes, after uci commit |
Who saves
Not ubus and not ODL itself, but the data model provider/runtime:
amxrtautomatically saves%persistentdata;- a module can call libamxo
amxo_parser_save/amxo_parser_save_objectexplicitly; - writing UCI goes through a UCI backend module using libuci, covered in the next articles.
Typical amxrt configuration:
%config {
odl = {
dm-save = true,
dm-save-on-changed = true,
dm-save-delay = 1000,
directory = "${storage-path}/odl"
};
}
dm-save: save on exit;dm-save-on-changed: save after changes settle;directory: where save files go;- the file is usually
${name}.odl, containing%populate { ... }.
Three %persistent boundaries
- No attribute, no save.
Counters, temporary state and ordinary parameters are lost on exit.
- A non-persistent parent blocks the subtree.
Saving starts at the root; children are not saved if a parent is not persistent.
- Values are saved, not events or transaction history.
dm:object-changed is a runtime notification, not an ODL record.
Where UCI fits
UCI remains /etc/config/<package>:
uci set network.lan.ipaddr='192.168.1.1'
uci commit network
set writes a delta under /tmp/.uci; commit persists it. AMX never automatically turns its object tree into UCI; a backend module must translate.
Which one?
- AMX/TR-181 management-plane persistence:
%persistent+ ODL save. - Native OpenWrt network/services: UCI.
- Both: a backend module maps the model to UCI; do not run shell commands from ODL.
Series: Inside prplOS: AMX Runtime (Guide) Related: From UCI to a data model · How AMX calls UCI · UCI backend example Sources: libamxo ODL save docs, amxrt persistent storage README
Comments 0
No comments yet — be the first!