Norman Feske 2c8beb462f file-system session: root dir via session label
This patch changes the way of how the client-selected sub directory is
communicated to the server. The former opaque session argument is now
passed as last label element, which allows for the flexible tweaking
of this argument by init's session-routing and label-rewriting
mechansims. In particular, it alleviates the need for creating chroot
component instances.

This change requires the following four adaptations at the
configuration level:

- Each file-system session request must now carry a path starting
  with / as last session arguments. Hence, <vfs> <fs> nodes that
  feature a 'label' attributes must extend the attribute value
  with " -> /". For <fs> nodes with no label attribute, "/" is
  used as last label argument by default.

- For matching session-routing rules at init's configuration,
  the matching of full labels should be replaced by 'label_prefix'
  matches, excluding the last (path) argument.

- Wherever a label of a file-system session is rewritten by using
  init's 'label' attribute of a <parent> or <child> target node,
  the new attribute 'identity' should be used instead. This replaces
  the identity part of the label while preserving the client's
  directory argument.

- Analogously to the matching of session-routing rules, server-side
  policy-selection rules that formerly matched a concrete 'label'
  must be changed to match a 'label_prefix' instead.

As a good practice, 'label_prefix' values should end with " ->" if
possible, which clearly delimits the identity part of the label
used by the matching.

Issue #5445
2025-02-24 16:39:20 +01:00

148 lines
4.8 KiB
Plaintext

<runtime ram="250M" caps="3000" binary="init">
<requires>
<timer/>
</requires>
<fail after_seconds="70"/>
<succeed>
&lt;ui_report state="uninitialized"*
&lt;ui_report state="initializing"*
&lt;ui_report state="unlocked"*
&lt;ui_report state="locked"*
&lt;ui_report state="unlocked"*
</succeed>
<content>
<rom label="ld.lib.so"/>
<rom label="report_rom"/>
<rom label="dynamic_rom"/>
<rom label="file_vault"/>
<rom label="vfs"/>
</content>
<config>
<parent-provides>
<service name="ROM"/>
<service name="LOG"/>
<service name="RM"/>
<service name="CPU"/>
<service name="PD"/>
<service name="IRQ"/>
<service name="IO_MEM"/>
<service name="IO_PORT"/>
<service name="Timer"/>
</parent-provides>
<start name="dynamic_rom" caps="100" ram="4M">
<provides><service name="ROM"/> </provides>
<config verbose="no">
<rom name="file_vault_ui_config">
<inline> <ui_config/> </inline>
<sleep milliseconds="6000"/>
<inline> <ui_config passphrase="abcdefgh" client_fs_size="1M" journaling_buf_size="1M"/> </inline>
<sleep milliseconds="10000"/>
<inline> <ui_config/> </inline>
<sleep milliseconds="6000"/>
<inline> <ui_config passphrase="00000001"/> </inline>
<sleep milliseconds="6000"/>
<inline> <ui_config/> </inline>
<sleep milliseconds="6000"/>
<inline> <ui_config passphrase="abcdefgh"/> </inline>
<sleep milliseconds="600000"/>
</rom>
</config>
<route>
<service name="Timer"> <parent/> </service>
<service name="PD"> <parent/> </service>
<service name="ROM"> <parent/> </service>
<service name="LOG"> <parent/> </service>
<service name="CPU"> <parent/> </service>
</route>
</start>
<start name="report_rom" caps="70" ram="1M">
<provides>
<service name="ROM"/>
<service name="Report"/>
</provides>
<config verbose="yes"/>
<route>
<service name="LOG"> <parent/> </service>
<service name="PD"> <parent/> </service>
<service name="CPU"> <parent/> </service>
<service name="ROM"> <parent/> </service>
</route>
</start>
<start name="data_fs" caps="500" ram="50M">
<binary name="vfs"/>
<provides><service name="File_system"/></provides>
<config>
<vfs>
<dir name="data">
<ram/>
</dir>
</vfs>
<policy label_prefix="file_vault -> data" root="/data" writeable="yes"/>
</config>
<route>
<service name="PD"> <parent/> </service>
<service name="ROM"> <parent/> </service>
<service name="LOG"> <parent/> </service>
<service name="CPU"> <parent/> </service>
</route>
</start>
<start name="trust_anchor_fs" caps="100" ram="5M">
<binary name="vfs"/>
<provides><service name="File_system"/></provides>
<config>
<vfs>
<dir name="trust_anchor">
<ram/>
</dir>
</vfs>
<policy label_prefix="file_vault -> trust_anchor" root="/trust_anchor" writeable="yes"/>
</config>
<route>
<service name="PD"> <parent/> </service>
<service name="ROM"> <parent/> </service>
<service name="LOG"> <parent/> </service>
<service name="CPU"> <parent/> </service>
</route>
</start>
<start name="file_vault" caps="1500" ram="180M">
<config>
<vfs>
<dir name="tresor">
<fs label="tresor -> /"/>
</dir>
</vfs>
</config>
<route>
<service name="ROM" label="ui_config"> <child name="dynamic_rom" label="file_vault_ui_config"/> </service>
<service name="Report"> <child name="report_rom"/> </service>
<service name="File_system" label_prefix="tresor_trust_anchor_vfs -> storage_dir">
<child name="trust_anchor_fs" identity="file_vault -> trust_anchor"/> </service>
<service name="File_system" label_prefix="tresor_init ->"> <child name="data_fs" identity="file_vault -> data"/> </service>
<service name="File_system" label_prefix="tresor ->"> <child name="data_fs" identity="file_vault -> data"/> </service>
<service name="File_system" label_prefix="fs_query ->"> <child name="data_fs" identity="file_vault -> data"/> </service>
<service name="File_system" label_prefix="image_fs_query ->"> <child name="data_fs" identity="file_vault -> data"/> </service>
<service name="File_system" label_prefix="tresor_vfs -> tresor_fs"> <child name="data_fs" identity="file_vault -> data"/> </service>
<service name="File_system" label_prefix="truncate_file -> tresor"> <child name="data_fs" identity="file_vault -> data"/> </service>
<service name="Timer"> <parent/> </service>
<service name="PD"> <parent/> </service>
<service name="ROM"> <parent/> </service>
<service name="CPU"> <parent/> </service>
<service name="LOG"> <parent/> </service>
<service name="RM"> <parent/> </service>
</route>
</start>
</config>
</runtime>