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
12 changes: 9 additions & 3 deletions installer/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,26 @@
# Override ?= variables in config.mk
-include config.mk

# List of /lib/firmware/sof/ images and symbolic links currently
# released by Intel.

# See rimage/config/*.toml
UNSIGNED_list ?= bdw byt cht
SIGNED_list ?= apl cnl icl jsl tgl tgl-h
# older SOF versions
# SIGNED_list += hsw kbl skl sue

# To find aliases, try in a Linux kernel git clone:
#
# git grep 'sof-.*\.ri' -- sound/soc/


ALIAS_SAME_KEY_list := glk cfl cml
ALIAS_OTHER_KEY_list := ehl adl adl-s
ALIAS_list ?= ${ALIAS_SAME_KEY_list} ${ALIAS_OTHER_KEY_list}


# Older platforms not released anymore
# UNSIGNED_list += hsw sue
# SIGNED_list += kbl skl

$(info UNSIGNED_list = ${UNSIGNED_list} )
$(info SIGNED_list = ${SIGNED_list} )
$(info ALIAS_list = ${ALIAS_list} )
Expand Down
28 changes: 18 additions & 10 deletions scripts/test-repro-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ SOF2="$SOF_PARENT"/sof-bind-mount-DO-NOT-DELETE
# SOF2="$SOF_PARENT"/sog


# Test with one of each: CSS signature v1.5, v1.8 and v2.5
# Test with one of each: unsigned, CSS signature v1.5, v1.8 and v2.5
# This also provides some C code coverage diversity.
PLATFS=(skl apl tgl)
PLATFS=(byt skl apl tgl)

# diffoscope is great but it has hundreds of dependencies, too long to
# install for CI so we don't use it here. This is just an alias
Expand All @@ -64,20 +64,23 @@ hexdiff ()

init()
{
# -E(xtended) regex
local excluded_endings=(
'\.log' /deps
'\.c?make' '\.ninja' /TargetDirectories.txt
/CMakeCache.txt /progress.marks /CMakeRulesHashes.txt /Makefile
/CMakeRuleHashes.txt /Makefile2
'/depend\.internal' /link.txt '\.includecache'
'/.ninja_deps' '/.ninja_log'
'.*\.c\.o\.d'
'/rimage_ep.*'
'/smex_ep.*'
)

# Hack to avoid CSS 2.5 salt. See caveats above.
excluded_endings+=('/sof-tgl.ri')
excluded_endings+=('tgl_.cc/sof.ri')
# The signing process is not deterministic.
# Keep 'reproducible.ri' INCLUDED!
excluded_endings+=('/sof-[a-z-]{,6}\.rix?')
excluded_endings+=('/sof\.ri' '/sof-no-xman\.ri' )

GREP_EXCLUDE_ARGS=()
for fpath in "${excluded_endings[@]}"; do
Expand Down Expand Up @@ -109,7 +112,8 @@ diff_some_files()

for p in "${PLATFS[@]}"; do

# look at the smallest .c.o first
# Compare some ELF section headers. Look at the smallest .c.o
# first
for f in CMakeFiles/sof.dir/src/arch/xtensa/init.c.o sof; do

diff --report-identical-files \
Expand All @@ -120,14 +124,18 @@ diff_some_files()

done

for f in generated/include/version.h sof.ri; do
for f in generated/include/version.h sof.ri \
src/arch/xtensa/reproducible.ri; do
diff -u --report-identical-files \
{b0,b1}/build_"$p"_?cc/"$f"
# report unsupported reproducible.ri
test -s b0/build_"$p"_?cc/"$f" ||
printf '\t%s is EMPTY\n' b0/build_"$p"_?cc/"$f"
done

done
true
)
) | sed -e 's/differ/DIFFER/g'
}

