Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions lmdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@
To build dummy loadable library execute:

cd libraries/dummy
mkdir build
cd build

cmake -DRIMAGE_COMMAND="/path/to/rimage" -DSIGNING_KEY="/path/to/signing/key.pem" ..
cmake --build .

Here RIMAGE_COMMAND is path to rimage executable binary, SIGNING_KEY is path to
signing key for rimage.
cmake -B build -G <Ninja/Makefile> -DRIMAGE_INSTALL_DIR="path/where/rimage/executable/is" -DSNIGNING_KEY="path/to/key"
cd --build build


Here RIMAGE_INSTALL_DIR is a path to directory where rimage executable is, SIGNING_KEY is a path to
signing key for rimage. If RIMAGE_INSTALL_DIR is not provided, rimage will be searched for in the directory
where SOF project installs it. Dummy module sets up toolchain file in the project file.
However, in your library you can select toolchain file in the configure step command:

cmake -B build -G <Ninja/Makefile> --toolchain "../../cmake/xtensa-toolchain.cmake" -DSNIGNING_KEY="path/to/key"
14 changes: 14 additions & 0 deletions lmdk/cmake/build.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,20 @@ endforeach()
set(RIMAGE_OUTPUT_FILE ${PROJECT_NAME}_noextmft)
set(OUTPUT_FILE ${PROJECT_NAME}.bin)

if(RIMAGE_INSTALL_DIR)
cmake_path(ABSOLUTE_PATH RIMAGE_INSTALL_DIR BASE_DIRECTORY ${CMAKE_SOURCE_DIR} NORMALIZE)
endif()

# Create a hint - rimage may be installed to directory where SOF project installs it
cmake_path(APPEND SOF_BASE "../build-rimage" OUTPUT_VARIABLE RIMAGE_SOF_INSTALL_DIR)
cmake_path(NORMAL_PATH RIMAGE_SOF_INSTALL_DIR)
cmake_path(ABSOLUTE_PATH SIGNING_KEY BASE_DIRECTORY ${CMAKE_SOURCE_DIR} NORMALIZE)

find_program(RIMAGE_COMMAND NAMES rimage
PATHS "${RIMAGE_INSTALL_DIR}"
HINTS "${RIMAGE_SOF_INSTALL_DIR}"
REQUIRED)

add_custom_target(${PROJECT_NAME}_target ALL
DEPENDS ${MODULES_LIST}
COMMAND ${RIMAGE_COMMAND} -k ${SIGNING_KEY} -f 2.0.0 -b 1 -o ${RIMAGE_OUTPUT_FILE} -c ${TOML} -e ${MODULES_LIST}
Expand Down
7 changes: 0 additions & 7 deletions lmdk/cmake/config.cmake
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@

if(NOT DEFINED RIMAGE_COMMAND)
message(FATAL_ERROR
" Please define RIMAGE_COMMAND: path to rimage executable.\n"
" E.g. using cmake -DRIMAGE_COMMAND=/path/rimage command line parameter."
)
endif()

if(NOT DEFINED SIGNING_KEY)
message(FATAL_ERROR
" Please define SIGNING_KEY: path to signing key for rimage.\n"
Expand Down