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"
}
proc passphrase { } { return abcdefgh }
proc lx_fs_dir { } { return bin/file_vault_client_dir }
proc lx_fs_dir_template { } { return $::env(LX_FS_DIR_TEMPLATE) }
proc lx_fs_dir_template_set { } { return [info exists ::env(LX_FS_DIR_TEMPLATE)] }
proc container_initialized { } { return [expr [have_board linux] && [lx_fs_dir_template_set]] }
proc bash_profile { } {
if {[container_initialized]} { return file_vault_client_2.sh }
return file_vault_client_1.sh
}
if {[have_board linux]} {
if {[lx_fs_dir_template_set]} {
if {[file normalize [lx_fs_dir_template]] == [file normalize [lx_fs_dir]]} {
puts ""
puts "Error: please set LX_FS_DIR_TEMPLATE to something other than [lx_fs_dir]"
puts ""
exit -1
}
puts ""
puts "Use lx_fs directory template [lx_fs_dir_template]"
puts ""
}
}
build {
lib/tresor lib/vfs_tresor_trust_anchor lib/vfs_tresor_crypto_aes_cbc
lib/vfs_tresor app/tresor_init_trust_anchor app/tresor_init 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/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/vfs_pipe
[depot_user]/src/rump
[depot_user]/src/fs_rom
[depot_user]/src/log_terminal
[depot_user]/src/sandbox
[depot_user]/src/coreutils
[depot_user]/src/bash
[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 {
}
if {[container_initialized]} { append config "
"
} else { append config "
"
}
append config {
2018-01-01 00:01
}
if {[have_board linux]} {
append config {
}
} else {
append config {
}
}
append config {
}
exec cp [repository_contains run/[bash_profile]]/run/[bash_profile] bin/
install_config $config
if {[have_board linux]} {
exec rm -rf [lx_fs_dir]
if {[lx_fs_dir_template_set]} {
exec cp -r [lx_fs_dir_template] [lx_fs_dir]
} else {
exec mkdir -p [lx_fs_dir]/data
exec mkdir -p [lx_fs_dir]/trust_anchor
}
}
append boot_modules [build_artifacts]
lappend boot_modules [bash_profile]
lappend_if [have_board linux] boot_modules [file tail [lx_fs_dir]]
build_boot_image $boot_modules
append qemu_args " -display none "
run_genode_until ".*\n" 60
grep_output {\[init -> dynamic_init -> log_terminal\].*}
if {[container_initialized]} {
compare_output_to {
[init -> dynamic_init -> log_terminal] total 1
[init -> dynamic_init -> log_terminal] drwx------ 1 root 0 0 Jan 1 1970 dir_1
[init -> dynamic_init -> log_terminal] -rwx------ 1 root 0 18 Jan 1 1970 file_1
[init -> dynamic_init -> log_terminal] drwx------ 1 root 0 0 Jan 1 1970 lost+found
[init -> dynamic_init -> log_terminal] total 1
[init -> dynamic_init -> log_terminal] -rwx------ 1 root 0 66 Jan 1 1970 file_2
[init -> dynamic_init -> log_terminal] Ein zweiter Test.
[init -> dynamic_init -> log_terminal] Eine weitere Datei.
[init -> dynamic_init -> log_terminal] Mit mehr Inhalt.
[init -> dynamic_init -> log_terminal] Und Sonderzeichen: /.:($)=%!
}
} else {
compare_output_to {
[init -> dynamic_init -> log_terminal] Hallo Welt!
[init -> dynamic_init -> log_terminal] Ein zweiter Test.
[init -> dynamic_init -> log_terminal] total 1
[init -> dynamic_init -> log_terminal] -rwx------ 1 root 0 18 Jan 1 1970 file_1
[init -> dynamic_init -> log_terminal] drwx------ 1 root 0 0 Jan 1 1970 lost+found
[init -> dynamic_init -> log_terminal] Eine weitere Datei.
[init -> dynamic_init -> log_terminal] Mit mehr Inhalt.
[init -> dynamic_init -> log_terminal] Eine weitere Datei.
[init -> dynamic_init -> log_terminal] Mit mehr Inhalt.
[init -> dynamic_init -> log_terminal] Und Sonderzeichen: /.:($)=%!
[init -> dynamic_init -> log_terminal] total 1
[init -> dynamic_init -> log_terminal] drwx------ 1 root 0 0 Jan 1 1970 dir_1
[init -> dynamic_init -> log_terminal] -rwx------ 1 root 0 18 Jan 1 1970 file_1
[init -> dynamic_init -> log_terminal] drwx------ 1 root 0 0 Jan 1 1970 lost+found
[init -> dynamic_init -> log_terminal] total 1
[init -> dynamic_init -> log_terminal] -rwx------ 1 root 0 66 Jan 1 1970 file_2
}
}
if {[get_cmd_switch --autopilot] && [have_board linux]} { exec rm -rf [lx_fs_dir] }