main()
Expand Down Expand Up @@ -162,7 +170,7 @@ main()
# Use this to "break" rimage that makes the date (in local time!
# BIOS fans?) part of the CSS signature. See caveats above.
# +14:00 - -11:00 = +25:00 = always on a different date
# export TZ='Pacific/Kiritimati' # +14:00
export TZ='Pacific/Kiritimati' # +14:00

"$SOF2"/scripts/xtensa-build-all.sh "${PLATFS[@]}"
mv build_*_?cc reprobld/b1/
Expand All @@ -176,7 +184,7 @@ main()
diff -qr b0 b1/ |
grep -E -v "${GREP_EXCLUDE_ARGS[@]}" || {
printf \
"\n\n ---- PASS: no difference found between %s/b0/ and b1/ --- \n\n" "$(pwd)"
"\n\n ---- PASS: no unexpected difference found between %s/b0/ and b1/ --- \n\n" "$(pwd)"
exit 0
}

Expand Down
51 changes: 50 additions & 1 deletion src/arch/xtensa/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -529,8 +529,57 @@ add_custom_target(
DEPENDS run_meu
VERBATIM
USES_TERMINAL
BYPRODUCTS sof-${fw_name}.ri # almost like a proper add_custom_command()
)


# Keep lists below in sync with rimage/config/*.toml

# .ri not signed: nothing variable in it to erase.
set(UNSIGNED_RI byt cht hsw bdw sue)
# NXP
list(APPEND UNSIGNED_RI imx8 imx8x imx8m)
# AMD
list(APPEND UNSIGNED_RI rn)
# Mediatek
list(APPEND UNSIGNED_RI mt8195)

# Signed and non-deterministic but sof_ri_info.py is not compatible with
# manifest v1.5? "CSE manifest magic number not found"
set(UNSUPPORTED_RI skl kbl)

if(${fw_name} IN_LIST UNSIGNED_RI) # mere copy
add_custom_command(OUTPUT reproducible.ri
COMMENT "Copying sof.ri to reproducible.ri as is"
# TODO: drop the glue_binary_files dependency once the
# edit-in-place and add_custom_target() messes are all fixed
DEPENDS glue_binary_files sof-${fw_name}.ri
COMMAND cmake -E copy sof-${fw_name}.ri reproducible.ri
VERBATIM
)
elseif(${fw_name} IN_LIST UNSUPPORTED_RI)
add_custom_command(OUTPUT reproducible.ri
COMMENT "WARNING: sof-${fw_name}.ri is NOT reproducible, reproducible.ri is fake"
DEPENDS glue_binary_files sof-${fw_name}.ri
COMMAND cmake -E touch reproducible.ri
VERBATIM
)
else() # strip variables
add_custom_command(OUTPUT reproducible.ri
COMMENT "Creating reproducible.ri"
DEPENDS glue_binary_files sof-${fw_name}.ri
COMMAND ${PROJECT_SOURCE_DIR}/tools/sof_ri_info/sof_ri_info.py
--no_headers --no_modules --no_memory # could use a -q option...
--erase_vars reproducible.ri sof-${fw_name}.ri
VERBATIM
)
endif()


# Top-level 'bin' target collecting all dependencies. Copies final .ri
# file from current subdirectory to top level build directory
# ${PROJECT_BINARY_DIR}.

# TODO: get rid of ${fw_output_name} and ${fw_name} below. Different
# platforms are already built in different build directories, we will
# never support building multiple platforms in the same build directory.
Expand All @@ -551,7 +600,7 @@ else()
bin ALL
COMMAND ${CMAKE_COMMAND} -E copy sof-${fw_name}.ri ${PROJECT_BINARY_DIR}/sof-${fw_output_name}.ri
COMMAND ${CMAKE_COMMAND} -E copy sof-${fw_name}.ri ${PROJECT_BINARY_DIR}/sof.ri
DEPENDS run_meu bin_extras glue_binary_files sof_dump
DEPENDS run_meu bin_extras glue_binary_files sof_dump reproducible.ri
VERBATIM
USES_TERMINAL
)
Expand Down
Loading