2015-01-14 11:18:16 +00:00
|
|
|
if {[have_spec arm]} {
|
|
|
|
assert_spec arm_v7
|
|
|
|
}
|
|
|
|
|
2013-12-05 14:45:14 +00:00
|
|
|
#
|
|
|
|
# Check used commands
|
|
|
|
#
|
2018-06-19 17:55:04 +00:00
|
|
|
set mkfs [installed_command mkfs.vfat]
|
|
|
|
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 FAT-file-system image
|
|
|
|
#
|
|
|
|
catch { exec $dd if=/dev/zero of=bin/fs.raw bs=1M count=16 }
|
2014-08-14 15:16:06 +00:00
|
|
|
catch { exec $mkfs -F16 bin/fs.raw }
|
2013-12-05 14:45:14 +00:00
|
|
|
|
|
|
|
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-11-14 15:03:16 +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>
|
2020-06-18 14:27:10 +00:00
|
|
|
<start name="vfs_block">
|
2020-09-11 11:09:32 +00:00
|
|
|
<resource name="RAM" quantum="30M"/>
|
2013-12-05 14:45:14 +00:00
|
|
|
<provides><service name="Block"/></provides>
|
2020-06-18 14:27:10 +00:00
|
|
|
<config>
|
|
|
|
<vfs>
|
|
|
|
<ram/>
|
|
|
|
<import>
|
|
|
|
<rom name="fs.raw"/>
|
|
|
|
</import>
|
|
|
|
</vfs>
|
|
|
|
<default-policy root="/" file="fs.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-06-19 17:55:04 +00:00
|
|
|
<resource name="RAM" quantum="10M" />
|
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="msdos" ram="8M"/>
|
|
|
|
</vfs>
|
|
|
|
<default-policy 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>
|
2019-10-07 14:12:41 +00:00
|
|
|
<libc stdout="/dev/log"/>
|
|
|
|
<vfs>
|
|
|
|
<dir name="dev"> <log/> </dir>
|
|
|
|
<fs/>
|
|
|
|
</vfs>
|
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
|
|
|
fs.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
|
|
|
|
2014-08-22 12:43:54 +00:00
|
|
|
run_genode_until {.*child "test-libc_vfs" exited with exit value 0.*} 60
|
2013-12-05 14:45:14 +00:00
|
|
|
|
|
|
|
exec rm -f bin/fs.raw
|
|
|
|
puts "\nTest succeeded\n"
|