Skip to content

Commit

Permalink
Build filtering-proxy with buildroot
Browse files Browse the repository at this point in the history
  • Loading branch information
kkrentz committed Nov 7, 2024
1 parent affefc1 commit 0702ab9
Show file tree
Hide file tree
Showing 8 changed files with 75 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ export KEYSTONE_RUNTIME ?= $(KEYSTONE)/runtime
export KEYSTONE_SDK ?= $(KEYSTONE)/sdk
export KEYSTONE_BOOTROM ?= $(KEYSTONE)/bootrom
export KEYSTONE_SM ?= $(KEYSTONE)/sm
export FILTERING_PROXY ?= $(FILTERING_PROXY_PATH)
export FILTERING_LIBCOAP ?= $(KEYSTONE)/sm/src/libcoap

export BUILDDIR ?= $(KEYSTONE)/build-$(KEYSTONE_PLATFORM)$(KEYSTONE_BITS)
export BUILDROOT_OVERLAYDIR ?= $(BUILDDIR)/overlay
Expand Down
2 changes: 2 additions & 0 deletions overlays/keystone/Config.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ source "$BR2_EXTERNAL_KEYSTONE_PATH/package/keystone-driver/Config.in"
source "$BR2_EXTERNAL_KEYSTONE_PATH/package/keystone-sdk/Config.in.host"
source "$BR2_EXTERNAL_KEYSTONE_PATH/package/keystone-runtime/Config.in"
source "$BR2_EXTERNAL_KEYSTONE_PATH/package/keystone-examples/Config.in"
source "$BR2_EXTERNAL_KEYSTONE_PATH/package/filtering-proxy/Config.in"
source "$BR2_EXTERNAL_KEYSTONE_PATH/package/filtering-libcoap/Config.in"
2 changes: 2 additions & 0 deletions overlays/keystone/configs/riscv32_generic_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,5 @@ BR2_PACKAGE_KEYSTONE_DRIVER=y
BR2_PACKAGE_HOST_KEYSTONE_SDK=y
BR2_PACKAGE_KEYSTONE_RUNTIME=y
BR2_PACKAGE_KEYSTONE_EXAMPLES=y
BR2_PACKAGE_FILTERING_PROXY=y
BR2_PACKAGE_FILTERING_LIBCOAP=y
2 changes: 2 additions & 0 deletions overlays/keystone/configs/riscv64_generic_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,5 @@ BR2_PACKAGE_KEYSTONE_DRIVER=y
BR2_PACKAGE_HOST_KEYSTONE_SDK=y
BR2_PACKAGE_KEYSTONE_RUNTIME=y
BR2_PACKAGE_KEYSTONE_EXAMPLES=y
BR2_PACKAGE_FILTERING_PROXY=y
BR2_PACKAGE_FILTERING_LIBCOAP=y
4 changes: 4 additions & 0 deletions overlays/keystone/package/filtering-libcoap/Config.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
config BR2_PACKAGE_FILTERING_LIBCOAP
bool "Filtering libcoap"
help
A version of libcoap tailored to the filtering-proxy
30 changes: 30 additions & 0 deletions overlays/keystone/package/filtering-libcoap/filtering-libcoap.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
################################################################################
#
# libcoap
#
################################################################################

ifeq ($(FILTERING_LIBCOAP),)
$(error FILTERING_LIBCOAP directory not defined)
else
include $(KEYSTONE)/mkutils/pkg-keystone.mk
endif

FILTERING_LIBCOAP_LICENSE = BSD-2-Clause
FILTERING_LIBCOAP_LICENSE_FILES = COPYING LICENSE
FILTERING_LIBCOAP_INSTALL_STAGING = YES
FILTERING_LIBCOAP_CONF_OPTS = \
-DCMAKE_INSTALL_PREFIX=/usr/local \
-DENABLE_DOCS=OFF \
-DENABLE_DTLS=OFF \
-DWITH_EPOLL=ON \
-DENABLE_EXAMPLES=OFF \
-DENABLE_TCP=OFF \
-DENABLE_OSCORE=OFF \
-DENABLE_OSCORE_NG=ON \
-DENABLE_RAP=ON \
-DENABLE_Q_BLOCK=OFF \
-DWITH_OBSERVE_PERSIST=OFF

$(eval $(keystone-package))
$(eval $(cmake-package))
6 changes: 6 additions & 0 deletions overlays/keystone/package/filtering-proxy/Config.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
config BR2_PACKAGE_FILTERING_PROXY
bool "Filtering Proxy"
depends on BR2_PACKAGE_HOST_KEYSTONE_SDK
depends on BR2_PACKAGE_KEYSTONE_RUNTIME
help
Privacy-preserving en-route filtering of OSCORE-NG traffic
27 changes: 27 additions & 0 deletions overlays/keystone/package/filtering-proxy/filtering-proxy.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
################################################################################
#
# Filtering proxy
#
################################################################################

ifeq ($(FILTERING_PROXY),)
$(error FILTERING_PROXY directory not defined)
else
include $(KEYSTONE)/mkutils/pkg-keystone.mk
endif

FILTERING_PROXY_DEPENDENCIES += host-keystone-sdk keystone-runtime filtering-libcoap
FILTERING_PROXY_CONF_OPTS += -DKEYSTONE_SDK_DIR=$(HOST_DIR)/usr/share/keystone/sdk \
-DKEYSTONE_EYRIE_RUNTIME=$(KEYSTONE_RUNTIME_BUILDDIR) \
-DLIBCOAP_INSTALL_PATH=$(TARGET_DIR)/usr/local
FILTERING_PROXY_MAKE_OPTS += filtering-proxy

# Install .ke file and overlay
define FILTERING_PROXY_INSTALL_TARGET_CMDS
find $(@D) -name '*.ke' | \
xargs -i{} $(INSTALL) -D -m 755 -t $(TARGET_DIR)/root/ {}
cp $(FILTERING_PROXY)/overlay/run.sh $(TARGET_DIR)/root/
endef

$(eval $(keystone-package))
$(eval $(cmake-package))

0 comments on commit 0702ab9

Please sign in to comment.