Skip to content

Commit

Permalink
wip: run/bash: "mount" FAT file system
Browse files Browse the repository at this point in the history
WIP commit to reproduce genodelabs#5329 interactively.
  • Loading branch information
rite committed Aug 22, 2024
1 parent 299951c commit 6e4a5ce
Showing 1 changed file with 42 additions and 1 deletion.
43 changes: 42 additions & 1 deletion repos/ports/run/bash.run
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ import_from_depot [depot_user]/src/[base_src] \
[depot_user]/src/bash \
[depot_user]/src/coreutils \
[depot_user]/src/vfs \
[depot_user]/src/vfs_block \
[depot_user]/src/vfs_fatfs \
[depot_user]/src/vfs_import \
[depot_user]/src/vfs_pipe \
[depot_user]/src/nitpicker \
[depot_user]/src/fs_rom
Expand Down Expand Up @@ -86,6 +89,21 @@ install_config {
</route>
</start>

<start name="vfs_block" caps="200">
<resource name="RAM" quantum="196M" />
<provides><service name="Block"/></provides>
<config>
<vfs>
<ram/>
<import>
<rom name="test.hda"/>
</import>
</vfs>
<default-policy file="/test.hda" block_size="512"
writeable="yes"/>
</config>
</start>

<start name="vfs" caps="120">
<resource name="RAM" quantum="30M"/>
<provides><service name="File_system"/></provides>
Expand All @@ -98,6 +116,7 @@ install_config {
<dir name="home"> <ram/> </dir>
<dir name="share"> <dir name="vim"> <rom name="vimrc"/> </dir> </dir>
<dir name="tmp"> <ram/> </dir>
<dir name="fatfs"> <fatfs/> </dir>
<dir name="dev">
<zero/> <null/> <terminal/>
<inline name="rtc">2018-01-01 00:01</inline>
Expand Down Expand Up @@ -145,8 +164,30 @@ set fd [open [run_dir]/genode/focus w]
puts $fd "<focus label=\"terminal -> \" domain=\"default\"/>"
close $fd


#
# Prepare hard-disk image for test (used in RAM)
#

set disk_image "bin/test.hda"
set cmd "dd if=/dev/zero of=$disk_image bs=1024 count=65536"
puts "creating disk image: $cmd"
catch { exec sh -c $cmd }

set mkfs_cmd [installed_command mkfs.vfat]
set mkfs_opts "-F32 -nlibc_vfs"

set cmd "$mkfs_cmd $mkfs_opts $disk_image"
puts "formating disk: $cmd"
catch { exec sh -c $cmd }


#
# Boot modules
#

build { lib/ld lib/libc lib/vfs lib/posix test/fork test/execve }

build_boot_image [build_artifacts]
build_boot_image [list {*}[build_artifacts] test.hda]

run_genode_until forever

0 comments on commit 6e4a5ce

Please sign in to comment.