Build system cleanup
This commit is contained in:
parent
a91a125149
commit
e65dc07e48
|
@ -1,2 +1,3 @@
|
|||
TARGET_NAME = blobsets
|
||||
include_rules
|
||||
include $(NIMBLE_BINARIES_INCLUDE)
|
|
@ -1,2 +0,0 @@
|
|||
include_rules
|
||||
include $(NIMBLE_PACKAGE_INCLUDE)
|
|
@ -1,3 +0,0 @@
|
|||
@SDK_USER@/src/libc/@SDK_VERSION@
|
||||
@SDK_USER@/src/vfs/@SDK_VERSION@
|
||||
@DEPOT_USER@/src/blobsets/@DEPOT_VERSION@
|
|
@ -1,2 +0,0 @@
|
|||
include_rules
|
||||
include $(NIMBLE_PACKAGE_INCLUDE)
|
|
@ -1,4 +0,0 @@
|
|||
@SDK_USER@/src/libc/@SDK_VERSION@
|
||||
@SDK_USER@/src/vfs_lwip/@SDK_VERSION@
|
||||
@SDK_USER@/src/vfs/@SDK_VERSION@
|
||||
@DEPOT_USER@/src/blobsets/@DEPOT_VERSION@
|
|
@ -0,0 +1,8 @@
|
|||
TARGET_NAME = blobsets_fs
|
||||
PKG_DEPENDS += \
|
||||
@(SDK_USER)/src/libc/@(SDK_VERSION) \
|
||||
@(SDK_USER)/src/vfs/@(SDK_VERSION) \
|
||||
_/src/blobsets \
|
||||
|
||||
include_rules
|
||||
include $(NIMBLE_PACKAGE_INCLUDE)
|
|
@ -0,0 +1,10 @@
|
|||
TARGET_NAME = blobsets_http
|
||||
|
||||
PKG_DEPENDS += \
|
||||
@(SDK_USER)/src/libc/@(SDK_VERSION) \
|
||||
@(SDK_USER)/src/vfs/@(SDK_VERSION) \
|
||||
@(PUBLIC_SRC_LWIP) \
|
||||
local/src/blobsets \
|
||||
|
||||
include_rules
|
||||
include $(NIMBLE_PACKAGE_INCLUDE)
|
|
@ -1,2 +0,0 @@
|
|||
MIRRORED_FROM_REP_DIR := include/ipld_session
|
||||
include $(GENODE_DIR)/repos/os/recipes/api/session.inc
|
|
@ -1 +0,0 @@
|
|||
2018-08-10 e43f1005e83c88bfe0ad2838cdc5ab244a52b4f7
|
|
@ -1,3 +0,0 @@
|
|||
|
||||
ROM and File_system proxy to the IPFS gateway
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
_/src/goipfs_proxy
|
||||
_/src/ipfs_fs
|
||||
_/src/ipfs_rom
|
||||
_/src/libc
|
||||
_/src/vfs
|
||||
_/src/vfs_lwip
|
|
@ -1 +0,0 @@
|
|||
2018-08-13-a 10068d43496cf876e554f9cd37a21ec678854a5b
|
|
@ -1,76 +0,0 @@
|
|||
<runtime ram="48M" caps="768" binary="init">
|
||||
|
||||
<provides> <file_system/> <rom/> <ipld/> </provides>
|
||||
|
||||
<requires> <nic/> </requires>
|
||||
|
||||
<content>
|
||||
<rom label="goipfs_proxy"/>
|
||||
<rom label="init"/>
|
||||
<rom label="ipfs_fs"/>
|
||||
<rom label="ipfs_rom"/>
|
||||
<rom label="ld.lib.so"/>
|
||||
<rom label="libc.lib.so"/>
|
||||
<rom label="vfs"/>
|
||||
<rom label="vfs.lib.so"/>
|
||||
<rom label="vfs_lwip.lib.so"/>
|
||||
</content>
|
||||
|
||||
<config>
|
||||
<parent-provides>
|
||||
<service name="CPU"/>
|
||||
<service name="LOG"/>
|
||||
<service name="PD"/>
|
||||
<service name="RM"/>
|
||||
<service name="ROM"/>
|
||||
<service name="Nic"/>
|
||||
<service name="Timer"/>
|
||||
</parent-provides>
|
||||
|
||||
<default-route>
|
||||
<any-service> <parent/> <any-child/> </any-service>
|
||||
</default-route>
|
||||
|
||||
<default caps="128"/>
|
||||
|
||||
<service name="Ipld">
|
||||
<default-policy> <child name="goipfs_proxy"/> </default-policy> </service>
|
||||
|
||||
<service name="ROM">
|
||||
<default-policy> <child name="ipfs_rom"/> </default-policy> </service>
|
||||
|
||||
<service name="File_system">
|
||||
<default-policy> <child name="ipfs_fs"/> </default-policy> </service>
|
||||
|
||||
<start name="goipfs_proxy" caps="512">
|
||||
<resource name="RAM" quantum="32M"/>
|
||||
<provides> <service name="Ipld"/> </provides>
|
||||
<config ipfs_url="http://10.0.1.3:5001">
|
||||
<libc stdout="/log" stderr="/log" socket="/socket"/>
|
||||
<vfs>
|
||||
<log/>
|
||||
<dir name="socket"> <lwip dhcp="yes"/> </dir>
|
||||
</vfs>
|
||||
</config>
|
||||
</start>
|
||||
<start name="ipfs_rom">
|
||||
<resource name="RAM" quantum="8M"/>
|
||||
<provides> <service name="ROM"/> </provides>
|
||||
<config>
|
||||
<libc stdout="/log" stderr="/log"/>
|
||||
<vfs> <log/> </vfs>
|
||||
<default-policy/>
|
||||
</config>
|
||||
</start>
|
||||
<start name="ipfs_fs">
|
||||
<resource name="RAM" quantum="8M"/>
|
||||
<provides> <service name="File_system"/> </provides>
|
||||
<config>
|
||||
<libc stdout="/log" stderr="/log"/>
|
||||
<vfs> <log/> </vfs>
|
||||
<default-policy/>
|
||||
</config>
|
||||
</start>
|
||||
</config>
|
||||
|
||||
</runtime>
|
|
@ -1,3 +0,0 @@
|
|||
SRC_DIR := src/nimble/goipfs_proxy
|
||||
include $(GENODE_DIR)/repos/base/recipes/src/content.inc
|
||||
include $(REP_DIR)/recipes/src/nimble.inc
|
|
@ -1 +0,0 @@
|
|||
2018-08-10 4fc24f7020e3a7f96ca4e45912930c2f085fe281
|
|
@ -1,5 +0,0 @@
|
|||
base
|
||||
os
|
||||
libc
|
||||
vfs
|
||||
ipld_session
|
|
@ -1,3 +0,0 @@
|
|||
SRC_DIR := src/nimble/ipfs_fs
|
||||
include $(GENODE_DIR)/repos/base/recipes/src/content.inc
|
||||
include $(REP_DIR)/recipes/src/nimble.inc
|
|
@ -1 +0,0 @@
|
|||
2018-08-10 0252eb6af51cdc99b951b413d34b1b6e595d01ce
|
|
@ -1,6 +0,0 @@
|
|||
base
|
||||
file_system_session
|
||||
ipld_session
|
||||
libc
|
||||
os
|
||||
vfs
|
|
@ -1,3 +0,0 @@
|
|||
SRC_DIR := src/nimble/ipfs_rom
|
||||
include $(GENODE_DIR)/repos/base/recipes/src/content.inc
|
||||
include $(REP_DIR)/recipes/src/nimble.inc
|
|
@ -1 +0,0 @@
|
|||
2018-08-10 349024984b5846a680348f952c9bfe0e4caba0a7
|
|
@ -1,5 +0,0 @@
|
|||
base
|
||||
os
|
||||
libc
|
||||
vfs
|
||||
ipld_session
|
|
@ -1,3 +0,0 @@
|
|||
SRC_DIR := src/nimble/ipld_fs_store
|
||||
include $(GENODE_DIR)/repos/base/recipes/src/content.inc
|
||||
include $(REP_DIR)/recipes/src/nimble.inc
|
|
@ -1 +0,0 @@
|
|||
2018-08-10 63e96890c89b0cfad632d60e8ab9a0d89df08ac9
|
|
@ -1,5 +0,0 @@
|
|||
base
|
||||
os
|
||||
libc
|
||||
vfs
|
||||
ipld_session
|
|
@ -1,3 +0,0 @@
|
|||
SRC_DIR := src/nimble/ipld_replicate
|
||||
include $(GENODE_DIR)/repos/base/recipes/src/content.inc
|
||||
include $(REP_DIR)/recipes/src/nimble.inc
|
|
@ -1 +0,0 @@
|
|||
2018-08-10-a 8592737648f1ecb52008dbcc00a1bd2c7c28d8fa
|
|
@ -1,5 +0,0 @@
|
|||
base
|
||||
os
|
||||
libc
|
||||
vfs
|
||||
ipld_session
|
|
@ -1,5 +0,0 @@
|
|||
content: mk/nimble.mk
|
||||
|
||||
mk/nimble.mk: $(GENODE_DIR)/repos/world/mk/nimble.mk
|
||||
mkdir -p $(dir $@)
|
||||
cp $< $@
|
106
run/dagfs.inc
106
run/dagfs.inc
|
@ -1,106 +0,0 @@
|
|||
#
|
||||
# \brief Procedures for exporting packages to Dagfs
|
||||
# \author Emery Hemingway
|
||||
# \date 2018-01-01
|
||||
#
|
||||
|
||||
#
|
||||
# Spawn the REPL process
|
||||
#
|
||||
set timeout -1
|
||||
spawn dagfs_repl -s
|
||||
set repl_id $spawn_id
|
||||
|
||||
proc make_a_goddamn_string { stringliststring } {
|
||||
return [join $stringliststring " "]
|
||||
}
|
||||
|
||||
proc dagfs_ingest { args } {
|
||||
global repl_id
|
||||
|
||||
set paths [make_a_goddamn_string $args]
|
||||
|
||||
# convert quoted paths to the path type, apply ingest to the result
|
||||
send -i $repl_id "(ingest $paths)\n"
|
||||
|
||||
expect -i $repl_id "\n"
|
||||
expect -i $repl_id "\n"
|
||||
set cid [lindex [regexp -inline {[a-f0-9]*} $expect_out(buffer)] 0]
|
||||
puts "cid is $cid"
|
||||
return $cid
|
||||
}
|
||||
|
||||
proc dagfs_ingest_string { name string } {
|
||||
global repl_id
|
||||
|
||||
set path [file normalize $name]
|
||||
set fd [open $path "WRONLY CREAT TRUNC"]
|
||||
puts $fd $string
|
||||
close $fd
|
||||
|
||||
# convert quoted paths to the path type, apply ingest to the result
|
||||
send -i $repl_id "(ingest $path)\n"
|
||||
|
||||
expect -i $repl_id "\n"
|
||||
expect -i $repl_id "\n"
|
||||
set cid [lindex [regexp -inline {[a-f0-9]*} $expect_out(buffer)] 0]
|
||||
file delete $path
|
||||
return $cid
|
||||
|
||||
}
|
||||
|
||||
proc dagfs_copy { cid from to } {
|
||||
global repl_id
|
||||
|
||||
send -i $repl_id "(copy $cid \"$from\" \"$to\")\n"
|
||||
|
||||
expect -i $repl_id "\n"
|
||||
expect -i $repl_id "\n"
|
||||
set cid [lindex [regexp -inline {[a-f0-9]*} $expect_out(buffer)] 0]
|
||||
return $cid
|
||||
}
|
||||
|
||||
proc dagfs_merge { args } {
|
||||
global repl_id
|
||||
|
||||
set cids [make_a_goddamn_string $args]
|
||||
|
||||
send -i $repl_id "(merge $cids)\n"
|
||||
|
||||
expect -i $repl_id "\n"
|
||||
expect -i $repl_id "\n"
|
||||
set cid [lindex [regexp -inline {[a-f0-9]*} $expect_out(buffer)] 0]
|
||||
return $cid
|
||||
}
|
||||
|
||||
proc dagfs_cid_from_depot { args } {
|
||||
set cids {}
|
||||
|
||||
set archives [_collect_from_depot [join $args " "]]
|
||||
|
||||
check_for_missing_depot_archives
|
||||
|
||||
set globs ""
|
||||
|
||||
foreach archive $archives {
|
||||
# Do not include sources for now
|
||||
if {[regexp [_depot_archive_versioned_path_pattern] $archive dummy user type]} {
|
||||
if {$type == "src"} continue;
|
||||
if {$type == "api"} continue;
|
||||
if {$type == "pkg"} continue;
|
||||
}
|
||||
|
||||
set globs "$globs \"[depot_dir]/$archive/*\""
|
||||
}
|
||||
|
||||
global repl_id
|
||||
|
||||
send -i $repl_id "(apply ingest (glob $globs))\n"
|
||||
|
||||
expect -i $repl_id "\n"
|
||||
expect -i $repl_id "\n"
|
||||
|
||||
set cid [lindex [regexp -inline {[a-f0-9]*} $expect_out(buffer)] 0]
|
||||
|
||||
return $cid
|
||||
}
|
281
run/dagfs.run
281
run/dagfs.run
|
@ -1,281 +0,0 @@
|
|||
|
||||
proc depot_user {} { return genodelabs }
|
||||
|
||||
create_boot_directory
|
||||
|
||||
source ${genode_dir}/repos/base/run/platform_drv.inc
|
||||
|
||||
set ip_stack "lwip"
|
||||
|
||||
#
|
||||
# Download test PDF file
|
||||
#
|
||||
if {![file exist bin/test.pdf]} {
|
||||
set pdf_url "http://genode.org/documentation/genode-foundations-17-05.pdf"
|
||||
catch { exec wget $pdf_url -O bin/test.pdf }
|
||||
}
|
||||
|
||||
|
||||
source /home/repo/dagfs/genode/run/dagfs.inc
|
||||
|
||||
proc pdf_config {} {
|
||||
return {
|
||||
<config>
|
||||
<parent-provides>
|
||||
<service name="CPU"/>
|
||||
<service name="LOG"/>
|
||||
<service name="PD"/>
|
||||
<service name="RM"/>
|
||||
<service name="ROM"/>
|
||||
<service name="File_system"/>
|
||||
<service name="Nitpicker"/>
|
||||
<service name="Timer"/>
|
||||
</parent-provides>
|
||||
<default-route>
|
||||
<any-service> <parent/> </any-service>
|
||||
</default-route>
|
||||
<start name="pdf_view" caps="256">
|
||||
<resource name="RAM" quantum="1G"/>
|
||||
<config>
|
||||
<vfs>
|
||||
<fs writeable="no"/>
|
||||
<dir name="dev"> <log/> </dir>
|
||||
</vfs>
|
||||
<libc stdout="/dev/log" stderr="/dev/log"/>
|
||||
</config>
|
||||
</start>
|
||||
</config>
|
||||
}
|
||||
}
|
||||
|
||||
proc pdf_config_cid {} {
|
||||
set configfile [run_dir]/config
|
||||
set fh [open $configfile "WRONLY CREAT TRUNC"]
|
||||
puts $fh [pdf_config]
|
||||
close $fh
|
||||
return [dagfs_ingest $configfile]
|
||||
}
|
||||
|
||||
set viewer_cid [dagfs_cid_from_depot \
|
||||
[depot_user]/src/init \
|
||||
[depot_user]/pkg/pdf_view \
|
||||
]
|
||||
|
||||
set pdf_cid [dagfs_ingest bin/test.pdf]
|
||||
|
||||
set root_cid [dagfs_merge $viewer_cid [pdf_config_cid] $pdf_cid]
|
||||
|
||||
if {$root_cid == ""} {
|
||||
exit -1
|
||||
}
|
||||
|
||||
puts "root_cid is $root_cid"
|
||||
|
||||
append build_components {
|
||||
drivers/nic
|
||||
}
|
||||
|
||||
build $build_components
|
||||
|
||||
set fb_drv "fb_drv"
|
||||
|
||||
if {[have_include "image/uefi"]} {
|
||||
set fb_drv "fb_boot_drv"
|
||||
}
|
||||
|
||||
import_from_depot \
|
||||
[depot_user]/pkg/[drivers_interactive_pkg] \
|
||||
[depot_user]/pkg/wm \
|
||||
[depot_user]/src/[base_src] \
|
||||
[depot_user]/src/init \
|
||||
[depot_user]/src/libc \
|
||||
[depot_user]/src/nitpicker \
|
||||
[depot_user]/src/vfs \
|
||||
[depot_user]/src/vfs_lwip \
|
||||
|
||||
append config {
|
||||
<config prio_levels="2">
|
||||
<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>
|
||||
<default caps="100"/>
|
||||
|
||||
<start name="timer">
|
||||
<resource name="RAM" quantum="1M"/>
|
||||
<provides><service name="Timer"/></provides>
|
||||
</start>}
|
||||
|
||||
append_platform_drv_config
|
||||
|
||||
append_if [have_spec framebuffer] config {
|
||||
<start name="} $fb_drv {" caps="200">
|
||||
<resource name="RAM" quantum="32M"/>
|
||||
<provides><service name="Framebuffer"/></provides>
|
||||
</start>}
|
||||
|
||||
append_if [have_spec ps2] config {
|
||||
<start name="ps2_drv">
|
||||
<resource name="RAM" quantum="2M"/>
|
||||
<provides><service name="Input"/></provides>
|
||||
</start>
|
||||
<alias name="input_drv" child="ps2_drv"/>}
|
||||
|
||||
append_if [have_spec sdl] config {
|
||||
<start name="fb_sdl" ld="no">
|
||||
<resource name="RAM" quantum="4M"/>
|
||||
<provides> <service name="Input"/> <service name="Framebuffer"/> </provides>
|
||||
</start>
|
||||
<alias name="input_drv" child="fb_sdl"/>}
|
||||
|
||||
append config {
|
||||
|
||||
<start name="nic_drv" caps="120" ld="no">
|
||||
<binary name="} [nic_drv_binary] {"/>
|
||||
<resource name="RAM" quantum="8M"/>
|
||||
<provides><service name="Nic"/></provides>
|
||||
</start>
|
||||
|
||||
<start name="dagfs_fs_store" caps="512">
|
||||
<resource name="RAM" quantum="32M"/>
|
||||
<provides> <service name="Ipld"/> </provides>
|
||||
<config>
|
||||
<libc stderr="/log"/>
|
||||
<vfs>
|
||||
<log/>
|
||||
<ram/>
|
||||
</vfs>
|
||||
</config>
|
||||
<route>
|
||||
<any-service> <parent/> <any-child/> </any-service>
|
||||
</route>
|
||||
</start>
|
||||
|
||||
<start name="godagfs_proxy" caps="512">
|
||||
<resource name="RAM" quantum="32M"/>
|
||||
<provides> <service name="Ipld"/> </provides>
|
||||
<config dagfs_url="http://10.0.2.1:5001">
|
||||
<libc stdout="/log" stderr="/log" socket="/socket"/>
|
||||
<vfs>
|
||||
<log/>
|
||||
<dir name="socket"> <lwip ip_addr="10.0.2.55" netmask="255.255.255.0" gateway="10.0.2.1"/> </dir>
|
||||
</vfs>
|
||||
</config>
|
||||
<route>
|
||||
<service name="Nic"> <child name="nic_drv"/> </service>
|
||||
<any-service> <parent/> <any-child/> </any-service>
|
||||
</route>
|
||||
</start>
|
||||
|
||||
<start name="ipld_store" caps="512">
|
||||
<binary name="ipld_replicate"/>
|
||||
<resource name="RAM" quantum="16M"/>
|
||||
<provides> <service name="Ipld"/> </provides>
|
||||
<route>
|
||||
<service name="Ipld" label="from"> <child name="godagfs_proxy"/> </service>
|
||||
<service name="Ipld" label="to"> <child name="ipld_fs_store"/> </service>
|
||||
<any-service> <parent/> <any-child/> </any-service>
|
||||
</route>
|
||||
</start>
|
||||
|
||||
<start name="dagfs_rom">
|
||||
<resource name="RAM" quantum="32M"/>
|
||||
<provides><service name="ROM"/></provides>
|
||||
<config>
|
||||
<libc stdout="/log" stderr="/log"/>
|
||||
<vfs>
|
||||
<log/>
|
||||
</vfs>
|
||||
<default-policy/>
|
||||
</config>
|
||||
<route>
|
||||
<service name="Ipld"> <child name="ipld_store"/> </service>
|
||||
<any-service> <parent/> <any-child/> </any-service>
|
||||
</route>
|
||||
</start>
|
||||
|
||||
<start name="dagfs_fs">
|
||||
<resource name="RAM" quantum="32M"/>
|
||||
<provides><service name="File_system"/></provides>
|
||||
<config>
|
||||
<libc stdout="/log" stderr="/log"/>
|
||||
<vfs>
|
||||
<log/>
|
||||
</vfs>
|
||||
<default-policy/>
|
||||
</config>
|
||||
<route>
|
||||
<service name="Ipld"> <child name="ipld_store"/> </service>
|
||||
<any-service> <parent/> <any-child/> </any-service>
|
||||
</route>
|
||||
</start>
|
||||
|
||||
<start name="nitpicker">
|
||||
<resource name="RAM" quantum="4M"/>
|
||||
<provides><service name="Nitpicker"/></provides>
|
||||
<config focus="rom">
|
||||
<domain name="pointer" layer="1" content="client" label="no" origin="pointer" />
|
||||
<domain name="default" layer="2" content="client" label="no" hover="always"/>
|
||||
|
||||
<policy label_prefix="pointer" domain="pointer"/>
|
||||
<default-policy domain="default"/>
|
||||
</config>
|
||||
</start>
|
||||
|
||||
<start name="pointer">
|
||||
<resource name="RAM" quantum="1M"/>
|
||||
<route>
|
||||
<service name="Nitpicker"> <child name="nitpicker"/> </service>
|
||||
<any-service> <parent/> <any-child/> </any-service>
|
||||
</route>
|
||||
</start>
|
||||
|
||||
<start name="} $root_cid {" caps="1024">
|
||||
<binary name="init"/>
|
||||
<resource name="RAM" quantum="64M"/>
|
||||
<route>
|
||||
<service name="ROM" unscoped_label="ld.lib.so">
|
||||
<parent/> </service>
|
||||
<service name="ROM" label_suffix="ld.lib.so">
|
||||
<parent/> </service>
|
||||
<service name="ROM" unscoped_label="init">
|
||||
<parent/> </service>
|
||||
<service name="ROM" unscoped_label="config">
|
||||
<child name="dagfs_rom"/> </service>
|
||||
<service name="ROM">
|
||||
<child name="dagfs_rom"/> </service>
|
||||
<service name="File_system">
|
||||
<child name="dagfs_fs"/> </service>
|
||||
<service name="Nitpicker">
|
||||
<child name="nitpicker" label="pdf"/> </service>
|
||||
<any-service>
|
||||
<parent/> <any-child/>
|
||||
</any-service>
|
||||
</route>
|
||||
</start>
|
||||
</config>
|
||||
}
|
||||
|
||||
install_config $config
|
||||
|
||||
set fd [open [run_dir]/genode/focus w]
|
||||
puts $fd "<focus label=\"pdf\"/>"
|
||||
close $fd
|
||||
|
||||
append boot_modules {
|
||||
dagfs_rom
|
||||
dagfs_fs
|
||||
} [nic_drv_binary] { }
|
||||
|
||||
build_boot_image $boot_modules
|
||||
|
||||
run_genode_until forever
|
288
run/ipfs_fs.run
288
run/ipfs_fs.run
|
@ -1,288 +0,0 @@
|
|||
|
||||
puts "\nTesting connection to local IPFS daemon...\n"
|
||||
exec curl http://127.0.0.1:5001/version >& /dev/null
|
||||
# If this fails it will crash the script and print an ugly message.
|
||||
# The code to handle this condition is just as ugly.
|
||||
|
||||
proc depot_user {} { return ehmry }
|
||||
|
||||
create_boot_directory
|
||||
|
||||
source ${genode_dir}/repos/base/run/platform_drv.inc
|
||||
|
||||
set ip_stack "lwip"
|
||||
|
||||
#
|
||||
# Download test PDF file
|
||||
#
|
||||
if {![file exist bin/test.pdf]} {
|
||||
set pdf_url "http://genode.org/documentation/genode-foundations-17-05.pdf"
|
||||
catch { exec wget $pdf_url -O bin/test.pdf }
|
||||
}
|
||||
|
||||
|
||||
source ${genode_dir}/repos/ipfs/run/ipfs.inc
|
||||
|
||||
proc pdf_config {} {
|
||||
return {
|
||||
<config>
|
||||
<parent-provides>
|
||||
<service name="CPU"/>
|
||||
<service name="LOG"/>
|
||||
<service name="PD"/>
|
||||
<service name="RM"/>
|
||||
<service name="ROM"/>
|
||||
<service name="File_system"/>
|
||||
<service name="Nitpicker"/>
|
||||
<service name="Timer"/>
|
||||
</parent-provides>
|
||||
<default-route>
|
||||
<any-service> <parent/> </any-service>
|
||||
</default-route>
|
||||
<start name="pdf_view" caps="256">
|
||||
<resource name="RAM" quantum="1G"/>
|
||||
<config>
|
||||
<vfs>
|
||||
<fs writeable="no"/>
|
||||
<dir name="dev"> <log/> </dir>
|
||||
</vfs>
|
||||
<libc stdout="/dev/log" stderr="/dev/log"/>
|
||||
</config>
|
||||
</start>
|
||||
</config>
|
||||
}
|
||||
}
|
||||
|
||||
proc pdf_config_cid {} {
|
||||
set configfile [run_dir]/config
|
||||
set fh [open $configfile "WRONLY CREAT TRUNC"]
|
||||
puts $fh [pdf_config]
|
||||
close $fh
|
||||
return [ipfs_ingest $configfile]
|
||||
}
|
||||
|
||||
set viewer_cid [ipfs_cid_from_depot \
|
||||
[depot_user]/src/init \
|
||||
[depot_user]/pkg/pdf_view \
|
||||
]
|
||||
|
||||
set pdf_cid [ipfs_ingest bin/test.pdf]
|
||||
|
||||
set root_cid [ipfs_merge $viewer_cid [pdf_config_cid] $pdf_cid]
|
||||
|
||||
if {$root_cid == ""} {
|
||||
exit -1
|
||||
}
|
||||
|
||||
puts "root_cid is $root_cid"
|
||||
|
||||
append build_components {
|
||||
drivers/nic
|
||||
}
|
||||
|
||||
build $build_components
|
||||
|
||||
set fb_drv "fb_drv"
|
||||
|
||||
if {[have_include "image/uefi"]} {
|
||||
set fb_drv "fb_boot_drv"
|
||||
}
|
||||
|
||||
import_from_depot \
|
||||
[depot_user]/pkg/[drivers_interactive_pkg] \
|
||||
[depot_user]/pkg/wm \
|
||||
[depot_user]/src/[base_src] \
|
||||
[depot_user]/src/goipfs_proxy \
|
||||
[depot_user]/src/init \
|
||||
[depot_user]/src/ipfs_fs \
|
||||
[depot_user]/src/ipfs_rom \
|
||||
[depot_user]/src/ipld_fs_store \
|
||||
[depot_user]/src/ipld_replicate \
|
||||
[depot_user]/src/libc \
|
||||
[depot_user]/src/nitpicker \
|
||||
[depot_user]/src/vfs \
|
||||
[depot_user]/src/vfs_lwip \
|
||||
|
||||
append config {
|
||||
<config prio_levels="2">
|
||||
<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>
|
||||
<default caps="100"/>
|
||||
|
||||
<start name="timer">
|
||||
<resource name="RAM" quantum="1M"/>
|
||||
<provides><service name="Timer"/></provides>
|
||||
</start>}
|
||||
|
||||
append_platform_drv_config
|
||||
|
||||
append_if [have_spec framebuffer] config {
|
||||
<start name="} $fb_drv {" caps="200">
|
||||
<resource name="RAM" quantum="32M"/>
|
||||
<provides><service name="Framebuffer"/></provides>
|
||||
</start>}
|
||||
|
||||
append_if [have_spec ps2] config {
|
||||
<start name="ps2_drv">
|
||||
<resource name="RAM" quantum="2M"/>
|
||||
<provides><service name="Input"/></provides>
|
||||
</start>
|
||||
<alias name="input_drv" child="ps2_drv"/>}
|
||||
|
||||
append_if [have_spec sdl] config {
|
||||
<start name="fb_sdl" ld="no">
|
||||
<resource name="RAM" quantum="4M"/>
|
||||
<provides> <service name="Input"/> <service name="Framebuffer"/> </provides>
|
||||
</start>
|
||||
<alias name="input_drv" child="fb_sdl"/>}
|
||||
|
||||
append config {
|
||||
|
||||
<start name="nic_drv" caps="120" ld="no">
|
||||
<binary name="} [nic_drv_binary] {"/>
|
||||
<resource name="RAM" quantum="8M"/>
|
||||
<provides><service name="Nic"/></provides>
|
||||
</start>
|
||||
|
||||
<start name="ipld_fs_store" caps="512">
|
||||
<resource name="RAM" quantum="32M"/>
|
||||
<provides> <service name="Ipld"/> </provides>
|
||||
<config>
|
||||
<libc stderr="/log"/>
|
||||
<vfs>
|
||||
<log/>
|
||||
<ram/>
|
||||
</vfs>
|
||||
</config>
|
||||
<route>
|
||||
<any-service> <parent/> <any-child/> </any-service>
|
||||
</route>
|
||||
</start>
|
||||
|
||||
<start name="goipfs_proxy" caps="512">
|
||||
<resource name="RAM" quantum="32M"/>
|
||||
<provides> <service name="Ipld"/> </provides>
|
||||
<config ipfs_url="http://10.0.2.1:5001">
|
||||
<libc stdout="/log" stderr="/log" socket="/socket"/>
|
||||
<vfs>
|
||||
<log/>
|
||||
<dir name="socket"> <lwip ip_addr="10.0.2.55" netmask="255.255.255.0" gateway="10.0.2.1"/> </dir>
|
||||
</vfs>
|
||||
</config>
|
||||
<route>
|
||||
<service name="Nic"> <child name="nic_drv"/> </service>
|
||||
<any-service> <parent/> <any-child/> </any-service>
|
||||
</route>
|
||||
</start>
|
||||
|
||||
<start name="ipld_store" caps="512">
|
||||
<binary name="ipld_replicate"/>
|
||||
<resource name="RAM" quantum="16M"/>
|
||||
<provides> <service name="Ipld"/> </provides>
|
||||
<route>
|
||||
<service name="Ipld" label="from"> <child name="goipfs_proxy"/> </service>
|
||||
<service name="Ipld" label="to"> <child name="ipld_fs_store"/> </service>
|
||||
<any-service> <parent/> <any-child/> </any-service>
|
||||
</route>
|
||||
</start>
|
||||
|
||||
<start name="ipfs_rom">
|
||||
<resource name="RAM" quantum="32M"/>
|
||||
<provides><service name="ROM"/></provides>
|
||||
<config>
|
||||
<libc stdout="/log" stderr="/log"/>
|
||||
<vfs>
|
||||
<log/>
|
||||
</vfs>
|
||||
<default-policy/>
|
||||
</config>
|
||||
<route>
|
||||
<service name="Ipld"> <child name="ipld_store"/> </service>
|
||||
<any-service> <parent/> <any-child/> </any-service>
|
||||
</route>
|
||||
</start>
|
||||
|
||||
<start name="ipfs_fs">
|
||||
<resource name="RAM" quantum="32M"/>
|
||||
<provides><service name="File_system"/></provides>
|
||||
<config>
|
||||
<libc stdout="/log" stderr="/log"/>
|
||||
<vfs>
|
||||
<log/>
|
||||
</vfs>
|
||||
<default-policy/>
|
||||
</config>
|
||||
<route>
|
||||
<service name="Ipld"> <child name="ipld_store"/> </service>
|
||||
<any-service> <parent/> <any-child/> </any-service>
|
||||
</route>
|
||||
</start>
|
||||
|
||||
<start name="nitpicker">
|
||||
<resource name="RAM" quantum="4M"/>
|
||||
<provides><service name="Nitpicker"/></provides>
|
||||
<config focus="rom">
|
||||
<domain name="pointer" layer="1" content="client" label="no" origin="pointer" />
|
||||
<domain name="default" layer="2" content="client" label="no" hover="always"/>
|
||||
|
||||
<policy label_prefix="pointer" domain="pointer"/>
|
||||
<default-policy domain="default"/>
|
||||
</config>
|
||||
</start>
|
||||
|
||||
<start name="pointer">
|
||||
<resource name="RAM" quantum="1M"/>
|
||||
<route>
|
||||
<service name="Nitpicker"> <child name="nitpicker"/> </service>
|
||||
<any-service> <parent/> <any-child/> </any-service>
|
||||
</route>
|
||||
</start>
|
||||
|
||||
<start name="} $root_cid {" caps="1024">
|
||||
<binary name="init"/>
|
||||
<resource name="RAM" quantum="64M"/>
|
||||
<route>
|
||||
<service name="ROM" unscoped_label="ld.lib.so">
|
||||
<parent/> </service>
|
||||
<service name="ROM" label_suffix="ld.lib.so">
|
||||
<parent/> </service>
|
||||
<service name="ROM" unscoped_label="init">
|
||||
<parent/> </service>
|
||||
<service name="ROM" unscoped_label="config">
|
||||
<child name="ipfs_rom"/> </service>
|
||||
<service name="ROM">
|
||||
<child name="ipfs_rom"/> </service>
|
||||
<service name="File_system">
|
||||
<child name="ipfs_fs"/> </service>
|
||||
<service name="Nitpicker">
|
||||
<child name="nitpicker" label="pdf"/> </service>
|
||||
<any-service>
|
||||
<parent/> <any-child/>
|
||||
</any-service>
|
||||
</route>
|
||||
</start>
|
||||
</config>
|
||||
}
|
||||
|
||||
install_config $config
|
||||
|
||||
set fd [open [run_dir]/genode/focus w]
|
||||
puts $fd "<focus label=\"pdf\"/>"
|
||||
close $fd
|
||||
|
||||
append boot_modules { } [nic_drv_binary] { }
|
||||
|
||||
build_boot_image $boot_modules
|
||||
|
||||
run_genode_until forever
|
|
@ -1,30 +0,0 @@
|
|||
source ${genode_dir}/repos/ipld/run/ipfs.inc
|
||||
|
||||
if { [info exists ::env(AUDIO_FILE) ] } {
|
||||
set audio_file $::env(AUDIO_FILE) }
|
||||
|
||||
set player_cid [ipfs_copy [ipfs_cid_from_depot genodelabs/pkg/audio_player] audio_player init]
|
||||
|
||||
set audio_file_name [file tail $audio_file]
|
||||
set audio_file_cid [ipfs_ingest "\"$audio_file\""]
|
||||
|
||||
set playlist "<playlist><track path=\"/$audio_file_name\"/></playlist>"
|
||||
|
||||
set playlist_cid [ipfs_ingest_string "playlist" $playlist]
|
||||
|
||||
set player_config {
|
||||
<config ld_verbose="yes" state="playing">
|
||||
<report progress="no" playlist="yes"/>
|
||||
<vfs>
|
||||
<dir name="dev"> <log/> </dir>
|
||||
<fs/>
|
||||
</vfs>
|
||||
<libc stdout="/dev/log" stderr="/dev/log"/>
|
||||
</config>
|
||||
}
|
||||
|
||||
set player_config_cid [ipfs_ingest_string "config" $player_config]
|
||||
|
||||
set root_cid [ipfs_merge $audio_file_cid $playlist_cid $player_cid $player_config_cid]
|
||||
|
||||
puts "\n final root: $root_cid"
|
|
@ -1,152 +0,0 @@
|
|||
# Procedures for generating PDF viewing subsystems
|
||||
source ${genode_dir}/repos/ipld/run/pdf.inc
|
||||
|
||||
create_boot_directory
|
||||
|
||||
set coreutils_cid [ipld_public_untar_depot genodelabs/src/coreutils]
|
||||
|
||||
puts "coreutils: $coreutils_cid"
|
||||
|
||||
set noux_cid [ipld_public_cid_from_depot genodelabs/pkg/noux genodelabs/src/coreutils]
|
||||
|
||||
set merged_cid [ipld_public_merge $coreutils_cid $noux_cid]
|
||||
|
||||
set store_paths [ipld_public_dump $merged_cid]
|
||||
|
||||
exec sh -c "tar cf [store_tarball_path] -C [public_store_dir] $store_paths"
|
||||
|
||||
file delete [store_tarball_link]
|
||||
file link -symbolic [store_tarball_link] [store_tarball_path]
|
||||
|
||||
###
|
||||
|
||||
create_boot_directory
|
||||
|
||||
#
|
||||
# To use the themed decorator instead of the default one, replace 'pkg/wm'
|
||||
# with 'pkg/themed_wm'.
|
||||
#
|
||||
|
||||
import_from_depot genodelabs/src/[base_src] \
|
||||
genodelabs/src/init \
|
||||
genodelabs/src/noux \
|
||||
|
||||
append build_components {
|
||||
core init
|
||||
server/ipld_fs_store
|
||||
server/ipld_rom
|
||||
server/ipld_fs
|
||||
noux
|
||||
}
|
||||
|
||||
build $build_components
|
||||
|
||||
append config {
|
||||
<config prio_levels="2">
|
||||
<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>
|
||||
<default caps="100"/>
|
||||
|
||||
<start name="timer">
|
||||
<resource name="RAM" quantum="1M"/>
|
||||
<provides><service name="Timer"/></provides>
|
||||
</start>
|
||||
|
||||
<start name="ipld_store">
|
||||
<binary name="ipld_fs_store"/>
|
||||
<resource name="RAM" quantum="12M"/>
|
||||
<provides> <service name="Ipld"/> </provides>
|
||||
<config>
|
||||
<libc stdout="/log" stderr="/log"/>
|
||||
<vfs> <log/> <tar name="} [store_tarball] {"/> </vfs>
|
||||
</config>
|
||||
<route>
|
||||
<any-service> <parent/> <any-child/> </any-service>
|
||||
</route>
|
||||
</start>
|
||||
|
||||
<start name="ipld_rom">
|
||||
<resource name="RAM" quantum="32M"/>
|
||||
<provides><service name="ROM"/></provides>
|
||||
<config>
|
||||
<libc stdout="/log" stderr="/log"/>
|
||||
<vfs>
|
||||
<log/>
|
||||
</vfs>
|
||||
<default-policy root="}
|
||||
append config $merged_cid
|
||||
append config {"/>
|
||||
</config>
|
||||
<route>
|
||||
<service name="Ipld"> <child name="ipld_store"/> </service>
|
||||
<any-service> <parent/> <any-child/> </any-service>
|
||||
</route>
|
||||
</start>
|
||||
|
||||
<start name="ipld_fs">
|
||||
<resource name="RAM" quantum="32M"/>
|
||||
<provides><service name="File_system"/></provides>
|
||||
<config>
|
||||
<libc stdout="/log" stderr="/log"/>
|
||||
<vfs>
|
||||
<log/>
|
||||
</vfs>
|
||||
<default-policy root="}
|
||||
append config $merged_cid
|
||||
append config {"/>
|
||||
</config>
|
||||
<route>
|
||||
<service name="Ipld"> <child name="ipld_store"/> </service>
|
||||
<any-service> <parent/> <any-child/> </any-service>
|
||||
</route>
|
||||
</start>
|
||||
<start name="noux" caps="500">
|
||||
<resource name="RAM" quantum="16M"/>
|
||||
<config verbose="yes" stdin="/dev/null" stdout="/dev/log" stderr="/dev/log">
|
||||
<fstab>
|
||||
<tar name="coreutils.tar"/>
|
||||
<dir name="ipld"> <fs label="ipld"/> </dir>
|
||||
<dir name="dev"> <log/> <null/> </dir>
|
||||
</fstab>
|
||||
<start name="/bin/ls"> <arg value="-Rla"/> </start>
|
||||
</config>
|
||||
<route>
|
||||
<service name="ROM" unscoped_label="ld.lib.so">
|
||||
<parent/> </service>
|
||||
<service name="ROM" label_suffix="ld.lib.so">
|
||||
<parent/> </service>
|
||||
<service name="ROM" unscoped_label="noux">
|
||||
<parent/> </service>
|
||||
<service name="ROM">
|
||||
<child name="ipld_rom"/> </service>
|
||||
<any-service> <parent/> <any-child/> </any-service>
|
||||
</route>
|
||||
</start>
|
||||
</config>
|
||||
}
|
||||
|
||||
install_config $config
|
||||
|
||||
append boot_modules {
|
||||
core ld.lib.so init
|
||||
ipld_fs_store
|
||||
ipld_rom
|
||||
ipld_fs
|
||||
libc.lib.so
|
||||
noux
|
||||
} [store_tarball] { }
|
||||
|
||||
build_boot_image $boot_modules
|
||||
|
||||
run_genode_until {child "noux" exited with exit value 0.*\n} 30
|
79
run/pdf.inc
79
run/pdf.inc
|
@ -1,79 +0,0 @@
|
|||
#
|
||||
# \brief Procedures for creating PDF viewing packages in an IPLD store
|
||||
# \author Emery Hemingway
|
||||
# \date 2017-11-19
|
||||
#
|
||||
|
||||
source [genode_dir]/repos/ipld/run/ipld.inc
|
||||
|
||||
proc pdf_view_closure { pdf_path } {
|
||||
set public_cid [ipld_public_cid_from_depot \
|
||||
genodelabs/src/nit_fb \
|
||||
genodelabs/pkg/pdf_view \
|
||||
genodelabs/src/init \
|
||||
]
|
||||
|
||||
return $public_cid
|
||||
|
||||
foreach cid $public_cids {
|
||||
set paths [exec ipldstore [public_store_dir] dump $cid]
|
||||
#file copy $paths [run_store_dir]
|
||||
}
|
||||
|
||||
#set pdf_cid [ipld_run_store_add $pdf_path]
|
||||
#return $pdf_cid
|
||||
|
||||
return $public_cids
|
||||
}
|
||||
|
||||
proc pdf_config {} {
|
||||
return {
|
||||
<config>
|
||||
<parent-provides>
|
||||
<service name="CPU"/>
|
||||
<service name="LOG"/>
|
||||
<service name="PD"/>
|
||||
<service name="RM"/>
|
||||
<service name="ROM"/>
|
||||
<service name="File_system"/>
|
||||
<service name="Nitpicker"/>
|
||||
<service name="Timer"/>
|
||||
</parent-provides>
|
||||
<default-route>
|
||||
<any-service> <parent/> <any-child/> </any-service>
|
||||
</default-route>
|
||||
<start name="nit_fb" caps="128">
|
||||
<resource name="RAM" quantum="4M"/>
|
||||
<provides>
|
||||
<service name="Framebuffer"/>
|
||||
<service name="Input"/>
|
||||
</provides>
|
||||
</start>
|
||||
<start name="pdf_view" caps="256">
|
||||
<resource name="RAM" quantum="1G"/>
|
||||
<config>
|
||||
<vfs>
|
||||
<fs writeable="no"/>
|
||||
<dir name="dev"> <log/> </dir>
|
||||
</vfs>
|
||||
<libc stdout="/dev/log" stderr="/dev/log"/>
|
||||
</config>
|
||||
</start>
|
||||
</config>
|
||||
}
|
||||
}
|
||||
|
||||
proc pdf_config_cid {} {
|
||||
set configfile [run_dir]/config
|
||||
set fh [open $configfile "WRONLY CREAT TRUNC"]
|
||||
puts $fh [pdf_config]
|
||||
close $fh
|
||||
return [ipld_public_ingest $configfile]
|
||||
}
|
||||
|
||||
|
||||
proc pdf_content_cid { args } {
|
||||
set path [lindex $args 0]
|
||||
file copy $path [run_dir]/test.pdf
|
||||
return [ipld_public_ingest [run_dir]/test.pdf]
|
||||
}
|
Loading…
Reference in New Issue