Skip to content

Commit 9782b2c

Browse files
marc-hbcarlescufi
authored andcommitted
scripts: intel_adsp: always invoke west sign
west flash invokes west build and we have no way to tell whether there was any code change. Also remove the rename() trick that achieved the same effect in a a confusing way; just use copy() instead. Signed-off-by: Marc Herbert <[email protected]>
1 parent 739aa95 commit 9782b2c

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

scripts/west_commands/runners/intel_adsp.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,15 @@ def do_create(cls, cfg, args):
8686
def do_run(self, command, **kwargs):
8787
self.logger.info('Starting Intel ADSP runner')
8888

89-
# If the zephyr.ri is not existing, it will build and sign it.
90-
if self.bin_fw is None or not os.path.isfile(self.bin_fw):
91-
self.sign(**kwargs)
89+
# Always re-sign because here we cannot know whether `west
90+
# flash` was invoked with `--skip-rebuild` or not and we have no
91+
# way to tell whether there was any code change either.
92+
#
93+
# Signing does not belong here; it should be invoked either from
94+
# some CMakeLists.txt file or an optional hook in some generic
95+
# `west flash` code but right now it's in neither so we have to
96+
# do this.
97+
self.sign(**kwargs)
9298

9399
if re.search("intel_adsp_cavs", self.platform):
94100
self.require(self.cavstool)
@@ -112,7 +118,7 @@ def flash(self, **kwargs):
112118
random_str = f"{random.getrandbits(64)}".encode()
113119
hash_object.update(random_str)
114120
send_bin_fw = str(self.bin_fw + "." + hash_object.hexdigest())
115-
os.rename(self.bin_fw, send_bin_fw)
121+
shutil.copy(self.bin_fw, send_bin_fw)
116122

117123
# Copy the zephyr to target remote ADSP host and run
118124
self.run_cmd = ([f'{self.cavstool}','-s', f'{self.remote_host}', f'{send_bin_fw}'])

0 commit comments

Comments
 (0)