diff options
author | Yi Zhao <yi.zhao@windriver.com> | 2019-12-13 17:09:13 +0800 |
---|---|---|
committer | Jia Zhang <zhang.jia@linux.alibaba.com> | 2019-12-13 18:50:47 +0800 |
commit | c0e7d60718fd0e81776396413970293729487fc3 (patch) | |
tree | f7a891dcbc3382b799ad7eb668710824f6fe372c | |
parent | f59b77b257b12a290e93a185d6499cdabc80a66c (diff) | |
download | meta-secure-core-c0e7d60718fd0e81776396413970293729487fc3.tar.gz |
grub-efi-efi-secure-boot.inc: use task_prepend instead of prefuncs for do_sign
The grub-efi-native build doesn't need to run do_sign task but there are
two prefuncs for do_sign still run in native build. This will cause a
build error when there is no gpg command on the host. Move the functions
to do_sign_prepend_class-target to make sure they only run in target
build.
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
-rw-r--r-- | meta-efi-secure-boot/recipes-bsp/grub/grub-efi-efi-secure-boot.inc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/meta-efi-secure-boot/recipes-bsp/grub/grub-efi-efi-secure-boot.inc b/meta-efi-secure-boot/recipes-bsp/grub/grub-efi-efi-secure-boot.inc index 6d1d284..b2bfdaa 100644 --- a/meta-efi-secure-boot/recipes-bsp/grub/grub-efi-efi-secure-boot.inc +++ b/meta-efi-secure-boot/recipes-bsp/grub/grub-efi-efi-secure-boot.inc | |||
@@ -142,6 +142,12 @@ do_install_append_class-target() { | |||
142 | rm -f ${D}${EFI_BOOT_PATH}/${GRUB_TARGET}-efi/*.module | 142 | rm -f ${D}${EFI_BOOT_PATH}/${GRUB_TARGET}-efi/*.module |
143 | } | 143 | } |
144 | 144 | ||
145 | python do_sign_prepend_class-target() { | ||
146 | bb.build.exec_func("check_deploy_keys", d) | ||
147 | if d.getVar('GRUB_SIGN_VERIFY') == '1': | ||
148 | bb.build.exec_func("check_boot_public_key", d) | ||
149 | } | ||
150 | |||
145 | fakeroot python do_sign_class-target() { | 151 | fakeroot python do_sign_class-target() { |
146 | image_dir = d.getVar('D', True) | 152 | image_dir = d.getVar('D', True) |
147 | efi_boot_path = d.getVar('EFI_BOOT_PATH', True) | 153 | efi_boot_path = d.getVar('EFI_BOOT_PATH', True) |
@@ -160,8 +166,6 @@ fakeroot python do_sign_class-target() { | |||
160 | python do_sign() { | 166 | python do_sign() { |
161 | } | 167 | } |
162 | addtask sign after do_install before do_deploy do_package | 168 | addtask sign after do_install before do_deploy do_package |
163 | do_sign[prefuncs] += "check_deploy_keys" | ||
164 | do_sign[prefuncs] += "${@'check_boot_public_key' if d.getVar('GRUB_SIGN_VERIFY', True) == '1' else ''}" | ||
165 | 169 | ||
166 | fakeroot do_chownboot() { | 170 | fakeroot do_chownboot() { |
167 | chown root:root -R "${D}${EFI_BOOT_PATH}/grub.cfg${SB_FILE_EXT}" | 171 | chown root:root -R "${D}${EFI_BOOT_PATH}/grub.cfg${SB_FILE_EXT}" |