From 835f7087c63cb26f7f109e424b14a8b410634e62 Mon Sep 17 00:00:00 2001 From: matejcik Date: Thu, 21 Nov 2024 16:08:53 +0100 Subject: [PATCH] build(core): correctly propagate DISABLE_OPTIGA to kernel --- core/Makefile | 1 + core/SConscript.firmware | 4 +++- core/SConscript.kernel | 5 ++++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/core/Makefile b/core/Makefile index f98c31ed0e..4ce16e342f 100644 --- a/core/Makefile +++ b/core/Makefile @@ -31,6 +31,7 @@ PYOPT ?= 1 BITCOIN_ONLY ?= 0 BOOTLOADER_QA ?= 0 BOOTLOADER_DEVEL ?= 0 +DISABLE_OPTIGA ?= 0 TREZOR_MODEL ?= T TREZOR_MEMPERF ?= 0 ADDRESS_SANITIZER ?= 0 diff --git a/core/SConscript.firmware b/core/SConscript.firmware index 4840d4b36a..a3e17ee93c 100644 --- a/core/SConscript.firmware +++ b/core/SConscript.firmware @@ -31,7 +31,9 @@ FEATURE_FLAGS = { } FEATURES_WANTED = ["input", "sd_card", "rgb_led", "dma2d", "consumption_mask", "usb" ,"optiga", "haptic"] -if DISABLE_OPTIGA and PYOPT == '0': +if DISABLE_OPTIGA: + if PYOPT != '0': + raise RuntimeError("DISABLE_OPTIGA requires PYOPT=0") FEATURES_WANTED.remove("optiga") CCFLAGS_MOD = '' diff --git a/core/SConscript.kernel b/core/SConscript.kernel index 0c0befec5b..7b7dec48ad 100644 --- a/core/SConscript.kernel +++ b/core/SConscript.kernel @@ -24,7 +24,10 @@ FEATURE_FLAGS = { } FEATURES_WANTED = ["input", "sd_card", "rgb_led", "dma2d", "consumption_mask", "usb" ,"optiga", "haptic"] -if DISABLE_OPTIGA and PYOPT == '0': +if DISABLE_OPTIGA: + # TODO use PYOPT instead of PRODUCTION, same as in firmware, blocked on #4253 + if PRODUCTION: + raise RuntimeError("DISABLE_OPTIGA requires non-production build") FEATURES_WANTED.remove("optiga") CCFLAGS_MOD = ''