Skip to content

Commit 4bb5548

Browse files
authored
Release 1.0.1
2 parents 3e863b8 + 961ab4d commit 4bb5548

File tree

173 files changed

+9736
-5402
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

173 files changed

+9736
-5402
lines changed

.github/workflows/build_test.yaml

+15-8
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ on:
1313
jobs:
1414
build:
1515
runs-on: ubuntu-latest
16-
container: zephyrprojectrtos/ci:latest
16+
container: zephyrprojectrtos/ci:v0.26.14
1717
env:
1818
CMAKE_PREFIX_PATH: /opt/toolchains
1919

@@ -26,6 +26,7 @@ jobs:
2626
rcar_h3ulcb_ca57,
2727
native_posix,
2828
native_posix_64,
29+
rpi_5,
2930
]
3031

3132
steps:
@@ -37,6 +38,7 @@ jobs:
3738
- name: Initialize
3839
run: |
3940
sudo apt update
41+
pip install --upgrade protobuf==4.25.3
4042
ln -ns /opt/protoc/include/google /usr/local/include
4143
west init -l ./
4244
west update
@@ -50,28 +52,33 @@ jobs:
5052
touch src/prebuilt/rootca.pem
5153
5254
- name: Build ${{ matrix.platform }}
53-
if: "!startsWith(matrix.platform, 'native')"
55+
if: ${{ !startsWith(matrix.platform, 'native') && matrix.platform != 'rpi_5' }}
5456
run: |
5557
west build -b ${{ matrix.platform }} -p always -S xen_dom0
5658
5759
- name: Build ${{ matrix.platform }}
58-
if: startsWith(matrix.platform, 'native')
60+
if: ${{ matrix.platform == 'rpi_5' }}
61+
run: |
62+
west build -b ${{ matrix.platform }} -p always
63+
64+
- name: Build ${{ matrix.platform }}
65+
if: ${{ startsWith(matrix.platform, 'native') }}
5966
run: |
6067
west build -b ${{ matrix.platform }} -p always
6168
6269
- name: Test ${{ matrix.platform }}
63-
if: matrix.platform == 'native_posix'
70+
if: ${{ matrix.platform == 'native_posix' }}
6471
run: |
65-
west twister -c -v -p ${{ matrix.platform }} -T tests
72+
west twister -c -v -p ${{ matrix.platform }} -T tests -v
6673
6774
- name: Test ${{ matrix.platform }}
68-
if: matrix.platform == 'native_posix_64'
75+
if: ${{ matrix.platform == 'native_posix_64' }}
6976
run: |
70-
west twister -c -v -p ${{ matrix.platform }} --coverage --coverage-basedir src/ --coverage-tool gcovr -T tests
77+
west twister -c -v -p ${{ matrix.platform }} --coverage --coverage-basedir src/ --coverage-tool gcovr -T tests -v
7178
gcovr twister-out/${{ matrix.platform }}/ -f src/ --xml-pretty > ./coverage.xml
7279
7380
- name: Upload codecov report
74-
if: startsWith(matrix.platform, 'native_posix_64')
81+
if: ${{ startsWith(matrix.platform, 'native_posix_64') }}
7582
uses: codecov/codecov-action@v3
7683
with:
7784
token: ${{ secrets.CODECOV_TOKEN }}
+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Static analysis
2+
on:
3+
push:
4+
branches:
5+
- main
6+
7+
pull_request:
8+
branches:
9+
- develop
10+
- feature_*
11+
12+
jobs:
13+
cpp-check:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
- name: Prepare
18+
run: |
19+
sudo apt install cppcheck -y
20+
21+
- name: Run cppcheck
22+
run: |
23+
cppcheck --enable=all --inline-suppr -I src --std=c++17 --error-exitcode=1 \
24+
--suppressions-list=./suppressions.txt src

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
build/
22
.*/*\!.github
33
twister-out*
4+
.vscode

CMakeLists.txt

+38-11
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ set(AOS_CORE_CONFIG aoscoreconfig.hpp)
2323
# Includes
2424
# ######################################################################################################################
2525

26-
zephyr_include_directories(${CMAKE_CURRENT_BINARY_DIR} src)
26+
zephyr_include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/proto src)
2727
zephyr_include_directories_ifdef(CONFIG_NATIVE_APPLICATION mocks/include)
2828

2929
# ######################################################################################################################
@@ -75,22 +75,32 @@ target_sources(
7575
PRIVATE src/main.cpp
7676
src/app/app.cpp
7777
src/clocksync/clocksync.cpp
78-
src/communication/cmclient.cpp
79-
src/communication/communication.cpp
80-
src/communication/iamserver.cpp
78+
src/communication/channelmanager.cpp
8179
src/communication/tlschannel.cpp
82-
src/communication/vchannel.cpp
80+
src/communication/channel.cpp
81+
src/communication/channelmanager.cpp
8382
src/downloader/downloader.cpp
83+
src/iamclient/iamclient.cpp
8484
src/logger/logger.cpp
8585
src/monitoring/resourceusageprovider.cpp
86+
src/nodeinfoprovider/nodeinfoprovider.cpp
8687
src/ocispec/ocispec.cpp
87-
src/provisioning/provisioning.cpp
88+
src/provisionmanager/provisionmanagercallback.cpp
8889
src/resourcemanager/resourcemanager.cpp
8990
src/runner/runner.cpp
91+
src/smclient/openhandler.cpp
92+
src/smclient/smclient.cpp
9093
src/storage/storage.cpp
9194
src/utils/checksum.cpp
95+
src/utils/utils.cpp
9296
)
9397

98+
# use pipe for native posix
99+
target_sources_ifdef(CONFIG_NATIVE_APPLICATION app PRIVATE src/communication/socket.cpp)
100+
101+
# use xenvchan for xen
102+
target_sources_ifndef(CONFIG_NATIVE_APPLICATION app PRIVATE src/communication/xenvchan.cpp)
103+
94104
# Enable vchannels and xrun mocks for native posix
95105
target_sources_ifdef(CONFIG_NATIVE_APPLICATION app PRIVATE mocks/vch/vch.cpp mocks/xrun/xrun.cpp mocks/xstat/xstat.cpp)
96106

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

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

112124
# ######################################################################################################################
113125
# Versioning
@@ -219,8 +231,8 @@ ExternalProject_Add(
219231
-DCMAKE_CXX_FLAGS=${aos_cxx_flags}
220232
-DWITH_MBEDTLS=OFF
221233
SOURCE_DIR ${aoscore_source_dir}
222-
BUILD_BYPRODUCTS ${aoscore_build_dir}/lib/libaossmcpp.a ${aoscore_build_dir}/lib/libaosiamcpp.a
223-
${aoscore_build_dir}/lib/libaoscommoncpp.a
234+
BUILD_BYPRODUCTS ${aoscore_build_dir}/lib/libaossm.a ${aoscore_build_dir}/lib/libaosiam.a
235+
${aoscore_build_dir}/lib/libaoscommon.a
224236
DEPENDS zephyr_interface
225237
)
226238

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

233245
add_dependencies(aossm aoscore)
234246

235-
set_target_properties(aossm PROPERTIES IMPORTED_LOCATION ${aoscore_build_dir}/lib/libaossmcpp.a)
247+
set_target_properties(aossm PROPERTIES IMPORTED_LOCATION ${aoscore_build_dir}/lib/libaossm.a)
236248
set_target_properties(aossm PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${aoscore_build_dir}/include)
237249

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

244256
add_dependencies(aosiam aoscore)
245257

246-
set_target_properties(aosiam PROPERTIES IMPORTED_LOCATION ${aoscore_build_dir}/lib/libaosiamcpp.a)
258+
set_target_properties(aosiam PROPERTIES IMPORTED_LOCATION ${aoscore_build_dir}/lib/libaosiam.a)
247259
set_target_properties(aosiam PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${aoscore_build_dir}/include)
248260

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

255267
add_dependencies(aoscommon aoscore)
256268

257-
set_target_properties(aoscommon PROPERTIES IMPORTED_LOCATION ${aoscore_build_dir}/lib/libaoscommoncpp.a)
269+
set_target_properties(aoscommon PROPERTIES IMPORTED_LOCATION ${aoscore_build_dir}/lib/libaoscommon.a)
258270
set_target_properties(aoscommon PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${aoscore_build_dir}/include)
259271

260272
target_link_libraries(app PUBLIC aoscommon)
273+
274+
# ######################################################################################################################
275+
# Prepare softhsm2 config
276+
# ######################################################################################################################
277+
278+
if(CONFIG_NATIVE_APPLICATION)
279+
set(tokendir ${CONFIG_AOS_HSM_DIR})
280+
281+
if(NOT IS_ABSOLUTE ${tokendir})
282+
set(tokendir ${CMAKE_CURRENT_BINARY_DIR}/${tokendir})
283+
endif()
284+
285+
file(COPY misc/softhsm2.conf DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/softhsm)
286+
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/softhsm/softhsm2.conf "directories.tokendir = ${tokendir}/\n")
287+
endif()

Kconfig

+88-46
Original file line numberDiff line numberDiff line change
@@ -9,65 +9,63 @@ config AOS_DOMD_ID
99
int "DomD id"
1010
default 1
1111

12-
config AOS_VCHAN_OPEN_TX_PATH
13-
string "Path to open TX vchan"
14-
default "/local/domain/1/tmp/vchan/aos/open/tx"
12+
config AOS_CHAN_TX_PATH
13+
string "Path to TX channel"
14+
depends on !NATIVE_APPLICATION
15+
default "/local/domain/1/tmp/vchan/aos/tx"
1516

16-
config AOS_VCHAN_OPEN_RX_PATH
17-
string "Path to open RX vchan"
18-
default "/local/domain/1/tmp/vchan/aos/open/rx"
19-
20-
config AOS_VCHAN_SECURE_TX_PATH
21-
string "Path to secure TX vchan"
22-
default "/local/domain/1/tmp/vchan/aos/secure/tx"
23-
24-
config AOS_VCHAN_SECURE_RX_PATH
25-
string "Path to secure RX vchan"
26-
default "/local/domain/1/tmp/vchan/aos/secure/rx"
17+
config AOS_CHAN_RX_PATH
18+
string "Path to RX channel"
19+
depends on !NATIVE_APPLICATION
20+
default "/local/domain/1/tmp/vchan/aos/rx"
2721

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

26+
config AOS_DISK_MOUNT_POINT
27+
string "Disk mount point"
28+
default "/lfs"
29+
3230
config AOS_STORAGE_DIR
3331
string "Path to the storage"
34-
default "/aos/storage"
32+
default "/lfs/aos/storage"
3533

3634
config AOS_RUNTIME_DIR
3735
string "Aos runtime dir"
3836
default "/tmp/aos/runtime"
3937

4038
config AOS_SERVICES_DIR
4139
string "Aos services dir"
42-
default "/aos/services"
40+
default "/lfs/aos/services"
4341

44-
config AOS_UNIT_CONFIG_FILE
42+
config AOS_NODE_CONFIG_FILE
4543
string "Node configuration file path"
46-
default "/aos/unit_config.cfg"
44+
default "/lfs/aos/node_config.cfg"
4745

48-
config AOS_NODE_ID
49-
string "Node id"
50-
default "NODE_0"
46+
config AOS_NODE_STATUS_FILE
47+
string "Path to provisioning state file."
48+
default "/lfs/aos/.nodestatus"
5149

52-
config AOS_NODE_TYPE
53-
string "Node type"
54-
default "NODE_TYPE1"
50+
config AOS_NODE_ID_FILE
51+
string "Path to node id file."
52+
default "/lfs/aos/node-id"
5553

56-
config AOS_NUM_CPU
57-
int "Count of CPUs for domain with Zephyr"
58-
default 1
54+
config AOS_PKCS11_MODULE_PIN_FILE
55+
string "Path to PKCS11 module PIN file."
56+
default "/lfs/aos/.pkcs11pin"
5957

60-
config AOS_TOTAL_RAM
61-
int "Total RAM of the domain"
62-
default 204800
58+
config AOS_HSM_DIR
59+
string "Path HSM tokens dir."
60+
default "/lfs/tee"
6361

64-
config AOS_PARTITION_SIZE
65-
int "Partition size"
66-
default 209715200
62+
config AOS_NODE_NAME
63+
string "Node name"
64+
default "zephyr"
6765

68-
config AOS_DISK_MOUNT_POINT
69-
string "Disk mount point"
70-
default "/aos"
66+
config AOS_NODE_TYPE
67+
string "Node type"
68+
default "NODE_TYPE1"
7169

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

84-
config AOS_PROVISIONING_FILE
85-
string "Path to provisioning file."
86-
default "/aos/.provisioned"
87-
88-
config AOS_PKCS11_MODULE_PIN_FILE
89-
string "Path to PKCS11 module PIN file."
90-
default "/aos/.pkcs11pin"
82+
config AOS_MAX_CPU_DMIPS
83+
int "Maximum CPU DMIPS"
84+
default 10000
9185

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

90+
config AOS_IAM_OPEN_PORT
91+
int "Aos IAM open port"
92+
default 1
93+
94+
config AOS_IAM_SECURE_PORT
95+
int "Aos IAM secure port"
96+
default 2
97+
98+
config AOS_SM_OPEN_PORT
99+
int "Aos SM open port"
100+
default 3
101+
102+
config AOS_SM_SECURE_PORT
103+
int "Aos SM secure port"
104+
default 4
105+
106+
config AOS_SOCKET_SERVER_ADDRESS
107+
string "Aos socket server address"
108+
depends on NATIVE_APPLICATION
109+
default "10.0.0.100"
110+
111+
config AOS_SOCKET_SERVER_PORT
112+
int "Aos socket server port"
113+
depends on NATIVE_APPLICATION
114+
default 30001
115+
116+
config AOS_PBHANDLER_THREAD_STACK_SIZE
117+
int "Aos PB handler stack size"
118+
default 32768
119+
120+
config AOS_LAUNCHER_THREAD_STACK_SIZE
121+
int "Aos launcher stack size"
122+
default 32768
123+
124+
config DOMD_ENABLE
125+
bool "Enable Domain-D creation"
126+
default y
127+
96128
config DOMD_UBOOT_PATH
97129
string "Location for Domain-D IPL binary"
130+
depends on DOMD_ENABLE
98131
default "prebuilt/ipl.bin"
99132

100133
config DOMD_DTB_PATH
101134
string "Location of Domain-D partial device-tree"
135+
depends on DOMD_ENABLE
102136
default "prebuilt/ipl.dtb"
103137

104-
config TA_DEPLOY_DIR
105-
string "Location of optee TA's deploy dir"
106-
107138
config DOMU_ENABLE
108139
bool "Enable Domain-U creation"
109140

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

151+
config TA_DEPLOY_DIR
152+
string "Location of optee TA's deploy dir"
153+
154+
module = AOS_CORE
155+
module-str = Aos core
156+
source "subsys/logging/Kconfig.template.log_config"
157+
158+
module = AOS_CORE_RUNTIME
159+
module-str = Aos core runtime
160+
source "subsys/logging/Kconfig.template.log_config"
161+
120162
source "Kconfig"

0 commit comments

Comments
 (0)