2015-01-14 11:18:16 +00:00
|
|
|
if {[have_spec arm]} {
|
|
|
|
assert_spec arm_v7
|
|
|
|
}
|
|
|
|
|
2022-08-09 11:32:38 +00:00
|
|
|
if {[get_cmd_switch --autopilot] && [have_board virt_qemu_riscv]} {
|
2021-02-18 08:04:39 +00:00
|
|
|
puts "Autopilot mode is not supported on this platform."
|
|
|
|
exit 0
|
|
|
|
}
|
|
|
|
|
2013-12-05 14:45:14 +00:00
|
|
|
#
|
|
|
|
# Check used commands
|
|
|
|
#
|
2018-06-19 17:55:04 +00:00
|
|
|
set mke2fs [installed_command mke2fs]
|
|
|
|
set dd [installed_command dd]
|
2013-12-05 14:45:14 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Build
|
|
|
|
#
|
|
|
|
set build_components {
|
2019-01-03 17:01:49 +00:00
|
|
|
core init timer
|
2020-06-18 14:27:10 +00:00
|
|
|
server/vfs_block
|
2019-10-07 14:12:41 +00:00
|
|
|
server/vfs
|
2022-09-01 11:12:13 +00:00
|
|
|
lib/vfs_rump
|
|
|
|
lib/vfs_import
|
2014-04-14 09:57:22 +00:00
|
|
|
test/libc_vfs
|
2013-12-05 14:45:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
build $build_components
|
|
|
|
|
|
|
|
#
|
|
|
|
# Build EXT2-file-system image
|
|
|
|
#
|
|
|
|
catch { exec $dd if=/dev/zero of=bin/ext2.raw bs=1M count=16 }
|
|
|
|
catch { exec $mke2fs -F bin/ext2.raw }
|
|
|
|
|
|
|
|
create_boot_directory
|
|
|
|
|
|
|
|
#
|
|
|
|
# Generate config
|
|
|
|
#
|
|
|
|
append 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>
|
2017-05-07 20:36:11 +00:00
|
|
|
<default caps="100"/>
|
2013-12-05 14:45:14 +00:00
|
|
|
<start name="timer">
|
|
|
|
<resource name="RAM" quantum="1M"/>
|
|
|
|
<provides><service name="Timer"/></provides>
|
|
|
|
</start>
|
2021-05-17 12:56:50 +00:00
|
|
|
<start name="vfs_block" caps="120">
|
2013-12-05 14:45:14 +00:00
|
|
|
<resource name="RAM" quantum="20M"/>
|
|
|
|
<provides><service name="Block"/></provides>
|
2020-06-18 14:27:10 +00:00
|
|
|
<config>
|
|
|
|
<vfs>
|
|
|
|
<ram/>
|
|
|
|
<import>
|
|
|
|
<rom name="ext2.raw"/>
|
|
|
|
</import>
|
|
|
|
</vfs>
|
|
|
|
<default-policy root="/" file="ext2.raw" block_size="512"
|
|
|
|
writeable="yes"/>
|
|
|
|
</config>
|
2013-12-05 14:45:14 +00:00
|
|
|
</start>
|
2019-10-07 14:12:41 +00:00
|
|
|
<start name="vfs" caps="200">
|
2018-04-20 08:54:45 +00:00
|
|
|
<resource name="RAM" quantum="16M" />
|
2013-12-05 14:45:14 +00:00
|
|
|
<provides><service name="File_system"/></provides>
|
2019-10-07 14:12:41 +00:00
|
|
|
<config>
|
|
|
|
<vfs> <rump fs="ext2fs" ram="10M"/> </vfs>
|
|
|
|
<policy label_prefix="test-libc_vfs" root="/" writeable="yes"/>
|
|
|
|
</config>
|
2013-12-05 14:45:14 +00:00
|
|
|
</start>
|
2014-04-14 09:57:22 +00:00
|
|
|
<start name="test-libc_vfs">
|
2013-12-05 14:45:14 +00:00
|
|
|
<resource name="RAM" quantum="4M"/>
|
2014-04-14 09:57:22 +00:00
|
|
|
<config>
|
2017-03-23 16:59:25 +00:00
|
|
|
<vfs>
|
|
|
|
<dir name="dev"> <log/> </dir>
|
|
|
|
<fs/>
|
|
|
|
</vfs>
|
|
|
|
<libc stdout="/dev/log"/>
|
2014-04-14 09:57:22 +00:00
|
|
|
</config>
|
2013-12-05 14:45:14 +00:00
|
|
|
</start>
|
|
|
|
</config>}
|
|
|
|
|
|
|
|
install_config $config
|
|
|
|
|
|
|
|
#
|
|
|
|
# Boot modules
|
|
|
|
#
|
|
|
|
|
|
|
|
# generic modules
|
|
|
|
set boot_modules {
|
2020-06-18 14:27:10 +00:00
|
|
|
core ld.lib.so init timer test-libc_vfs vfs_block
|
2019-10-07 14:12:41 +00:00
|
|
|
rump.lib.so rump_fs.lib.so vfs vfs_rump.lib.so
|
2020-06-18 14:27:10 +00:00
|
|
|
ext2.raw libc.lib.so vfs.lib.so vfs_import.lib.so
|
2013-12-05 14:45:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
build_boot_image $boot_modules
|
|
|
|
|
2017-05-23 13:05:55 +00:00
|
|
|
append qemu_args " -nographic"
|
2013-12-05 14:45:14 +00:00
|
|
|
|
2020-06-18 14:27:10 +00:00
|
|
|
run_genode_until {.*child "test-libc_vfs" exited with exit value 0.*} 80
|
2013-12-05 14:45:14 +00:00
|
|
|
|
|
|
|
exec rm -f bin/ext2.raw
|