File Format Conversion
This section needs rewriting.
chsr convert converts RootAsRole policy storage between JSON and CBOR.
Supported formats
jsoncbor
Command forms
chsr convert [--from <from_type> <from_file>] <to_type> <to_file>
chsr convert -r [--from <from_type> <from_file>] <to_type> <to_file>
--from: explicitly select source format and source file.-r/--reconfigure: update/etc/security/rootasrole.jsonso storage points to the new file.
Common examples
Convert current policy storage to CBOR and reconfigure runtime:
chsr convert -r cbor /etc/security/rootasrole.bin
Convert back to JSON and reconfigure runtime:
chsr convert -r json /etc/security/rootasrole.json
Explicit source/target conversion:
chsr convert --from json /etc/security/rootasrole.json cbor /etc/security/rootasrole.bin
Operational notes
- Keep target files in protected system paths.
- If policy content changes during migration prep, prefer
chsr editorto catch invalid policies before write. - Validate policy execution after conversion with
dosr -i <command>. - Use version control and backups before large migrations.
For policy field details, see Configuration File Format.