summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKai Kang <kai.kang@windriver.com>2019-12-03 16:50:11 +0800
committerJia Zhang <zhang.jia@linux.alibaba.com>2021-04-21 12:57:22 +0800
commitf6963bf84b514d004ecfc738d57409f2fd92ecf2 (patch)
tree89143765fa21f9e1facbe90bab63d16ef2b159ba
parentb8040ed6cc4c0100b75bdeba08541e722e3f5094 (diff)
downloadmeta-secure-core-f6963bf84b514d004ecfc738d57409f2fd92ecf2.tar.gz
linux-yocto-efi-secure-boot.inc: fix rerun failure
Task do_sign of linux-yocto depends on variable GPG_PATH. When GPG_PATH changes, it fails to rerun the task: | Exception: FileExistsError: [Errno 17] File exists: | 'bzImage-5.2.24-yocto-standard.p7b' -> '/path/to/tmp-glibc/work/intel_x86_64-wrs-linux/linux-yocto/5.2.x+gitAUTOINC+bbe834c1d2_370ab92a1e-r0/image/boot/bzImage.p7b' Remove the link file before create it if exists already. Signed-off-by: Kai Kang <kai.kang@windriver.com>
-rw-r--r--meta-efi-secure-boot/recipes-kernel/linux/linux-yocto-efi-secure-boot.inc5
1 files changed, 4 insertions, 1 deletions
diff --git a/meta-efi-secure-boot/recipes-kernel/linux/linux-yocto-efi-secure-boot.inc b/meta-efi-secure-boot/recipes-kernel/linux/linux-yocto-efi-secure-boot.inc
index fae9673..27bb3a2 100644
--- a/meta-efi-secure-boot/recipes-kernel/linux/linux-yocto-efi-secure-boot.inc
+++ b/meta-efi-secure-boot/recipes-kernel/linux/linux-yocto-efi-secure-boot.inc
@@ -33,7 +33,10 @@ fakeroot python do_sign() {
33 shutil.copyfile(kernel, d.expand('${D}/boot/') + type + d.expand('-${KERNEL_RELEASE}')) 33 shutil.copyfile(kernel, d.expand('${D}/boot/') + type + d.expand('-${KERNEL_RELEASE}'))
34 ext = d.expand('${SB_FILE_EXT}') 34 ext = d.expand('${SB_FILE_EXT}')
35 shutil.copyfile(kernel + ext, d.expand('${D}/boot/') + type + d.expand('-${KERNEL_RELEASE}' + ext)) 35 shutil.copyfile(kernel + ext, d.expand('${D}/boot/') + type + d.expand('-${KERNEL_RELEASE}' + ext))
36 os.symlink(type + d.expand('-${KERNEL_RELEASE}' + ext), d.expand('${D}/boot/') + type + ext) 36 dst = d.expand('${D}/boot/') + type + ext
37 if os.path.exists(dst):
38 os.unlink(dst)
39 os.symlink(type + d.expand('-${KERNEL_RELEASE}' + ext), dst)
37} 40}
38 41
39# Make sure the kernel image has been signed before kernel_do_deploy() 42# Make sure the kernel image has been signed before kernel_do_deploy()