2024-04-19 05:05:38 +00:00
|
|
|
proc jent_avail { } {
|
|
|
|
|
|
|
|
if {[have_board pbxa9]} { return 0 }
|
|
|
|
if {[have_board zynq_qemu]} { return 0 }
|
|
|
|
return 1
|
|
|
|
}
|
|
|
|
|
|
|
|
proc jent_avail_attr { } {
|
|
|
|
|
|
|
|
if {[jent_avail]} { return "yes" }
|
|
|
|
return "no"
|
|
|
|
}
|
|
|
|
|
|
|
|
build { app/file_vault }
|
|
|
|
|
|
|
|
create_boot_directory
|
|
|
|
|
|
|
|
append archives "
|
|
|
|
[depot_user]/src/[base_src]
|
|
|
|
[depot_user]/src/init
|
|
|
|
[depot_user]/src/libc
|
|
|
|
[depot_user]/src/zlib
|
|
|
|
[depot_user]/src/fs_query
|
|
|
|
[depot_user]/src/tresor
|
|
|
|
[depot_user]/src/vfs_block
|
|
|
|
[depot_user]/src/vfs
|
|
|
|
[depot_user]/src/openssl
|
|
|
|
[depot_user]/src/fs_tool
|
|
|
|
[depot_user]/src/fs_utils
|
|
|
|
[depot_user]/src/posix
|
|
|
|
[depot_user]/src/rump
|
|
|
|
[depot_user]/src/sandbox
|
|
|
|
[depot_user]/src/report_rom
|
|
|
|
[depot_user]/src/dynamic_rom
|
|
|
|
"
|
|
|
|
|
|
|
|
append_if [jent_avail] archives " [depot_user]/src/vfs_jitterentropy "
|
|
|
|
|
|
|
|
lappend_if [have_board linux] archives [depot_user]/src/lx_fs
|
|
|
|
|
|
|
|
import_from_depot $archives
|
|
|
|
|
|
|
|
append config {
|
|
|
|
|
|
|
|
<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"/>
|
|
|
|
</parent-provides>
|
|
|
|
|
|
|
|
<start name="timer" caps="200">
|
|
|
|
<resource name="RAM" quantum="1M"/>
|
|
|
|
<resource name="CPU" quantum="5"/>
|
|
|
|
<provides> <service name="Timer"/> </provides>
|
|
|
|
<route>
|
2024-04-16 23:17:21 +00:00
|
|
|
<service name="PD"> <parent/> </service>
|
|
|
|
<service name="ROM"> <parent/> </service>
|
|
|
|
<service name="LOG"> <parent/> </service>
|
|
|
|
<service name="CPU"> <parent/> </service>
|
2024-04-19 05:05:38 +00:00
|
|
|
<service name="IO_PORT"> <parent/> </service>
|
2024-04-16 23:17:21 +00:00
|
|
|
<service name="IRQ"> <parent/> </service>
|
2024-04-19 05:05:38 +00:00
|
|
|
</route>
|
|
|
|
</start>
|
|
|
|
|
|
|
|
<start name="dynamic_rom" caps="100">
|
|
|
|
<resource name="RAM" quantum="4M"/>
|
|
|
|
<provides><service name="ROM"/> </provides>
|
2024-04-22 09:45:05 +00:00
|
|
|
<config verbose="yes">
|
2024-04-19 05:05:38 +00:00
|
|
|
<rom name="file_vault_ui_config">
|
2024-04-22 09:45:05 +00:00
|
|
|
<inline> <ui_config/> </inline>
|
2024-04-19 05:05:38 +00:00
|
|
|
<sleep milliseconds="6000"/>
|
2024-04-22 09:45:05 +00:00
|
|
|
<inline> <ui_config passphrase="abcdefgh" client_fs_size="1M" journaling_buf_size="1M"/> </inline>
|
2024-04-19 05:05:38 +00:00
|
|
|
<sleep milliseconds="10000"/>
|
2024-04-22 09:45:05 +00:00
|
|
|
<inline> <ui_config/> </inline>
|
2024-04-19 05:05:38 +00:00
|
|
|
<sleep milliseconds="6000"/>
|
2024-04-22 09:45:05 +00:00
|
|
|
<inline> <ui_config passphrase="00000001"/> </inline>
|
2024-04-19 05:05:38 +00:00
|
|
|
<sleep milliseconds="6000"/>
|
2024-04-22 09:45:05 +00:00
|
|
|
<inline> <ui_config/> </inline>
|
2024-04-19 05:05:38 +00:00
|
|
|
<sleep milliseconds="6000"/>
|
2024-04-22 09:45:05 +00:00
|
|
|
<inline> <ui_config passphrase="abcdefgh"/> </inline>
|
2024-04-19 05:05:38 +00:00
|
|
|
<sleep milliseconds="600000"/>
|
|
|
|
</rom>
|
|
|
|
</config>
|
|
|
|
<route>
|
|
|
|
<service name="Timer"> <child name="timer"/> </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">
|
|
|
|
<resource name="RAM" quantum="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> }
|
|
|
|
|
|
|
|
append_if [have_board linux] config {
|
|
|
|
|
|
|
|
<start name="data_fs" caps="200" ld="no">
|
|
|
|
<binary name="lx_fs"/>
|
|
|
|
<resource name="RAM" quantum="4M"/>
|
|
|
|
<provides>
|
|
|
|
<service name="File_system"/>
|
|
|
|
</provides>
|
|
|
|
<config>
|
2024-04-16 23:17:21 +00:00
|
|
|
<policy label="file_vault -> data" root="/file_vault_dir/data" writeable="yes"/>
|
2024-04-19 05:05:38 +00:00
|
|
|
</config>
|
|
|
|
<route>
|
|
|
|
<service name="Timer"> <child name="timer"/> </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="trust_anchor_fs" caps="200" ld="no">
|
|
|
|
<binary name="lx_fs"/>
|
|
|
|
<resource name="RAM" quantum="4M"/>
|
|
|
|
<provides>
|
|
|
|
<service name="File_system"/>
|
|
|
|
</provides>
|
|
|
|
<config>
|
2024-04-16 23:17:21 +00:00
|
|
|
<policy label="file_vault -> trust_anchor" root="/file_vault_dir/trust_anchor" writeable="yes"/>
|
2024-04-19 05:05:38 +00:00
|
|
|
</config>
|
|
|
|
<route>
|
|
|
|
<service name="Timer"> <child name="timer"/> </service>
|
|
|
|
<service name="PD"> <parent/> </service>
|
|
|
|
<service name="ROM"> <parent/> </service>
|
|
|
|
<service name="LOG"> <parent/> </service>
|
|
|
|
<service name="CPU"> <parent/> </service>
|
|
|
|
</route>
|
|
|
|
</start> }
|
|
|
|
|
|
|
|
append_if [expr ![have_board linux]] config {
|
|
|
|
|
|
|
|
<start name="data_fs" caps="2000">
|
|
|
|
<binary name="vfs"/>
|
|
|
|
<resource name="RAM" quantum="200M"/>
|
|
|
|
<provides><service name="File_system"/></provides>
|
|
|
|
<config>
|
|
|
|
<vfs>
|
|
|
|
<dir name="data">
|
|
|
|
<ram/>
|
|
|
|
</dir>
|
|
|
|
</vfs>
|
|
|
|
<policy label="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">
|
|
|
|
<binary name="vfs"/>
|
|
|
|
<resource name="RAM" quantum="5M"/>
|
|
|
|
<provides><service name="File_system"/></provides>
|
|
|
|
<config>
|
|
|
|
<vfs>
|
|
|
|
<dir name="trust_anchor">
|
|
|
|
<ram/>
|
|
|
|
</dir>
|
|
|
|
</vfs>
|
|
|
|
<policy label="file_vault -> trust_anchor" root="/trust_anchor" writeable="yes"/>
|
|
|
|
</config>
|
|
|
|
<route>
|
2024-04-16 23:17:21 +00:00
|
|
|
<service name="PD"> <parent/> </service>
|
2024-04-19 05:05:38 +00:00
|
|
|
<service name="ROM"> <parent/> </service>
|
|
|
|
<service name="LOG"> <parent/> </service>
|
|
|
|
<service name="CPU"> <parent/> </service>
|
|
|
|
</route>
|
|
|
|
</start> }
|
|
|
|
|
|
|
|
append config {
|
|
|
|
|
2024-04-23 07:37:45 +00:00
|
|
|
<start name="file_vault" caps="1000">
|
|
|
|
<resource name="RAM" quantum="80M"/>
|
2024-04-19 05:05:38 +00:00
|
|
|
<config jitterentropy_available="} [jent_avail_attr] {">
|
|
|
|
<vfs>
|
|
|
|
<dir name="tresor">
|
|
|
|
<fs label="tresor"/>
|
|
|
|
</dir>
|
|
|
|
</vfs>
|
|
|
|
</config>
|
|
|
|
<route>
|
2024-04-16 23:17:21 +00:00
|
|
|
<service name="ROM" label="ui_config"> <child name="dynamic_rom" label="file_vault_ui_config"/> </service>
|
|
|
|
<service name="Report" label="ui_report"> <child name="report_rom"/> </service>
|
2024-04-19 05:05:38 +00:00
|
|
|
<service name="File_system" label="tresor_trust_anchor_vfs -> storage_dir"> <child name="trust_anchor_fs" label="file_vault -> trust_anchor"/> </service>
|
2024-04-16 23:17:21 +00:00
|
|
|
<service name="File_system" label="tresor_init -> "> <child name="data_fs" label="file_vault -> data"/> </service>
|
|
|
|
<service name="File_system" label="tresor"> <child name="data_fs" label="file_vault -> data"/> </service>
|
|
|
|
<service name="File_system" label="fs_query -> "> <child name="data_fs" label="file_vault -> data"/> </service>
|
|
|
|
<service name="File_system" label="image_fs_query -> "> <child name="data_fs" label="file_vault -> data"/> </service>
|
|
|
|
<service name="File_system" label="tresor_vfs -> tresor_fs"> <child name="data_fs" label="file_vault -> data"/> </service>
|
|
|
|
<service name="File_system" label="truncate_file -> tresor"> <child name="data_fs" label="file_vault -> data"/> </service>
|
|
|
|
<service name="Timer"> <child name="timer"/> </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>
|
2024-04-19 05:05:38 +00:00
|
|
|
</route>
|
|
|
|
</start>
|
|
|
|
|
|
|
|
</config> }
|
|
|
|
|
|
|
|
install_config $config
|
|
|
|
|
|
|
|
if {[have_board linux]} {
|
|
|
|
exec rm -rf bin/file_vault_dir
|
|
|
|
exec mkdir -p bin/file_vault_dir/data
|
|
|
|
exec mkdir -p bin/file_vault_dir/trust_anchor
|
|
|
|
}
|
|
|
|
|
|
|
|
append boot_modules [build_artifacts]
|
|
|
|
|
|
|
|
lappend_if [have_board linux] boot_modules file_vault_dir
|
|
|
|
|
|
|
|
build_boot_image $boot_modules
|
|
|
|
|
|
|
|
append exp_output {.*<ui_report.* state=\"uninitialized\".*\n}
|
|
|
|
append exp_output {.*<ui_report.* state=\"initializing\".*\n}
|
|
|
|
append exp_output {.*<ui_report.* state=\"unlocked\".*\n}
|
|
|
|
append exp_output {.*<ui_report.* state=\"locked\".*\n}
|
|
|
|
append exp_output {.*<ui_report.* state=\"unlocked\".*\n}
|
|
|
|
|
|
|
|
append qemu_args " -display none "
|
|
|
|
run_genode_until $exp_output 70
|