Blob service runtime package

This commit is contained in:
Ehmry - 2019-04-03 21:48:44 +02:00
parent 00f72b78e4
commit 957ac3e38c
2 changed files with 116 additions and 0 deletions

View File

@ -0,0 +1,12 @@
TARGET_NAME = blob_service
PKG_DEPENDS += \
@(SDK_USER)/src/libc/@(SDK_VERSION) \
@(SDK_USER)/src/vfs/@(SDK_VERSION) \
@(PUBLIC_SRC_CHROOT) \
@(PUBLIC_SRC_INIT) \
@(PUBLIC_SRC_VFS_LWIP) \
_/src/blobsets \
include_rules
include $(NIMBLE_PACKAGE_INCLUDE)

View File

@ -0,0 +1,104 @@
<runtime ram="32M" caps="768" binary="init">
<requires>
<file_system label="backend"/>
<nic/>
<rtc/>
</requires>
<provides> <file_system/> </provides>
<content>
<rom label="blobsets_fs"/>
<rom label="blobsets_http"/>
<rom label="chroot"/>
<rom label="init"/>
<rom label="libc.lib.so"/>
<rom label="libm.lib.so"/>
<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="ROM"/>
<service name="File_system"/>
<service name="Nic"/>
<service name="Rtc"/>
<service name="Timer"/>
</parent-provides>
<service name="File_system">
<policy label_suffix="backend">
<!-- read-only proxy to the backend -->
<child name="chroot"/>
</policy>
<default-policy>
<!-- otherwise use the synthetic file-system -->
<child name="blobsets_fs"/>
</default-policy>
</service>
<default-route>
<service name="File_system">
<child name="chroot"/> </service>
<any-service> <parent/> </any-service>
</default-route>
<start name="chroot" caps="80" priority="-1">
<!--
component for restricting backend
write access to blobsets_http
-->
<resource name="RAM" quantum="1M"/>
<provides> <service name="File_system"/> </provides>
<config>
<policy label_suffix="-> backend"
path="/" writeable="no"/>
<policy label="blobsets_http -> store"
path="/blobstore" writeable="yes"/>
<default-policy path="/blobstore" writeable="no"/>
</config>
<route>
<service name="File_system">
<parent label="backend"/> </service>
<any-service> <parent/> </any-service>
</route>
</start>
<start name="blobsets_http" caps="512">
<!-- HTTP upload and download service -->
<resource name="RAM" quantum="16M"/>
<config>
<libc stdout="/log" stderr="/log" rtc="/rtc" socket="/socket"/>
<vfs>
<log/> <rtc/>
<dir name="socket">
<lwip dhcp="yes"/> </dir>
<dir name="store">
<fs label="store"/> </dir>
</vfs>
</config>
</start>
<start name="blobsets_fs" caps="256">
<!-- provides synthetic file-system -->
<resource name="RAM" quantum="16M"/>
<provides> <service name="File_system"/> </provides>
<config>
<libc stdout="/log" stderr="/log" rtc="/rtc"/>
<vfs>
<log/> <rtc/>
<dir name="store">
<fs writeable="no"/> </dir>
</vfs>
<default-policy/>
</config>
</start>
</config>
</runtime>