You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rust code changes:
- add Rhai scripting as a feature (--features=rhaiscript)
- add ArchiveInspector for access to RawHubrisArchive
- add "system(argv) -> #{exit_code, stdout, stderr}" from std::process::Command
- export faux-mgs paramsters to Rhai main.
- run any faux-mgs command with "let result = faux_mgs(["arg0", .. "argN"]);
- faux-mgs results are passed back to the script as a map even if they are simpler JSON.
- ChronoPackage for time handling.
- FilesystemPackage for file access.
- EnvironmentPackage for env var access.
- export "scriptdir" so that script can get other files relative to itself.
- "verify_rot_image()" to verify a RoT image vs CFPA, CMPA.
- vars available to main():
- "argv" - script main's scope passing all remaining CLI args.
- "rbi_default" - expose faux-mgs default "rot_boot_info" version
- "interface" - pass the "--interface INTERFACE" value.
- "reset_watchdog_timeout_ms" - pass that value to the script.
- Route Rhai's debug function to the faux-mgs log.
- The `debug("message")` function is routed to the faux-mgs slog logging.
Prefixing a message with "crit|", "trace|", "error|", "warn|", "error|", or "debug|"
will log at that corresponding level. Leaving off the prefix or using some other
prefix will log at the debug level.
- Rhai's `print()` still goes to stdout.
Rhai scripts:
scripts/util.rhai contains common script and faux-mgs support.
- getops()
- to_hexstring()
- cstring_to_string(a)
- array_to_mac(a)
- ab_to_01(v)
- env_expand(s, override)
- rot_boot_info()
- state()
- caboose_value(component, slot, key)
- get_device_cabooses()
- rkth_to_key_name(rkth)
- array_to_blob(a)
- get_cmpa()
- get_cfpa()
- get_rot_keyset()
scripts/update-rollback.rhai
- Only use MGS messages for testing, no humility or other APIs
- perform happy path update and rollback from baseline to under-test images.
scripts/targets.json
- an example configuration script for scripts/update-rollback.rhai
0 commit comments