Skip to content

Commit

Permalink
Release 1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
al1img authored Feb 5, 2025
2 parents 3e863b8 + 961ab4d commit 4bb5548
Show file tree
Hide file tree
Showing 173 changed files with 9,736 additions and 5,402 deletions.
23 changes: 15 additions & 8 deletions .github/workflows/build_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
jobs:
build:
runs-on: ubuntu-latest
container: zephyrprojectrtos/ci:latest
container: zephyrprojectrtos/ci:v0.26.14
env:
CMAKE_PREFIX_PATH: /opt/toolchains

Expand All @@ -26,6 +26,7 @@ jobs:
rcar_h3ulcb_ca57,
native_posix,
native_posix_64,
rpi_5,
]

steps:
Expand All @@ -37,6 +38,7 @@ jobs:
- name: Initialize
run: |
sudo apt update
pip install --upgrade protobuf==4.25.3
ln -ns /opt/protoc/include/google /usr/local/include
west init -l ./
west update
Expand All @@ -50,28 +52,33 @@ jobs:
touch src/prebuilt/rootca.pem
- name: Build ${{ matrix.platform }}
if: "!startsWith(matrix.platform, 'native')"
if: ${{ !startsWith(matrix.platform, 'native') && matrix.platform != 'rpi_5' }}
run: |
west build -b ${{ matrix.platform }} -p always -S xen_dom0
- name: Build ${{ matrix.platform }}
if: startsWith(matrix.platform, 'native')
if: ${{ matrix.platform == 'rpi_5' }}
run: |
west build -b ${{ matrix.platform }} -p always
- name: Build ${{ matrix.platform }}
if: ${{ startsWith(matrix.platform, 'native') }}
run: |
west build -b ${{ matrix.platform }} -p always
- name: Test ${{ matrix.platform }}
if: matrix.platform == 'native_posix'
if: ${{ matrix.platform == 'native_posix' }}
run: |
west twister -c -v -p ${{ matrix.platform }} -T tests
west twister -c -v -p ${{ matrix.platform }} -T tests -v
- name: Test ${{ matrix.platform }}
if: matrix.platform == 'native_posix_64'
if: ${{ matrix.platform == 'native_posix_64' }}
run: |
west twister -c -v -p ${{ matrix.platform }} --coverage --coverage-basedir src/ --coverage-tool gcovr -T tests
west twister -c -v -p ${{ matrix.platform }} --coverage --coverage-basedir src/ --coverage-tool gcovr -T tests -v
gcovr twister-out/${{ matrix.platform }}/ -f src/ --xml-pretty > ./coverage.xml
- name: Upload codecov report
if: startsWith(matrix.platform, 'native_posix_64')
if: ${{ startsWith(matrix.platform, 'native_posix_64') }}
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/static_analysis.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Static analysis
on:
push:
branches:
- main

pull_request:
branches:
- develop
- feature_*

