Skip to content

meta-tegra use of TEGRA_UEFI_DB_* does not create signatures allowing UEFI to load syslinux.cfg #1203

@mmitchel

Description

@mmitchel

Following a flashing with the TEGRA_UEFI_DB* variables set, it appears that the built
edk2-firmware-tegra refuses to load syslinux.cfg due to a missing signature. UEFI_SIGN_ENABLE
being set in local.conf does not produce a detached signature either. Relevant to local.conf:

UEFI_SIGN_ENABLE = "1"
TEGRA_UEFI_DB_KEY = "${UEFI_SIGN_KEYDIR}/DB.key"
TEGRA_UEFI_DB_CERT = "${UEFI_SIGN_KEYDIR}/DB.crt"

Output from the boot console:

L4TLauncher: Attempting Direct Boot
OpenAndReadUntrustedFileToBuffer: Failed to open boot\loader\syslinux.cfg.sig: Not Found
ProcessExtLinuxConfig:sds Failed to Authenticate boot\loader\syslinux.cfg (Not Found)
L4TLauncher: Unable to process extlinux config: Not Found
L4TLauncher: Attempting Kernel Boot
Header not seen at either offset 0 or offset 0x1000
Failed to boot kernel:0 partition

generation of dtbo for UEFI with tegra-uefi-keys-dtb.bbappend

require recipes-bsp/tegra-binaries/tegra-binaries-35.3.1.inc
require recipes-bsp/tegra-binaries/tegra-shared-binaries.inc

PV = "${L4T_VERSION}"
PR = "r0"

DEPENDS = "dtc-native efitools-native python3-native tegra-binaries util-linux-native"

do_configure () {
    [[ -n "${UEFI_SIGN_KEYDIR}" ]] || bbfatal "UEFI_SIGN_KEYDIR is not set"
    [[ -n "${TEGRA_UEFI_DB_KEY}" ]] || bbfatal "TEGRA_UEFI_DB_KEY is not set"
    [[ -n "${TEGRA_UEFI_DB_CERT}" ]] || bbfatal "TEGRA_UEFI_DB_CERT is not set"
    install -t ${B} \
        ${UEFI_SIGN_KEYDIR}/PK.key ${UEFI_SIGN_KEYDIR}/PK.crt \
        ${UEFI_SIGN_KEYDIR}/KEK.key ${UEFI_SIGN_KEYDIR}/KEK.crt \
        ${UEFI_SIGN_KEYDIR}/DB.key ${UEFI_SIGN_KEYDIR}/DB.crt
}

do_compile () {
    cat > ${B}/uefi_keys.conf <<EOF
UEFI_PK_KEY_FILE="PK.key";
UEFI_PK_CERT_FILE="PK.crt";
UEFI_KEK_KEY_FILE="KEK.key";
UEFI_KEK_CERT_FILE="KEK.crt";
UEFI_DB_1_KEY_FILE="DB.key";
UEFI_DB_1_CERT_FILE="DB.crt";
EOF
    ${S}/tools/gen_uefi_default_keys_dts.sh ${B}/uefi_keys.conf
}

do_install[noexec] = "1"

do_deploy () {
    install -d ${DEPLOYDIR}
    install -m 0644 -t ${DEPLOYDIR} ${B}/UefiDefaultSecurityKeys.dtbo
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions