Skip to content

Commit a4ece86

Browse files
marc-hbkv2019i
authored andcommitted
xtensa-build-zephyr.py: drop intermediate build-$platf/sof-$platf.ri
Remove one intermediate and unnecessary .ri file. Simplify the code and the build directory. Example below with `sof-mtl.ri` for better readability but this applies the same to `sof-imx8.ri` and every other `sof-$platf.ri` file. There were 3 .ri copies before this commit: ``` build-mtl/zephyr/zephyr.ri copied to -> build-mtl/zephyr/sof-mtl.ri copied to -> build-sof-staging/___/sof-mtl.ri ``` Only 2 left after dropping the second and pointless copy: ``` build-mtl/zephyr/zephyr.ri copied to -> build-sof-staging/___/sof-mtl.ri ``` Fewer copies means less wondering about what is what, two identical files in the same directory is at best pointless and at worst misleading. The `build-mtl/` directory belongs to the zephyr build system exclusively, this wrapper script has no business interfering with `build-mtl`. `build-mtl/zephyr/sof-mtl.ri can even be dangerous because it does not get cleaned. Demonstration: ``` # Compile successfully $ ./scripts/xtensa-build-zephyr.py mtl # Write some code and make a mistake. # Fail to compile. $ echo BROKEN >> ../zephyr/kernel/sched.c $ ./scripts/xtensa-build-zephyr.py mtl # Obsolete .ri files are still there $ find ../build-mtl/ -name *.ri ../build-mtl/zephyr/zephyr.ri ../build-mtl/zephyr/sof-mtl.ri $ ninja -C ../build-mtl clean # Obsolete sof-mtl.ri is still there! $ find ../build-mtl/ -name *.ri ../build-mtl/zephyr/sof-mtl.ri ``` Signed-off-by: Marc Herbert <marc.herbert@intel.com>
1 parent 9c98cfd commit a4ece86

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

scripts/xtensa-build-zephyr.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -736,16 +736,13 @@ def install_platform(platform, sof_platform_output_dir, platf_build_environ):
736736
# Regular name
737737
output_fwname = "".join(["sof-", platform, ".ri"])
738738

739-
shutil.copy2(abs_build_dir / "zephyr.ri", abs_build_dir / output_fwname)
740-
fw_file_to_copy = abs_build_dir / output_fwname
741-
742739
install_key_dir = sof_platform_output_dir
743740
if args.key_type_subdir != "none":
744741
install_key_dir = install_key_dir / args.key_type_subdir
745742

746743
os.makedirs(install_key_dir, exist_ok=True)
747744
# looses file owner and group - file is commonly accessible
748-
shutil.copy2(fw_file_to_copy, install_key_dir)
745+
shutil.copy2(abs_build_dir / "zephyr.ri", install_key_dir / output_fwname)
749746

750747

751748
# sof-info/ directory

0 commit comments

Comments
 (0)