genode/repos/gems/run/depot_deploy.run
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

289 lines
10 KiB
Plaintext

create_boot_directory
import_from_depot [depot_user]/src/[base_src] \
[depot_user]/pkg/[drivers_interactive_pkg] \
[depot_user]/src/report_rom \
[depot_user]/src/fs_rom \
[depot_user]/src/vfs \
[depot_user]/src/nitpicker \
[depot_user]/src/init \
[depot_user]/src/vfs_ttf \
[depot_user]/src/libc \
[depot_user]/src/shim \
[depot_user]/raw/ttf-bitstream-vera-minimal
create_tar_from_depot_binaries [run_dir]/genode/depot.tar \
[depot_user]/pkg/chroot \
[depot_user]/pkg/system_shell \
[depot_user]/pkg/fonts_fs \
[depot_user]/pkg/wm \
[depot_user]/pkg/nano3d \
[depot_user]/pkg/window_layouter \
[depot_user]/pkg/motif_decorator \
[depot_user]/pkg/themed_decorator \
[depot_user]/pkg/sticks_blue_backdrop
proc current_pkg { pkg } { return $pkg/[_current_depot_archive_version pkg $pkg] }
install_config {
<config>
<parent-provides>
<service name="ROM"/>
<service name="IRQ"/>
<service name="IO_MEM"/>
<service name="IO_PORT"/>
<service name="PD"/>
<service name="RM"/>
<service name="CPU"/>
<service name="LOG"/>
</parent-provides>
<default-route>
<any-service> <parent/> <any-child/> </any-service>
</default-route>
<default caps="100" ram="1M"/>
<start name="timer">
<provides> <service name="Timer"/> </provides>
</start>
<start name="drivers" caps="1500" ram="64M" managing_system="yes">
<binary name="init"/>
<route>
<service name="ROM" label="config"> <parent label="drivers.config"/> </service>
<service name="Timer"> <child name="timer"/> </service>
<service name="Capture"> <child name="nitpicker"/> </service>
<service name="Event"> <child name="nitpicker"/> </service>
<any-service> <parent/> </any-service>
</route>
</start>
<start name="nitpicker" ram="4M">
<provides>
<service name="Gui"/> <service name="Capture"/> <service name="Event"/>
</provides>
<config focus="rom">
<capture/> <event/>
<background color="#123456"/>
<domain name="pointer" layer="1" content="client" label="no" origin="pointer" />
<domain name="default" layer="3" content="client" label="no" hover="always" />
<policy label_prefix="pointer" domain="pointer"/>
<default-policy domain="default"/>
</config>
</start>
<start name="pointer">
<route>
<service name="Gui"> <child name="nitpicker" /> </service>
<any-service> <parent/> <any-child/> </any-service>
</route>
</start>
<start name="report_rom">
<binary name="report_rom"/>
<provides> <service name="Report"/> <service name="ROM"/> </provides>
<config verbose="no">
<policy label="depot_deploy -> blueprint" report="depot_query -> blueprint"/>
<policy label="depot_query -> query" report="depot_deploy -> query"/>
<policy label="dynamic -> config" report="depot_deploy -> init.config"/>
<policy label="dynamic -> clipboard" report="dynamic -> clipboard"/>
</config>
</start>
<start name="vfs" ram="4M">
<provides> <service name="File_system"/> </provides>
<config>
<vfs> <tar name="depot.tar"/> </vfs>
<policy label_prefix="depot_query -> depot ->" root="/" />
<policy label_prefix="fs_rom ->" root="/" />
</config>
</start>
<start name="fs_rom" ram="50M">
<provides> <service name="ROM"/> </provides>
<route>
<service name="File_system"> <child name="vfs"/> </service>
<any-service> <parent/> </any-service>
</route>
</start>
<start name="depot_query" ram="2M">
<config query="rom">
<vfs> <dir name="depot"> <fs label="depot -> /"/> </dir> </vfs>
</config>
<route>
<service name="ROM" label="query"> <child name="report_rom"/> </service>
<service name="File_system"> <child name="vfs"/> </service>
<any-service> <parent/> <any-child/> </any-service>
</route>
</start>
<start name="ram_fs" ram="8M">
<binary name="vfs"/>
<provides> <service name="File_system"/> </provides>
<config>
<vfs> <ram/> </vfs>
<default-policy root="/" writeable="yes"/>
</config>
</start>
<start name="depot_deploy">
<config arch="} [depot_spec] {">
<static>
<parent-provides>
<service name="ROM"/>
<service name="CPU"/>
<service name="PD"/>
<service name="LOG"/>
<service name="Timer"/>
<service name="Gui"/>
<service name="File_system"/>
<service name="Report"/>
</parent-provides>
</static>
<common_routes>
<service name="ROM" label_last="ld.lib.so"> <parent/> </service>
<service name="ROM" label_last="init"> <parent/> </service>
<service name="CPU"> <parent/> </service>
<service name="PD"> <parent/> </service>
<service name="LOG"> <parent/> </service>
<service name="Timer"> <parent/> </service>
</common_routes>
<start name="recall_fs" pkg="} [depot_user]/pkg/[current_pkg chroot] {">
<route>
<service name="File_system"> <parent/> </service>
</route>
<config> <default-policy path_prefix="/recall" writeable="yes"/> </config>
</start>
<start name="wm" pkg="} [depot_user]/pkg/[current_pkg wm] {">
<route>
<service name="Gui"> <parent/> </service>
</route>
</start>
<start name="window_layouter" pkg="} [depot_user]/pkg/[current_pkg window_layouter] {">
<route>
<service name="ROM" label="window_list"> <child name="wm"/> </service>
<service name="ROM" label="focus_request"> <child name="wm"/> </service>
<service name="ROM" label="hover"> <child name="wm"/> </service>
<service name="ROM" label="decorator_margins"> <child name="wm"/> </service>
<service name="ROM" label="rules"> <child name="wm"/> </service>
<service name="Report"> <child name="wm"/> </service>
<service name="Gui"> <child name="wm"/> </service>
<service name="File_system" label_prefix="recall ->"> <child name="recall_fs"/> </service>
</route>
</start>
<start name="themed_decorator" pkg="} [depot_user]/pkg/[current_pkg themed_decorator] {">
<route>
<service name="ROM" label="window_layout"> <child name="wm"/> </service>
<service name="ROM" label="pointer"> <child name="wm"/> </service>
<service name="Report"> <child name="wm"/> </service>
<service name="Gui"> <child name="wm"/> </service>
</route>
</start>
<start name="backdrop" pkg="} [depot_user]/pkg/[current_pkg sticks_blue_backdrop] {">
<route>
<service name="Gui"> <parent label="backdrop"/> </service>
</route>
</start>
<!--
<start name="slides" pkg="} [depot_user]/pkg/[current_pkg pdf_view] {">
<route>
<service name="Gui"> <child name="wm"/> </service>
</route>
</start>
-->
<start name="nano3d" pkg="} [depot_user]/pkg/[current_pkg nano3d] {">
<route>
<service name="Gui"> <child name="wm"/> </service>
</route>
<config shape="cube"/>
</start>
<start name="fonts_fs" pkg="} [depot_user]/pkg/[current_pkg fonts_fs] {">
<route>
<service name="ROM" label="config"> <parent label="fonts.config"/> </service>
</route>
</start>
<start name="system_shell" pkg="} [depot_user]/pkg/[current_pkg system_shell] {">
<route>
<service name="Gui"> <child name="wm"/> </service>
<service name="File_system" label_prefix="fonts ->"> <child name="fonts_fs"/> </service>
<service name="File_system"> <parent/> </service>
<service name="Report" label="clipboard"> <parent label="clipboard"/> </service>
<service name="ROM" label="clipboard"> <parent label="clipboard"/> </service>
<service name="ROM" label="vimrc"> <parent label="vimrc"/> </service>
<service name="ROM" label_last="cached_fs_rom">
<parent label="fs_rom"/> </service>
</route>
</start>
<!-- vbox, nic_router, acpica -->
</config>
<route>
<service name="ROM" label="blueprint"> <child name="report_rom"/> </service>
<service name="Report" label="query"> <child name="report_rom"/> </service>
<service name="Report" label="clipboard"> <child name="report_rom"/> </service>
<service name="ROM" label="clipboard"> <child name="report_rom"/> </service>
<any-service> <parent/> <any-child/> </any-service>
</route>
</start>
<start name="dynamic" caps="8000" ram="180M">
<binary name="init"/>
<route>
<service name="ROM" label_last="ld.lib.so"> <parent/> </service>
<service name="ROM" label_last="init"> <parent/> </service>
<service name="ROM" label_last="shim"> <parent/> </service>
<service name="ROM" label="config"> <child name="report_rom"/> </service>
<service name="ROM" label_last="fonts.config"> <parent/> </service>
<service name="ROM" label_last="vimrc"> <parent/> </service>
<service name="ROM" label_last="fs_rom"> <parent/> </service>
<service name="ROM"> <child name="fs_rom"/> </service>
<service name="Timer"> <child name="timer"/> </service>
<service name="Gui" label_last="backdrop">
<child name="nitpicker" label="backdrop"/> </service>
<service name="File_system"> <child name="ram_fs"/> </service>
<any-service> <parent/> <any-child/> </any-service>
</route>
</start>
</config>}
build { app/depot_query app/depot_deploy }
copy_file [genode_dir]/repos/gems/sculpt/fonts/default [run_dir]/genode/fonts.config
copy_file [genode_dir]/repos/ports/recipes/raw/system_shell/system_shell.config [run_dir]/genode/
#
# Pin the nitpicker focus to the window manager by providing a static focus ROM
#
set fd [open [run_dir]/genode/focus w]
puts $fd "<focus label=\"dynamic -> wm -> focus\"/>"
close $fd
# write default vimrc file
set vimrc_fd [open [run_dir]/genode/vimrc w]
puts $vimrc_fd {
set noloadplugins
set hls
set nocompatible
set laststatus=2
set noswapfile
set viminfo=}
close $vimrc_fd
build_boot_image [build_artifacts]
run_genode_until forever