Skip to content

Commit

Permalink
[nrf noup] cmake: multi image build support with IMAGE prefix
Browse files Browse the repository at this point in the history
Note: This was originally submitted upstream in zephyrproject-rtos#13672 and was
      rejected. NCS is carrying it as a noup for now. Another,
      more upstream-friendly approach will be needed.

We are seeing the need to boot Zephyr applications in multiple
stages, a real-world use-case of even a 3-stage bootloader has
been identified and tested.

Each bootloader needs to be individually upgrade-able and have
it's own configurations of Zephyr libraries. To achieve this each
bootloader is organized as it's own executable.

The problem is that the build system can only build one
executable. This creates a usability issue as the user must invoke a
large set of arcane commands to build, sign, and flash each
bootloader.

To resolve this we re-organize the build system such that it can build
multiple executables. To work within CMake restrictions that logical
target names must be globally unique (among other naming
restrictions), we add an IMAGE variable which is used to name the
current Zephyr application being built.

Signed-off-by: Sebastian Bøe <[email protected]>
Signed-off-by: Håkon Øye Amundsen <[email protected]>
Signed-off-by: Øyvind Rønningstad <[email protected]>
Signed-off-by: Robert Lubos <[email protected]>
Signed-off-by: Ruth Fuchss <[email protected]>

(cherry picked from commit 3db22ac)
(Conflicts were resolved in lib/posix/CMakeLists.txt. Changes to
 ia32.cmake were dropped entirely since Intel has rejected this
 approach.

 Finally, these follow-up fixes and dependent patches were squashed
 in:

  02eeeb7
  c6c3fed
  56f6a33
  1dc0ca5
  6e348b8)
Signed-off-by: Marti Bolivar <[email protected]>

(cherry picked from commit 1e0a3dc)
(Conflict resolved in cmake/app/boilerplate.cmake)
Signed-off-by: Robert Lubos <[email protected]>
(cherry picked from commit 439a1ad)
Signed-off-by: Martí Bolívar <[email protected]>
(cherry picked from commit bbcbd8f)
Signed-off-by: Dominik Ermel <[email protected]>
  • Loading branch information
SebastianBoe authored and de-nordic committed Nov 18, 2019
1 parent 5ab0fde commit f7e51f7
Show file tree
Hide file tree
Showing 24 changed files with 741 additions and 405 deletions.
226 changes: 118 additions & 108 deletions CMakeLists.txt

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion arch/arm/core/cortex_m/tz/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ if(CONFIG_ARM_FIRMWARE_HAS_SECURE_ENTRY_FUNCS)
# Indicate that the entry veneers library file is created during linking of this firmware.
set_property(
GLOBAL APPEND PROPERTY
extra_post_build_byproducts
${IMAGE}extra_post_build_byproducts
${CMAKE_BINARY_DIR}/${CONFIG_ARM_ENTRY_VENEERS_LIB_NAME}
)
endif()
Expand Down
Loading

0 comments on commit f7e51f7

Please sign in to comment.