summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYi Zhao <yi.zhao@windriver.com>2019-08-19 11:39:08 +0800
committerJia Zhang <zhang.jia@linux.alibaba.com>2019-08-19 13:47:55 +0800
commit1be79730bf8bf32a68800bd12dacda0773bb44fb (patch)
tree323e5470401d69d5f6df537144fce76d8edd82a9
parent8d1b7c2a29d89afcee97a723cbfd2c127686e57e (diff)
downloadmeta-secure-core-1be79730bf8bf32a68800bd12dacda0773bb44fb.tar.gz
meta-secure-core: use bb.fatal instead of bb.build.FuncFailed
The bb.build.FuncFailed had been removed in bitbake with commit cfeffb602dd5319f071cd6bcf84139ec77f2d170. Use bb.fatal instead of it. Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
-rw-r--r--meta-integrity/classes/sign_rpm_ext.bbclass6
-rw-r--r--meta-signing-key/classes/user-key-store.bbclass8
2 files changed, 6 insertions, 8 deletions
diff --git a/meta-integrity/classes/sign_rpm_ext.bbclass b/meta-integrity/classes/sign_rpm_ext.bbclass
index 8b25d74..25aa998 100644
--- a/meta-integrity/classes/sign_rpm_ext.bbclass
+++ b/meta-integrity/classes/sign_rpm_ext.bbclass
@@ -29,8 +29,7 @@ python check_rpm_public_key () {
29 (gpg_bin, gpg_path, d.getVar('RPM_GPG_PASSPHRASE', True), gpg_key) 29 (gpg_bin, gpg_path, d.getVar('RPM_GPG_PASSPHRASE', True), gpg_key)
30 status, output = oe.utils.getstatusoutput(cmd) 30 status, output = oe.utils.getstatusoutput(cmd)
31 if status: 31 if status:
32 raise bb.build.FuncFailed('Failed to import gpg key (%s): %s' % 32 bb.fatal('Failed to import gpg key (%s): %s' % (gpg_key, output))
33 (gpg_key, output))
34} 33}
35check_rpm_public_key[lockfiles] = "${TMPDIR}/check_rpm_public_key.lock" 34check_rpm_public_key[lockfiles] = "${TMPDIR}/check_rpm_public_key.lock"
36do_package_write_rpm[prefuncs] += "check_rpm_public_key" 35do_package_write_rpm[prefuncs] += "check_rpm_public_key"
@@ -46,6 +45,5 @@ python () {
46 if not os.path.exists(gpg_path): 45 if not os.path.exists(gpg_path):
47 status, output = oe.utils.getstatusoutput('mkdir -m 0700 -p %s' % gpg_path) 46 status, output = oe.utils.getstatusoutput('mkdir -m 0700 -p %s' % gpg_path)
48 if status: 47 if status:
49 raise bb.build.FuncFailed('Failed to create gpg keying %s: %s' % 48 bb.fatal('Failed to create gpg keying %s: %s' % (gpg_path, output))
50 (gpg_path, output))
51} 49}
diff --git a/meta-signing-key/classes/user-key-store.bbclass b/meta-signing-key/classes/user-key-store.bbclass
index aa027db..fbbac56 100644
--- a/meta-signing-key/classes/user-key-store.bbclass
+++ b/meta-signing-key/classes/user-key-store.bbclass
@@ -53,7 +53,7 @@ def sign_efi_image(key, cert, input, output, d):
53 try: 53 try:
54 result, _ = bb.process.run(cmd) 54 result, _ = bb.process.run(cmd)
55 except bb.process.ExecutionError: 55 except bb.process.ExecutionError:
56 raise bb.build.FuncFailed('ERROR: Unable to sign %s' % input) 56 bb.fatal('Unable to sign %s' % input)
57 57
58def edss_sign_efi_image(input, output, d): 58def edss_sign_efi_image(input, output, d):
59 # This function will be overloaded in pulsar-binary-release 59 # This function will be overloaded in pulsar-binary-release
@@ -136,7 +136,7 @@ def sel_sign(key, cert, input, d):
136 try: 136 try:
137 result, _ = bb.process.run(cmd) 137 result, _ = bb.process.run(cmd)
138 except bb.process.ExecutionError: 138 except bb.process.ExecutionError:
139 raise bb.build.FuncFailed('ERROR: Unable to sign %s' % input) 139 bb.fatal('Unable to sign %s' % input)
140 140
141def uks_sel_sign(input, d): 141def uks_sel_sign(input, d):
142 if d.getVar('UEFI_SB', True) != '1': 142 if d.getVar('UEFI_SB', True) != '1':
@@ -220,7 +220,7 @@ def pem2der(input, output, d):
220 try: 220 try:
221 result, _ = bb.process.run(cmd) 221 result, _ = bb.process.run(cmd)
222 except bb.process.ExecutionError: 222 except bb.process.ExecutionError:
223 raise bb.build.FuncFailed('ERROR: Unable to convert %s to %s' % (input, output)) 223 raise bb.fatal('Unable to convert %s to %s' % (input, output))
224 224
225# Convert the certificate (PEM formatted) to ESL. 225# Convert the certificate (PEM formatted) to ESL.
226__pem2esl() { 226__pem2esl() {
@@ -429,7 +429,7 @@ def sanity_check_user_keys(name, may_exit, d):
429 429
430 if _ == False: 430 if _ == False:
431 if may_exit: 431 if may_exit:
432 raise bb.build.FuncFailed('ERROR: Unable to find user key for %s ...' % name) 432 bb.fatal('Unable to find user key for %s ...' % name)
433 433
434 vprint('Failed to check the user keys for %s ...' % name, d) 434 vprint('Failed to check the user keys for %s ...' % name, d)
435 435