mv crypto/ and certs/ into board/ (#2363)

This commit is contained in:
Adeeb Shihadeh
2026-02-28 15:44:09 -08:00
committed by GitHub
parent 011d3db269
commit 45f80df2cc
12 changed files with 8 additions and 8 deletions

View File

@@ -26,7 +26,7 @@ jobs:
- name: Build debug FW
run: ${{ env.RUN }} "scons"
- name: Build release FW
run: ${{ env.RUN }} "CERT=certs/debug RELEASE=1 scons"
run: ${{ env.RUN }} "CERT=board/certs/debug RELEASE=1 scons"
test:
name: ./test.sh

View File

@@ -14,7 +14,7 @@ if os.getenv("RELEASE"):
assert os.path.exists(cert_fn), 'Certificate file not found. Please specify absolute path'
else:
BUILD_TYPE = "DEBUG"
cert_fn = File("./certs/debug").srcnode().relpath
cert_fn = File("./board/certs/debug").srcnode().relpath
common_flags += ["-DALLOW_DEBUG"]
if os.getenv("DEBUG"):
@@ -33,7 +33,7 @@ def get_version(builder, build_type):
def get_key_header(name):
from Crypto.PublicKey import RSA
public_fn = File(f'./certs/{name}.pub').srcnode().get_path()
public_fn = File(f'./board/certs/{name}.pub').srcnode().get_path()
with open(public_fn) as f:
rsa = RSA.importKey(f.read())
assert(rsa.size_in_bits() == 1024)
@@ -105,8 +105,8 @@ def build_project(project_name, project, main, extra_flags):
bs_env.Append(CFLAGS="-DBOOTSTUB", ASFLAGS="-DBOOTSTUB", LINKFLAGS="-DBOOTSTUB")
bs_elf = bs_env.Program(f"{project_dir}/bootstub.elf", [
startup,
"./crypto/rsa.c",
"./crypto/sha.c",
"./board/crypto/rsa.c",
"./board/crypto/sha.c",
"./board/bootstub.c",
])
bs_env.Objcopy(f"./board/obj/bootstub.{project_name}.bin", bs_elf)
@@ -117,7 +117,7 @@ def build_project(project_name, project, main, extra_flags):
main
], LINKFLAGS=[f"-Wl,--section-start,.isr_vector={project['APP_START_ADDRESS']}"] + flags)
main_bin = env.Objcopy(f"{project_dir}/main.bin", main_elf)
sign_py = File(f"./crypto/sign.py").srcnode().relpath
sign_py = File(f"./board/crypto/sign.py").srcnode().relpath
env.Command(f"./board/obj/{project_name}.bin.signed", main_bin, f"SETLEN=1 {sign_py} $SOURCE $TARGET {cert_fn}")

View File

@@ -11,8 +11,8 @@
#include "board/early_init.h"
#include "board/provision.h"
#include "crypto/rsa.h"
#include "crypto/sha.h"
#include "board/crypto/rsa.h"
#include "board/crypto/sha.h"
#include "board/obj/cert.h"
#include "board/obj/gitversion.h"