From e3f8b0e05405093f6c79e4b1b1dbcb3b2ea5d868 Mon Sep 17 00:00:00 2001 From: Tom Rini Date: Tue, 21 Aug 2018 16:15:02 -0400 Subject: sbsigntool: Enable nativesdk support There are times were we might want to include sbsigntool into an SDK so rename the recipe and extend to include nativesdk. We also need gnu-efi to support nativesdk so include that in a bbappend. Signed-off-by: Tom Rini --- .../recipes-bsp/gnu-efi/gnu-efi_%.bbappend | 1 + .../sbsigntool/sbsigntool-native_git.bb | 71 --------------------- .../recipes-devtools/sbsigntool/sbsigntool_git.bb | 73 ++++++++++++++++++++++ 3 files changed, 74 insertions(+), 71 deletions(-) create mode 100644 meta-efi-secure-boot/recipes-bsp/gnu-efi/gnu-efi_%.bbappend delete mode 100644 meta-signing-key/recipes-devtools/sbsigntool/sbsigntool-native_git.bb create mode 100644 meta-signing-key/recipes-devtools/sbsigntool/sbsigntool_git.bb diff --git a/meta-efi-secure-boot/recipes-bsp/gnu-efi/gnu-efi_%.bbappend b/meta-efi-secure-boot/recipes-bsp/gnu-efi/gnu-efi_%.bbappend new file mode 100644 index 0000000..2a59083 --- /dev/null +++ b/meta-efi-secure-boot/recipes-bsp/gnu-efi/gnu-efi_%.bbappend @@ -0,0 +1 @@ +BBCLASSEXTEND += "nativesdk" diff --git a/meta-signing-key/recipes-devtools/sbsigntool/sbsigntool-native_git.bb b/meta-signing-key/recipes-devtools/sbsigntool/sbsigntool-native_git.bb deleted file mode 100644 index f52b5fc..0000000 --- a/meta-signing-key/recipes-devtools/sbsigntool/sbsigntool-native_git.bb +++ /dev/null @@ -1,71 +0,0 @@ -SUMMARY = "Utilities for signing UEFI binaries for use with secure boot" - -LICENSE = "GPLv3" - -LIC_FILES_CHKSUM = "\ - file://LICENSE.GPLv3;md5=9eef91148a9b14ec7f9df333daebc746 \ - file://COPYING;md5=a7710ac18adec371b84a9594ed04fd20 \ -" - -DEPENDS += "binutils-native openssl-native gnu-efi-native util-linux-native" - -PV = "0.6+git${SRCPV}" - -SRC_URI = "\ - git://kernel.ubuntu.com/jk/sbsigntool \ - file://ccan.git.tar.bz2 \ - file://fix-mixed-implicit-and-normal-rules.patch;apply=0 \ - file://disable-man-page-creation.patch \ - file://Fix-for-multi-sign.patch \ - file://sbsign-add-x-option-to-avoid-overwrite-existing-sign.patch \ - file://image-fix-the-segment-fault-caused-by-the-uninitiali.patch \ - file://Fix-the-deprecated-ASN1_STRING_data-in-openssl-1.1.0.patch \ - file://Update-OpenSSL-API-usage-to-support-OpenSSL-1.1.patch \ -" -SRCREV="951ee95a301674c046f55330cd7460e1314deff2" - -S = "${WORKDIR}/git" - -inherit autotools-brokensep pkgconfig native - -def efi_arch(d): - import re - arch = d.getVar("TARGET_ARCH") - if re.match("i[3456789]86", arch): - return "ia32" - return arch - -# Avoids build breaks when using no-static-libs.inc -#DISABLE_STATIC_class-target = "" - -#EXTRA_OECONF_remove_class-target += "\ -# --with-libtool-sysroot \ -#" - -EXTRA_OEMAKE += "\ - INCLUDES='-I${S}/lib/ccan.git' \ - EFI_CPPFLAGS='-I${STAGING_INCDIR}/efi \ - -I${STAGING_INCDIR}/efi/${@efi_arch(d)}' \ -" - -do_configure() { - cd "${S}" - rm -rf "lib/ccan.git" - git clone "${WORKDIR}/ccan.git" lib/ccan.git - cd lib/ccan.git && \ - git apply "${WORKDIR}/fix-mixed-implicit-and-normal-rules.patch" && \ - cd - - - OLD_CC="${CC}" - - if [ ! -e lib/ccan ]; then - export CC="${BUILD_CC}" - lib/ccan.git/tools/create-ccan-tree \ - --build-type=automake lib/ccan \ - talloc read_write_all build_assert array_size endian || exit 1 - fi - - export CC="${OLD_CC}" - ./autogen.sh --noconfigure - oe_runconf -} diff --git a/meta-signing-key/recipes-devtools/sbsigntool/sbsigntool_git.bb b/meta-signing-key/recipes-devtools/sbsigntool/sbsigntool_git.bb new file mode 100644 index 0000000..a43afa1 --- /dev/null +++ b/meta-signing-key/recipes-devtools/sbsigntool/sbsigntool_git.bb @@ -0,0 +1,73 @@ +SUMMARY = "Utilities for signing UEFI binaries for use with secure boot" + +LICENSE = "GPLv3" + +LIC_FILES_CHKSUM = "\ + file://LICENSE.GPLv3;md5=9eef91148a9b14ec7f9df333daebc746 \ + file://COPYING;md5=a7710ac18adec371b84a9594ed04fd20 \ +" + +DEPENDS += "binutils openssl gnu-efi util-linux" + +PV = "0.6+git${SRCPV}" + +SRC_URI = "\ + git://kernel.ubuntu.com/jk/sbsigntool \ + file://ccan.git.tar.bz2 \ + file://fix-mixed-implicit-and-normal-rules.patch;apply=0 \ + file://disable-man-page-creation.patch \ + file://Fix-for-multi-sign.patch \ + file://sbsign-add-x-option-to-avoid-overwrite-existing-sign.patch \ + file://image-fix-the-segment-fault-caused-by-the-uninitiali.patch \ + file://Fix-the-deprecated-ASN1_STRING_data-in-openssl-1.1.0.patch \ + file://Update-OpenSSL-API-usage-to-support-OpenSSL-1.1.patch \ +" +SRCREV="951ee95a301674c046f55330cd7460e1314deff2" + +S = "${WORKDIR}/git" + +inherit autotools-brokensep pkgconfig + +def efi_arch(d): + import re + arch = d.getVar("TARGET_ARCH") + if re.match("i[3456789]86", arch): + return "ia32" + return arch + +# Avoids build breaks when using no-static-libs.inc +#DISABLE_STATIC_class-target = "" + +#EXTRA_OECONF_remove_class-target += "\ +# --with-libtool-sysroot \ +#" + +EXTRA_OEMAKE += "\ + INCLUDES='-I${S}/lib/ccan.git' \ + EFI_CPPFLAGS='-I${STAGING_INCDIR}/efi \ + -I${STAGING_INCDIR}/efi/${@efi_arch(d)}' \ +" + +do_configure() { + cd "${S}" + rm -rf "lib/ccan.git" + git clone "${WORKDIR}/ccan.git" lib/ccan.git + cd lib/ccan.git && \ + git apply "${WORKDIR}/fix-mixed-implicit-and-normal-rules.patch" && \ + cd - + + OLD_CC="${CC}" + + if [ ! -e lib/ccan ]; then + export CC="${BUILD_CC}" + lib/ccan.git/tools/create-ccan-tree \ + --build-type=automake lib/ccan \ + talloc read_write_all build_assert array_size endian || exit 1 + fi + + export CC="${OLD_CC}" + ./autogen.sh --noconfigure + oe_runconf +} + +BBCLASSEXTEND = "native nativesdk" -- cgit v1.2.3-54-g00ecf