Skip to content

Commit 9df003e

Browse files
committed
eboot v0.2.0 - A/B bootloader with crypto, device table, multicore (+ slot manager & boot log unit tests)
0 parents  commit 9df003e

173 files changed

Lines changed: 19461 additions & 0 deletions

File tree

Some content is hidden

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

.github/workflows/ci.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
9+
jobs:
10+
build:
11+
name: Build (${{ matrix.os }})
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
os: [ubuntu-latest, windows-latest, macos-latest]
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Configure
22+
run: cmake -B build -DEBLDR_BUILD_TESTS=ON
23+
24+
- name: Build
25+
run: cmake --build build --config Release
26+
27+
- name: Test
28+
run: ctest --test-dir build --output-on-failure -C Release
29+
30+
config-generation:
31+
name: Config Generation
32+
runs-on: ubuntu-latest
33+
steps:
34+
- uses: actions/checkout@v4
35+
- uses: actions/setup-python@v5
36+
with:
37+
python-version: "3.12"
38+
- run: pip install -r requirements.txt
39+
- name: Test generate_config.py
40+
run: |
41+
cat > /tmp/test_boot.yaml << 'EOF'
42+
boot:
43+
board: stm32f4
44+
arch: arm
45+
flash_base: "0x08000000"
46+
flash_size: 1048576
47+
layout:
48+
stage0: { offset: "0x0", size: 16384 }
49+
stage1: { offset: "0x4000", size: 65536 }
50+
bootctl_primary: { offset: "0x14000", size: 4096 }
51+
bootctl_backup: { offset: "0x15000", size: 4096 }
52+
slot_a: { offset: "0x16000", size: 479232 }
53+
slot_b: { offset: "0x8B000", size: 479232 }
54+
policy:
55+
max_boot_attempts: 3
56+
watchdog_timeout_ms: 5000
57+
require_signature: true
58+
EOF
59+
python scripts/generate_config.py /tmp/test_boot.yaml /tmp/generated/
60+
test -f /tmp/generated/eboot_generated_layout.h
61+
test -f /tmp/generated/eboot_generated_memory.ld
62+
echo "Config generation passed"

.github/workflows/nightly.yml

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
name: Nightly Regression
2+
3+
on:
4+
schedule:
5+
- cron: "0 2 * * *" # 2:00 AM UTC daily
6+
workflow_dispatch: # Manual trigger
7+
8+
jobs:
9+
native-build:
10+
name: Native (${{ matrix.os }})
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
os: [ubuntu-latest, windows-latest, macos-latest]
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Configure
20+
run: cmake -B build -DEBLDR_BUILD_TESTS=ON
21+
22+
- name: Build
23+
run: cmake --build build --config Release
24+
25+
- name: Test
26+
run: ctest --test-dir build --output-on-failure -C Release
27+
28+
cross-compile:
29+
name: Cross (${{ matrix.arch }})
30+
runs-on: ubuntu-latest
31+
strategy:
32+
fail-fast: false
33+
matrix:
34+
include:
35+
- arch: aarch64-linux
36+
toolchain: toolchains/aarch64-linux-gnu.cmake
37+
packages: gcc-aarch64-linux-gnu
38+
- arch: riscv64-linux
39+
toolchain: toolchains/riscv64-linux-gnu.cmake
40+
packages: gcc-riscv64-linux-gnu
41+
- arch: arm-cortex-m
42+
toolchain: toolchains/arm-none-eabi.cmake
43+
packages: gcc-arm-none-eabi libnewlib-arm-none-eabi
44+
steps:
45+
- uses: actions/checkout@v4
46+
47+
- name: Install cross-compiler
48+
run: |
49+
sudo apt-get update
50+
sudo apt-get install -y ${{ matrix.packages }}
51+
52+
- name: Configure
53+
run: cmake -B build -DCMAKE_TOOLCHAIN_FILE=${{ matrix.toolchain }} -DCMAKE_BUILD_TYPE=Release
54+
55+
- name: Build
56+
run: cmake --build build
57+
58+
- name: Verify artifacts
59+
run: |
60+
echo "=== Static libraries ==="
61+
find build -name "*.a" | sort
62+
LIB_COUNT=$(find build -name "*.a" | wc -l)
63+
echo "Found $LIB_COUNT libraries"
64+
if [ "$LIB_COUNT" -lt 1 ]; then
65+
echo "ERROR: No libraries produced"
66+
exit 1
67+
fi
68+
69+
config-generation:
70+
name: Config Generation
71+
runs-on: ubuntu-latest
72+
steps:
73+
- uses: actions/checkout@v4
74+
- uses: actions/setup-python@v5
75+
with:
76+
python-version: "3.12"
77+
- run: pip install -r requirements.txt
78+
- name: Test generate_config.py
79+
run: |
80+
cat > /tmp/test_boot.yaml << 'EOF'
81+
boot:
82+
board: stm32f4
83+
arch: arm
84+
flash_base: "0x08000000"
85+
flash_size: 1048576
86+
layout:
87+
stage0: { offset: "0x0", size: 16384 }
88+
stage1: { offset: "0x4000", size: 65536 }
89+
bootctl_primary: { offset: "0x14000", size: 4096 }
90+
bootctl_backup: { offset: "0x15000", size: 4096 }
91+
slot_a: { offset: "0x16000", size: 479232 }
92+
slot_b: { offset: "0x8B000", size: 479232 }
93+
policy:
94+
max_boot_attempts: 3
95+
watchdog_timeout_ms: 5000
96+
require_signature: true
97+
EOF
98+
python scripts/generate_config.py /tmp/test_boot.yaml /tmp/generated/
99+
test -f /tmp/generated/eboot_generated_layout.h
100+
test -f /tmp/generated/eboot_generated_memory.ld
101+
echo "Config generation passed"
102+
103+
report:
104+
name: Nightly Report
105+
runs-on: ubuntu-latest
106+
needs: [native-build, cross-compile, config-generation]
107+
if: always()
108+
steps:
109+
- name: Check results
110+
run: |
111+
echo "## Nightly Regression Report — eboot"
112+
echo "Date: $(date -u '+%Y-%m-%d %H:%M UTC')"
113+
echo ""
114+
echo "| Job | Status |"
115+
echo "|---|---|"
116+
echo "| Native builds | ${{ needs.native-build.result }} |"
117+
echo "| Cross-compile | ${{ needs.cross-compile.result }} |"
118+
echo "| Config gen | ${{ needs.config-generation.result }} |"
119+
if [ "${{ needs.native-build.result }}" != "success" ] || \
120+
[ "${{ needs.cross-compile.result }}" != "success" ] || \
121+
[ "${{ needs.config-generation.result }}" != "success" ]; then
122+
echo ""
123+
echo "❌ REGRESSION DETECTED"
124+
exit 1
125+
fi
126+
echo ""
127+
echo "✅ All checks passed"

0 commit comments

Comments
 (0)