Skip to content

Commit ea96a4d

Browse files
committed
sync with upstream to resolve conflict
2 parents cc4d2da + c02c273 commit ea96a4d

Some content is hidden

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

48 files changed

+1506
-453
lines changed

.github/workflows/test-configs.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,12 @@ jobs:
320320
arch: arm
321321
config-file: ./config/examples/stm32h5-tz.config
322322

323+
stm32h5_tz_dualbank_test:
324+
uses: ./.github/workflows/test-build.yml
325+
with:
326+
arch: arm
327+
config-file: ./config/examples/stm32h5-tz-dualbank.config
328+
323329
stm32h5_tz_dualbank_otp_test:
324330
uses: ./.github/workflows/test-build.yml
325331
with:
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Test Filesystem
2+
3+
on:
4+
push:
5+
branches: [ 'master', 'main', 'release/**' ]
6+
pull_request:
7+
branches: [ '*' ]
8+
9+
jobs:
10+
build-lib-fs-example:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v4
15+
with:
16+
submodules: true
17+
18+
- name: Install build dependencies
19+
run: sudo apt-get update && sudo apt-get install -y build-essential
20+
21+
- name: Set simulation config and build signed boot partition
22+
run: |
23+
cp config/examples/sim.config .config
24+
make clean
25+
make
26+
27+
- name: Check for internal_flash.dd
28+
run: |
29+
if [ ! -f internal_flash.dd ]; then
30+
echo "Error: internal_flash.dd not found. Build may have failed."
31+
exit 1
32+
fi
33+
34+
- name: Switch to library_fs config
35+
run: cp config/examples/library_fs.config .config
36+
37+
- name: Clean and build lib-fs
38+
run: |
39+
make clean
40+
make lib-fs
41+
42+
- name: Mark BOOT partition as SUCCESS
43+
run: ./lib-fs success
44+
45+
- name: Verify BOOT partition integrity and authenticity
46+
run: ./lib-fs verify-boot

.github/workflows/test-library.yml

Lines changed: 60 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,36 @@ on:
88

99
jobs:
1010
test-lib:
11+
# If jobs cancel, consider pinning to ubuntu-24.04
12+
# The ubuntu-latest alias can point to different images during migrations (and sometimes be extra busy),
13+
# while ubuntu-24.04 always targets the 24.04 pool
1114
runs-on: ubuntu-latest
15+
16+
# The timeout is run time after a runner starts, not time in queue
1217
timeout-minutes: 15
1318

1419
strategy:
1520
fail-fast: false
21+
22+
# Limit concurrent jobs for scheduling problem on GitHub's hosted runner pool.
23+
max-parallel: 12
24+
1625
matrix:
17-
math: [SPMATH=1 WOLFBOOT_SMALL_STACK=0,
18-
SPMATH=1 WOLFBOOT_SMALL_STACK=1,
19-
SPMATHALL=1 WOLFBOOT_SMALL_STACK=0,
20-
SPMATHALL=1 WOLFBOOT_SMALL_STACK=1,
21-
SPMATH=0 SPMATHALL=0 WOLFBOOT_SMALL_STACK=0,
22-
SPMATH=0 SPMATHALL=0 WOLFBOOT_SMALL_STACK=1]
26+
math:
27+
- "SPMATH=1 WOLFBOOT_SMALL_STACK=0"
28+
- "SPMATH=1 WOLFBOOT_SMALL_STACK=1"
29+
- "SPMATHALL=1 WOLFBOOT_SMALL_STACK=0"
30+
- "SPMATHALL=1 WOLFBOOT_SMALL_STACK=1"
31+
- "SPMATH=0 SPMATHALL=0 WOLFBOOT_SMALL_STACK=0"
32+
- "SPMATH=0 SPMATHALL=0 WOLFBOOT_SMALL_STACK=1"
2333
asym: [ed25519, ecc256, ecc384, ecc521, rsa2048, rsa3072, rsa4096, ed448]
2434
hash: [sha256, sha384, sha3]
35+
36+
# See https://github.com/wolfSSL/wolfBoot/issues/614 regarding exclusions:
37+
exclude:
38+
- math: "SPMATH=1 WOLFBOOT_SMALL_STACK=1"
39+
- math: "SPMATHALL=1 WOLFBOOT_SMALL_STACK=1"
40+
2541
steps:
2642
- uses: actions/checkout@v4
2743
with:
@@ -33,16 +49,50 @@ jobs:
3349
3450
- name: Build test-lib
3551
env:
52+
shell: bash
3653
ASYM: ${{ matrix.asym }}
3754
HASH: ${{ matrix.hash }}
55+
MATH: ${{ matrix.math }}
3856
run: |
57+
# Sample build
58+
build_once() {
59+
# Convert asym and hash to upper case, optionally add additional param
60+
make -j test-lib SIGN=${ASYM^^} HASH=${HASH^^} ${MATH} "$@"
61+
}
62+
63+
set -euo pipefail
64+
65+
# Get the reference config
3966
cp config/examples/library.config .config
67+
68+
# Keytools
4069
make keytools
41-
./tools/keytools/keygen --${{ matrix.asym }} -g wolfboot_signing_private_key.der
70+
./tools/keytools/keygen --${ASYM} -g wolfboot_signing_private_key.der
71+
72+
# Sign
4273
echo "Test" > test.bin
43-
./tools/keytools/sign --${{ matrix.asym }} --${{ matrix.hash }} test.bin wolfboot_signing_private_key.der 1
44-
# Convert asym and hash to upper case
45-
make test-lib SIGN=${ASYM^^} HASH=${HASH^^}
74+
./tools/keytools/sign --${ASYM} --${HASH} test.bin wolfboot_signing_private_key.der 1
75+
76+
# First attempt
77+
if build_once >build.out 2>build.err; then
78+
echo "Success on first attempt, WOLFBOOT_HUGE_STACK not applied."
79+
exit 0
80+
fi
81+
82+
# If it failed due to the TFM huge stack guard, retry with the flag
83+
if grep -Fq 'If this is OK, please compile with WOLFBOOT_HUGE_STACK=1' build.err; then
84+
echo "Retrying with WOLFBOOT_HUGE_STACK=1 due to stack requirement error."
85+
86+
# Always print the entire message
87+
grep -Fn 'If this is OK, please compile with WOLFBOOT_HUGE_STACK=1' build.err || true
88+
89+
# Try again with huge stack allowed
90+
build_once WOLFBOOT_HUGE_STACK=1
91+
else
92+
echo "Build failed for another reason:"
93+
cat build.err
94+
exit 1
95+
fi
4696
4797
- name: Run test-lib
4898
run: |