jobs:
cpp-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Prepare
run: |
sudo apt install cppcheck -y
- name: Run cppcheck
run: |
cppcheck --enable=all --inline-suppr -I src --std=c++17 --error-exitcode=1 \
--suppressions-list=./suppressions.txt src
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
build/
.*/*\!.github
twister-out*
.vscode
49 changes: 38 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ set(AOS_CORE_CONFIG aoscoreconfig.hpp)
# Includes
# ######################################################################################################################

zephyr_include_directories(${CMAKE_CURRENT_BINARY_DIR} src)
zephyr_include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/proto src)
zephyr_include_directories_ifdef(CONFIG_NATIVE_APPLICATION mocks/include)

# ######################################################################################################################
Expand Down Expand Up @@ -75,22 +75,32 @@ target_sources(
PRIVATE src/main.cpp
src/app/app.cpp
src/clocksync/clocksync.cpp
src/communication/cmclient.cpp
src/communication/communication.cpp
src/communication/iamserver.cpp
src/communication/channelmanager.cpp
src/communication/tlschannel.cpp
src/communication/vchannel.cpp
src/communication/channel.cpp
src/communication/channelmanager.cpp
src/downloader/downloader.cpp
src/iamclient/iamclient.cpp
src/logger/logger.cpp
src/monitoring/resourceusageprovider.cpp
src/nodeinfoprovider/nodeinfoprovider.cpp
src/ocispec/ocispec.cpp
src/provisioning/provisioning.cpp
src/provisionmanager/provisionmanagercallback.cpp
src/resourcemanager/resourcemanager.cpp
src/runner/runner.cpp
src/smclient/openhandler.cpp
src/smclient/smclient.cpp
src/storage/storage.cpp
src/utils/checksum.cpp
src/utils/utils.cpp
)

# use pipe for native posix
target_sources_ifdef(CONFIG_NATIVE_APPLICATION app PRIVATE src/communication/socket.cpp)

# use xenvchan for xen
target_sources_ifndef(CONFIG_NATIVE_APPLICATION app PRIVATE src/communication/xenvchan.cpp)

# Enable vchannels and xrun mocks for native posix
target_sources_ifdef(CONFIG_NATIVE_APPLICATION app PRIVATE mocks/vch/vch.cpp mocks/xrun/xrun.cpp mocks/xstat/xstat.cpp)

Expand All @@ -108,6 +118,8 @@ target_sources_ifdef(CONFIG_DOMU_ENABLE app PRIVATE src/domains/domu/domu_cfg.c)

# Include HW-specific source file
target_sources_ifndef(CONFIG_NATIVE_APPLICATION app PRIVATE src/bsp/reboot.c src/bsp/mount.c)
target_sources_ifdef(CONFIG_FILE_SYSTEM_LITTLEFS app PRIVATE src/bsp/mount_littlefs.c)
target_sources_ifdef(CONFIG_FAT_FILESYSTEM_ELM app PRIVATE src/bsp/mount_fatfs.c)

# ######################################################################################################################
# Versioning
Expand Down Expand Up @@ -219,8 +231,8 @@ ExternalProject_Add(
-DCMAKE_CXX_FLAGS=${aos_cxx_flags}
-DWITH_MBEDTLS=OFF
SOURCE_DIR ${aoscore_source_dir}
BUILD_BYPRODUCTS ${aoscore_build_dir}/lib/libaossmcpp.a ${aoscore_build_dir}/lib/libaosiamcpp.a
${aoscore_build_dir}/lib/libaoscommoncpp.a
BUILD_BYPRODUCTS ${aoscore_build_dir}/lib/libaossm.a ${aoscore_build_dir}/lib/libaosiam.a
${aoscore_build_dir}/lib/libaoscommon.a
DEPENDS zephyr_interface
)

Expand All @@ -232,7 +244,7 @@ add_library(aossm STATIC IMPORTED GLOBAL)

add_dependencies(aossm aoscore)

set_target_properties(aossm PROPERTIES IMPORTED_LOCATION ${aoscore_build_dir}/lib/libaossmcpp.a)
set_target_properties(aossm PROPERTIES IMPORTED_LOCATION ${aoscore_build_dir}/lib/libaossm.a)
set_target_properties(aossm PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${aoscore_build_dir}/include)

target_link_libraries(app PUBLIC aossm)
Expand All @@ -243,7 +255,7 @@ add_library(aosiam STATIC IMPORTED GLOBAL)

add_dependencies(aosiam aoscore)

set_target_properties(aosiam PROPERTIES IMPORTED_LOCATION ${aoscore_build_dir}/lib/libaosiamcpp.a)
set_target_properties(aosiam PROPERTIES IMPORTED_LOCATION ${aoscore_build_dir}/lib/libaosiam.a)
set_target_properties(aosiam PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${aoscore_build_dir}/include)

target_link_libraries(app PUBLIC aosiam)
Expand All @@ -254,7 +266,22 @@ add_library(aoscommon STATIC IMPORTED GLOBAL)

add_dependencies(aoscommon aoscore)

set_target_properties(aoscommon PROPERTIES IMPORTED_LOCATION ${aoscore_build_dir}/lib/libaoscommoncpp.a)
set_target_properties(aoscommon PROPERTIES IMPORTED_LOCATION ${aoscore_build_dir}/lib/libaoscommon.a)
set_target_properties(aoscommon PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${aoscore_build_dir}/include)

target_link_libraries(app PUBLIC aoscommon)

# ######################################################################################################################
# Prepare softhsm2 config
# ######################################################################################################################

if(CONFIG_NATIVE_APPLICATION)
set(tokendir ${CONFIG_AOS_HSM_DIR})

if(NOT IS_ABSOLUTE ${tokendir})
set(tokendir ${CMAKE_CURRENT_BINARY_DIR}/${tokendir})
endif()

file(COPY misc/softhsm2.conf DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/softhsm)
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/softhsm/softhsm2.conf "directories.tokendir = ${tokendir}/\n")
endif()
134 changes: 88 additions & 46 deletions Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,65 +9,63 @@ config AOS_DOMD_ID
int "DomD id"
default 1

config AOS_VCHAN_OPEN_TX_PATH
string "Path to open TX vchan"
default "/local/domain/1/tmp/vchan/aos/open/tx"
config AOS_CHAN_TX_PATH
string "Path to TX channel"
depends on !NATIVE_APPLICATION
default "/local/domain/1/tmp/vchan/aos/tx"

config AOS_VCHAN_OPEN_RX_PATH
string "Path to open RX vchan"
default "/local/domain/1/tmp/vchan/aos/open/rx"

config AOS_VCHAN_SECURE_TX_PATH
string "Path to secure TX vchan"
default "/local/domain/1/tmp/vchan/aos/secure/tx"

config AOS_VCHAN_SECURE_RX_PATH
string "Path to secure RX vchan"
default "/local/domain/1/tmp/vchan/aos/secure/rx"
config AOS_CHAN_RX_PATH
string "Path to RX channel"
depends on !NATIVE_APPLICATION
default "/local/domain/1/tmp/vchan/aos/rx"

config AOS_REBOOT_XEN_STORE_PATH
string "Path to user reboot request"
default "/local/domain/1/data/user-reboot"

config AOS_DISK_MOUNT_POINT
string "Disk mount point"
default "/lfs"

config AOS_STORAGE_DIR
string "Path to the storage"
default "/aos/storage"
default "/lfs/aos/storage"

config AOS_RUNTIME_DIR
string "Aos runtime dir"
default "/tmp/aos/runtime"

config AOS_SERVICES_DIR
string "Aos services dir"
default "/aos/services"
default "/lfs/aos/services"

config AOS_UNIT_CONFIG_FILE
config AOS_NODE_CONFIG_FILE
string "Node configuration file path"
default "/aos/unit_config.cfg"
default "/lfs/aos/node_config.cfg"

config AOS_NODE_ID
string "Node id"
default "NODE_0"
config AOS_NODE_STATUS_FILE
string "Path to provisioning state file."
default "/lfs/aos/.nodestatus"

config AOS_NODE_TYPE
string "Node type"
default "NODE_TYPE1"
config AOS_NODE_ID_FILE
string "Path to node id file."
default "/lfs/aos/node-id"

config AOS_NUM_CPU
int "Count of CPUs for domain with Zephyr"
default 1
config AOS_PKCS11_MODULE_PIN_FILE
string "Path to PKCS11 module PIN file."
default "/lfs/aos/.pkcs11pin"

config AOS_TOTAL_RAM
int "Total RAM of the domain"
default 204800
config AOS_HSM_DIR
string "Path HSM tokens dir."
default "/lfs/tee"

config AOS_PARTITION_SIZE
int "Partition size"
default 209715200
config AOS_NODE_NAME
string "Node name"
default "zephyr"

config AOS_DISK_MOUNT_POINT
string "Disk mount point"
default "/aos"
config AOS_NODE_TYPE
string "Node type"
default "NODE_TYPE1"

config AOS_CLOCK_SYNC_SEND_PERIOD_SEC
int "Send clock sync period in seconds"
Expand All @@ -81,29 +79,62 @@ config AOS_CLOCK_SYNC_MAX_DIFF_MSEC
int "Maximum allowed difference between source and current time."
default 10000

config AOS_PROVISIONING_FILE
string "Path to provisioning file."
default "/aos/.provisioned"

config AOS_PKCS11_MODULE_PIN_FILE
string "Path to PKCS11 module PIN file."
default "/aos/.pkcs11pin"
config AOS_MAX_CPU_DMIPS
int "Maximum CPU DMIPS"
default 10000

config AOS_ROOT_CA_PATH
string "Path to Aos Root CA certificate. Required to build in root CA into app image."
default "prebuilt/rootca.pem"

config AOS_IAM_OPEN_PORT
int "Aos IAM open port"
default 1

config AOS_IAM_SECURE_PORT
int "Aos IAM secure port"
default 2

config AOS_SM_OPEN_PORT
int "Aos SM open port"
default 3

config AOS_SM_SECURE_PORT
int "Aos SM secure port"
default 4

config AOS_SOCKET_SERVER_ADDRESS
string "Aos socket server address"
depends on NATIVE_APPLICATION
default "10.0.0.100"

config AOS_SOCKET_SERVER_PORT
int "Aos socket server port"
depends on NATIVE_APPLICATION
default 30001

config AOS_PBHANDLER_THREAD_STACK_SIZE
int "Aos PB handler stack size"
default 32768

config AOS_LAUNCHER_THREAD_STACK_SIZE
int "Aos launcher stack size"
default 32768

config DOMD_ENABLE
bool "Enable Domain-D creation"
default y

config DOMD_UBOOT_PATH
string "Location for Domain-D IPL binary"
depends on DOMD_ENABLE
default "prebuilt/ipl.bin"

config DOMD_DTB_PATH
string "Location of Domain-D partial device-tree"
depends on DOMD_ENABLE
default "prebuilt/ipl.dtb"

config TA_DEPLOY_DIR
string "Location of optee TA's deploy dir"

config DOMU_ENABLE
bool "Enable Domain-U creation"

Expand All @@ -117,4 +148,15 @@ config DOMU_DTB_PATH
depends on DOMU_ENABLE
default "prebuilt/domu.dtb"

config TA_DEPLOY_DIR
string "Location of optee TA's deploy dir"

module = AOS_CORE
module-str = Aos core
source "subsys/logging/Kconfig.template.log_config"

module = AOS_CORE_RUNTIME
module-str = Aos core runtime
source "subsys/logging/Kconfig.template.log_config"

source "Kconfig"
Loading

0 comments on commit 4bb5548

Please sign in to comment.