Jelajahi Sumber

swupdate-common: Fix signing subprocess call

The subprocess call in prepare_sw_description to sign firmware was
modifed from os.system to subprocess.run commit a5526cc.  If multiple
commands are chained in SWUPDATE_SIGN_TOOL with ";", "&&", or "||", only
the first command is now evaluated.
This behavior was readded by setting shell=True in the subprocess call
along with joining args to a single string.

Signed-off-by: Colin McAllister <colin.mcallister@garmin.com>
Colin McAllister 3 tahun lalu
induk
melakukan
3281157bac
1 mengubah file dengan 1 tambahan dan 1 penghapusan
  1. 1 1
      classes/swupdate-common.bbclass

+ 1 - 1
classes/swupdate-common.bbclass

@@ -288,7 +288,7 @@ def prepare_sw_description(d):
             signcmd = ["openssl", "cms", "-sign", "-in", sw_desc, "-out", sw_desc_sig, "-signer", cms_cert, "-inkey", cms_key] + get_pwd_file_args() + ["-outform", "DER", "-nosmimecap", "-binary"]
         else:
             bb.fatal("Unrecognized SWUPDATE_SIGNING mechanism.")
-        subprocess.run(signcmd, check=True)
+        subprocess.run(' '.join(signcmd), shell=True, check=True)
 
 
 def swupdate_add_src_uri(d, list_for_cpio):