summaryrefslogtreecommitdiffstats
path: root/meta-signing-key/recipes-devtools/sbsigntool/sbsigntool_git.bb
blob: 65d1fdc60f81c1592785d5549e66c927af4bd4d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
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://git.kernel.org/pub/scm/linux/kernel/git/jejb/sbsigntools \
    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"