-
Notifications
You must be signed in to change notification settings - Fork 321
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
82 changed files
with
22,379 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,17 @@ | ||
[submodule "rimage"] | ||
path = rimage | ||
# This is a _relative_ submodule URL. In some use cases it's better than | ||
# an _absolute_ submodule URL, in other cases it's not. One size does | ||
# unfortunately not fit all. | ||
# | ||
# Among other pages, http://blog.tremily.us/posts/Relative_submodules/ | ||
# has a good comparison | ||
# | ||
# If you use Zephyr you must also look at the comments in sof/west.yml. | ||
# | ||
# If you want to fork or mirror sof.git _without_ doing the same for | ||
# rimage.git then your automation may want you to change and git commit | ||
# an absolute URL in your branch. No need to git commit for interactive | ||
# use; a local and temporary edit of this file is enough for interactive | ||
# use because .gitmodules is used only once to --init[ialize] | ||
# .git/config the first time. Then .gitmodules is never used again after | ||
# cloning. | ||
url = ../rimage | ||
# This is required for non-Zephyr ("XTOS") configurations. Zephyr | ||
# configs also get it from sof/west.yml which adds the burden of keeping | ||
# both tomlc99 SHA1s synchronized but in practice this barely ever moves. | ||
[submodule "tomlc99"] | ||
path = tools/rimage/tomlc99 | ||
# This is a _absolute_ submodule URL. In some use cases it's | ||
# better than an _relative_ submodule URL, in other cases it's | ||
# not. One size does unfortunately not fit all. Among other | ||
# pages, http://blog.tremily.us/posts/Relative_submodules/ has a | ||
# good comparison. | ||
# | ||
# A local and temporary edit of this url can be enough because | ||
# .gitmodules is used _only once_ to submodule --init[ialize] | ||
# .git/config the first time. Then .gitmodules is never used | ||
# again after cloning tomlc99 the first time. | ||
url = https://github.com/thesofproject/tomlc99.git | ||
branch = master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule rimage
deleted from
ac487e
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--codespell | ||
--codespellfile scripts/spelling.txt | ||
--ignore C99_COMMENT_TOLERANCE | ||
--no-tree | ||
--strict | ||
-g |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- | ||
# Basic build test | ||
|
||
name: build | ||
|
||
# yamllint disable-line rule:truthy | ||
on: [pull_request, push, workflow_dispatch] | ||
|
||
env: | ||
CMAKE_C_FLAGS: "-Werror -Wall -Wmissing-prototypes\ | ||
-Wimplicit-fallthrough=3 -Wpointer-arith" | ||
|
||
jobs: | ||
build-test: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: {fetch-depth: 50, submodules: recursive} | ||
|
||
- name: install tools | ||
run: sudo apt update && sudo apt install -y ninja-build | ||
|
||
- name: build | ||
run: cmake -B build/ -G Ninja | ||
- run: cmake --build build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
# Tools that can save round-trips to github and a lot of time: | ||
# | ||
# yamllint -f parsable this.yml | ||
# pip3 install ruamel.yaml.cmd | ||
# yaml merge-expand this.yml exp.yml && diff -w -u this.yml exp.yml | ||
# | ||
# github.com also has a powerful web editor that can be used without | ||
# committing. | ||
|
||
name: cppcheck | ||
|
||
# yamllint disable-line rule:truthy | ||
on: [pull_request, push] | ||
|
||
jobs: | ||
cppcheck: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: {fetch-depth: 50, submodules: recursive} | ||
|
||
- name: apt install cppcheck | ||
run: sudo apt update && sudo apt-get -y install cppcheck | ||
|
||
# TODO enable more types of checks as they are fixed | ||
- name: run cppcheck | ||
run: cppcheck --platform=unix32 --force --max-configs=1024 | ||
--inconclusive --quiet --inline-suppr . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
--- | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
# Tools that can save round-trips to github and a lot of time: | ||
# | ||
# yamllint -f parsable this.yml | ||
# pip3 install ruamel.yaml.cmd | ||
# yaml merge-expand this.yml exp.yml && diff -w -u this.yml exp.yml | ||
# | ||
# github.com also has a powerful web editor that can be used without | ||
# committing. | ||
|
||
name: codestyle | ||
|
||
# yamllint disable-line rule:truthy | ||
on: [pull_request] | ||
|
||
jobs: | ||
yamllint: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 50 | ||
submodules: recursive | ||
|
||
- name: run yamllint | ||
run: yamllint .github/workflows/*.yml | ||
checkpatch: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
fetch-depth: ${{ env.PR_FETCH_DEPTH }} | ||
|
||
- name: install codespell | ||
run: sudo apt update && sudo apt install -y codespell | ||
|
||
- name: checkpatch.pl PR review | ||
uses: webispy/checkpatch-action@v9 | ||
env: | ||
CHECKPATCH_COMMAND: ./scripts/checkpatch.pl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
build/ | ||
.checkpatch-camelcase.git.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
|
||
cmake_minimum_required(VERSION 3.10) | ||
|
||
project(SOF_RIMAGE C) | ||
|
||
if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) | ||
message(STATUS "No CMAKE_BUILD_TYPE, defaulting to Debug") | ||
set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Build Type" FORCE) | ||
endif() | ||
|
||
add_executable(rimage | ||
src/file_simple.c | ||
src/cse.c | ||
src/css.c | ||
src/plat_auth.c | ||
src/hash.c | ||
src/pkcs1_5.c | ||
src/manifest.c | ||
src/ext_manifest.c | ||
src/rimage.c | ||
src/toml_utils.c | ||
src/adsp_config.c | ||
src/misc_utils.c | ||
src/file_utils.c | ||
src/elf_file.c | ||
src/module.c | ||
tomlc99/toml.c | ||
) | ||
|
||
set_property(TARGET rimage PROPERTY C_STANDARD 99) | ||
|
||
target_compile_options(rimage PRIVATE | ||
-Wall -Werror -Wmissing-prototypes -Wimplicit-fallthrough | ||
) | ||
|
||
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER 9.1) | ||
target_compile_options(rimage PRIVATE -Wno-char-subscripts) | ||
endif() | ||
|
||
# Windows builds use MSYS2 https://www.msys2.org/ to get linux tools and headers. | ||
# MSYS_INSTALL_DIR variable points to MSYS2 installation directory. | ||
# You may pass it as environmental or cmake configure variable. | ||
if(${CMAKE_HOST_WIN32}) | ||
cmake_minimum_required(VERSION 3.20) | ||
if(DEFINED ENV{MSYS_INSTALL_DIR} AND NOT MSYS_INSTALL_DIR) | ||
set(MSYS_INSTALL_DIR $ENV{MSYS_INSTALL_DIR}) | ||
endif() | ||
|
||
if(MSYS_INSTALL_DIR) | ||
cmake_path(IS_ABSOLUTE MSYS_INSTALL_DIR IS_MSYS_INSTALL_DIR_ABSOLUTE) | ||
if(NOT IS_MSYS_INSTALL_DIR_ABSOLUTE) | ||
message(FATAL_ERROR "Please provide absolute path to MSYS2 installation | ||
setting MSYS_INSTALL_DIR env variable") | ||
endif() | ||
# Include standard posix headers. Requires pacman openssl-devel package. | ||
cmake_path(APPEND MSYS_INSTALL_DIR "usr" "include" OUTPUT_VARIABLE MSYS_SYSTEM_INCLUDE_PATH) | ||
target_include_directories(rimage PRIVATE "${MSYS_SYSTEM_INCLUDE_PATH}") | ||
endif() | ||
endif() | ||
|
||
target_link_libraries(rimage PRIVATE crypto) | ||
|
||
target_include_directories(rimage PRIVATE | ||
src/include/ | ||
tomlc99/ | ||
) |
Oops, something went wrong.