.gitignore

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,12 @@ src/ecc384_pub_key.c
6060
src/ecc512_pub_key.c
6161
src/rsa2048_pub_key.c
6262
src/rsa4096_pub_key.c
63+
64+
# Any other generated keystore files
65+
/**/keystore.c
66+
/**/wolfboot_signing_private_key.der
67+
/**/keystore.der
68+
6369
# Renesas key data files
6470
include/key_data.*
6571
include/enckey_data.*
@@ -118,6 +124,7 @@ tools/tpm/policy_create
118124
tools/tpm/policy_sign
119125
config/*.ld
120126
test-lib
127+
lib-fs
121128

122129
# Elf preprocessing tools
123130
tools/squashelf/**
@@ -266,17 +273,16 @@ language.settings.xml
266273
/**/.vs
267274
/**/.visualgdb/*
268275

276+
# Defaults are set in files otherwise excluded:
277+
!/.vs/README.md
278+
!/.vs/VSWorkspaceState.json
279+
!/.vs/VSWorkspaceSettings.json
280+
269281
# Any build directories
270282
/**/build
271283
/**/build-**
272284

273-
/IDE/VisualGDB
274-
/commit_squash.sh
275-
/evars.txt
276-
/evars_non_dev.txt
277-
/gpg_refresh.sh
278-
/IDE/VisualStudio/EmbeddedProject1
279-
/IDE/VisualStudio/wolfboot
280-
/.gitignore.wip
281-
/run.log
282-
/stm32.mak
285+
# Eclipse
286+
.cproject
287+
.project
288+
.settings/

IDE/MPLAB/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# wolfBoot demo application for MPLABx IDE
22

3-
Instruction to compile and test under Windows or Linux OS.
3+
Instructions to compile and test under Windows or Linux OS.
44

55

66
## Target platform
@@ -81,7 +81,7 @@ you plan to modify the geometry of your partitions in FLASH.
8181

8282
The FLASH memory configuration for this demo is located in include/MPLAB/target.h.
8383

84-
The file can be changed manually to set a new partitions geometry, or a new target.h
84+
The file can be changed manually to set a new partitions geometry, or a new target.h
8585
could be created in the include/ directory by running `make`, which will be based
8686
on the chosen configuration via the `.config` file. If a custom `target.h` is created
8787
by `make`, the demo version in `include/MPLAB` can be removed.

IDE/MPLAB/test/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
See the [../README.md](../README.md) for instructions on populating this directory.

IDE/MPLAB/test/keystore.c

Lines changed: 0 additions & 96 deletions
This file was deleted.

Makefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,10 @@ ifeq ($(TARGET),library)
186186
MAIN_TARGET:=libwolfboot.a
187187
endif
188188

189+
ifeq ($(TARGET),library_fs)
190+
MAIN_TARGET:=libwolfboot.a
191+
endif
192+
189193
ifeq ($(TARGET),raspi3)
190194
MAIN_TARGET:=wolfboot.bin
191195
endif
@@ -236,6 +240,10 @@ test-lib: libwolfboot.a hal/library.o
236240
@echo "\t[BIN] $@"
237241
$(Q)$(CC) $(CFLAGS) -o $@ hal/library.o libwolfboot.a
238242

243+
lib-fs: libwolfboot.a hal/library_fs.o hal/filesystem.o
244+
@echo "\t[BIN] $@"
245+
$(Q)$(CC) $(CFLAGS) -o $@ hal/library_fs.o hal/filesystem.o libwolfboot.a
246+
239247
wolfboot.efi: wolfboot.elf
240248
@echo "\t[BIN] $@"
241249
$(Q)$(OBJCOPY) -j .rodata -j .text -j .sdata -j .data \
@@ -466,6 +474,8 @@ clean:
466474
$(Q)rm -f tools/keytools/otp/otp-keystore-gen
467475
$(Q)rm -f .stack_usage
468476
$(Q)rm -f $(WH_NVM_BIN) $(WH_NVM_HEX)
477+
$(Q)rm -f test-lib
478+
$(Q)rm -f lib-fs
469479
$(Q)$(MAKE) -C test-app clean V=$(V)
470480
$(Q)$(MAKE) -C tools/check_config -s clean
471481
$(Q)$(MAKE) -C stage1 -s clean

0 commit comments

Comments
 (0)