refactor(core): move bootloader embedded data to fw project
What changed, and why it matters
This commit simply moves a source file from one directory to another within the Trezor firmware build system. The actual code content is unchanged. There is no security-relevant change visible in the diff.
No action required. This is a non-functional refactor.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change relocates boot_image_embdata.c from core/embed/sec/image/ to core/embed/projects/firmware/ and updates the SConsolidated build script (core/SConscript.firmware) to reference the new path. The file contents are byte-for-byte identical (same hash bbc0af73). No logic, data structures, or security properties were modified.
Changed components
core/SConscript.firmwarecore/embed/projects/firmware/boot_image_embdata.ccore/embed/sec/image/boot_image_embdata.cInspect captured patch +52 / −52
diff --git a/core/SConscript.firmware b/core/SConscript.firmware
index 0eb94c1c..cd2f15f1 100644
--- a/core/SConscript.firmware
+++ b/core/SConscript.firmware
@@ -284,7 +284,6 @@ SOURCE_MOD += [
'embed/rtl/error_handling.c',
'embed/rtl/scm_revision.c',
'embed/rtl/strutils.c',
- 'embed/sec/image/boot_image_embdata.c',
'embed/sec/image/image.c',
'vendor/micropython/lib/uzlib/adler32.c',
'vendor/micropython/lib/uzlib/crc32.c',
@@ -481,6 +480,7 @@ env = Environment(
FEATURES_AVAILABLE = models.configure_board(TREZOR_MODEL, HW_REVISION, FEATURES_WANTED, env, CPPDEFINES_HAL, SOURCE_HAL, PATH_HAL)
SOURCE_FIRMWARE = [
+ 'embed/projects/firmware/boot_image_embdata.c',
'embed/projects/firmware/header.S',
'embed/projects/firmware/main.c',
'embed/projects/firmware/mphalport.c',
diff --git a/core/embed/projects/firmware/boot_image_embdata.c b/core/embed/projects/firmware/boot_image_embdata.c
new file mode 100644
index 00000000..bbc0af73
--- /dev/null
+++ b/core/embed/projects/firmware/boot_image_embdata.c
@@ -0,0 +1,51 @@
+/*
+ * This file is part of the Trezor project, https://trezor.io/
+ *
+ * Copyright (c) SatoshiLabs
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <trezor_model.h>
+
+#include <sec/boot_image.h>
+
+#define CONCAT_NAME_HELPER(prefix, name, suffix) prefix##name##suffix
+#define CONCAT_NAME(name, var) CONCAT_NAME_HELPER(BOOTLOADER_, name, var)
+
+#if BOOTLOADER_QA
+// QA bootloaders
+#define BOOTLOADER_00 CONCAT_NAME(MODEL_INTERNAL_NAME_TOKEN, _QA_00)
+#define BOOTLOADER_FF CONCAT_NAME(MODEL_INTERNAL_NAME_TOKEN, _QA_FF)
+#else
+// normal bootloaders
+#define BOOTLOADER_00 CONCAT_NAME(MODEL_INTERNAL_NAME_TOKEN, _00)
+#define BOOTLOADER_FF CONCAT_NAME(MODEL_INTERNAL_NAME_TOKEN, _FF)
+#endif
+
+// symbols from bootloader.bin => bootloader.o
+extern const void bootloader_start;
+extern const void bootloader_size;
+extern const void bootloader_size;
+
+static const boot_image_t g_bootloader_image = {
+ .image_ptr = (const void *)&bootloader_start,
+ .image_size = (size_t)&bootloader_size,
+#ifndef USE_BOOT_UCB
+ .hash_00 = BOOTLOADER_00,
+ .hash_FF = BOOTLOADER_FF,
+#endif
+};
+
+const boot_image_t *boot_image_get_embdata(void) { return &g_bootloader_image; }
diff --git a/core/embed/sec/image/boot_image_embdata.c b/core/embed/sec/image/boot_image_embdata.c
deleted file mode 100644
index bbc0af73..00000000
--- a/core/embed/sec/image/boot_image_embdata.c
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * This file is part of the Trezor project, https://trezor.io/
- *
- * Copyright (c) SatoshiLabs
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include <trezor_model.h>
-
-#include <sec/boot_image.h>
-
-#define CONCAT_NAME_HELPER(prefix, name, suffix) prefix##name##suffix
-#define CONCAT_NAME(name, var) CONCAT_NAME_HELPER(BOOTLOADER_, name, var)
-
-#if BOOTLOADER_QA
-// QA bootloaders
-#define BOOTLOADER_00 CONCAT_NAME(MODEL_INTERNAL_NAME_TOKEN, _QA_00)
-#define BOOTLOADER_FF CONCAT_NAME(MODEL_INTERNAL_NAME_TOKEN, _QA_FF)
-#else
-// normal bootloaders
-#define BOOTLOADER_00 CONCAT_NAME(MODEL_INTERNAL_NAME_TOKEN, _00)
-#define BOOTLOADER_FF CONCAT_NAME(MODEL_INTERNAL_NAME_TOKEN, _FF)
-#endif
-
-// symbols from bootloader.bin => bootloader.o
-extern const void bootloader_start;
-extern const void bootloader_size;
-extern const void bootloader_size;
-
-static const boot_image_t g_bootloader_image = {
- .image_ptr = (const void *)&bootloader_start,
- .image_size = (size_t)&bootloader_size,
-#ifndef USE_BOOT_UCB
- .hash_00 = BOOTLOADER_00,
- .hash_FF = BOOTLOADER_FF,
-#endif
-};
-
-const boot_image_t *boot_image_get_embdata(void) { return &g_bootloader_image; }
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.