All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jon Mason <jdmason@kudzu.us>
To: Javier Tia <javier.tia@linaro.org>
Cc: meta-arm@lists.yoctoproject.org,
	Mikko Rapeli <mikko.rapeli@linaro.org>,
	Ross Burton <Ross.Burton@arm.com>, Jon Mason <jon.mason@arm.com>
Subject: Re: [PATCH v4 10/13] linux-yocto: Setup UEFI and sign kernel image
Date: Fri, 30 Aug 2024 11:16:34 -0400	[thread overview]
Message-ID: <ZtHiUh717gEP6T05@kudzu.us> (raw)
In-Reply-To: <20240829163209.47945-11-javier.tia@linaro.org>

On Thu, Aug 29, 2024 at 10:32:06AM -0600, Javier Tia wrote:
> efivarfs kernel module is required to access EFI vars.
> 
> Signed-off-by: Javier Tia <javier.tia@linaro.org>
> ---
>  .../core-image-minimal-uefi-secureboot.inc    |  8 ++++++++
>  .../linux/linux-yocto%.bbappend               |  2 ++
>  .../linux/linux-yocto-uefi-secureboot.inc     | 19 +++++++++++++++++++
>  3 files changed, 29 insertions(+)
>  create mode 100644 meta-arm/recipes-kernel/linux/linux-yocto-uefi-secureboot.inc
> 
> diff --git a/meta-arm/recipes-core/images/core-image-minimal-uefi-secureboot.inc b/meta-arm/recipes-core/images/core-image-minimal-uefi-secureboot.inc
> index 2232d3b3..06046f6e 100644
> --- a/meta-arm/recipes-core/images/core-image-minimal-uefi-secureboot.inc
> +++ b/meta-arm/recipes-core/images/core-image-minimal-uefi-secureboot.inc
> @@ -1,3 +1,11 @@
>  inherit uefi-sb-keys
>  
>  WKS_FILE = "efi-disk-no-swap.wks.in"
> +
> +# Detected by passing kernel parameter
> +QB_KERNEL_ROOT = ""
> +
> +# kernel is in the image, should not be loaded separately
> +QB_DEFAULT_KERNEL = "none"
> +

QB's are qemu testing variables.  I don't think they should be here.
Either move them to the machine conf, or the yml file, or make a
machine just for this based on qemuarm64-secureboot.

> +KERNEL_IMAGETYPE = "Image"
> diff --git a/meta-arm/recipes-kernel/linux/linux-yocto%.bbappend b/meta-arm/recipes-kernel/linux/linux-yocto%.bbappend
> index a287d0e1..29c21355 100644
> --- a/meta-arm/recipes-kernel/linux/linux-yocto%.bbappend
> +++ b/meta-arm/recipes-kernel/linux/linux-yocto%.bbappend
> @@ -25,3 +25,5 @@ SRC_URI:append:qemuarm = " \
>  
>  FFA_TRANSPORT_INCLUDE = "${@bb.utils.contains('MACHINE_FEATURES', 'arm-ffa', 'arm-ffa-transport.inc', '' , d)}"
>  require ${FFA_TRANSPORT_INCLUDE}
> +
> +require ${@bb.utils.contains('MACHINE_FEATURES', 'uefi-secureboot', 'linux-yocto-uefi-secureboot.inc', '', d)}
> \ No newline at end of file
> diff --git a/meta-arm/recipes-kernel/linux/linux-yocto-uefi-secureboot.inc b/meta-arm/recipes-kernel/linux/linux-yocto-uefi-secureboot.inc
> new file mode 100644
> index 00000000..cb62fdee
> --- /dev/null
> +++ b/meta-arm/recipes-kernel/linux/linux-yocto-uefi-secureboot.inc
> @@ -0,0 +1,19 @@
> +KERNEL_FEATURES += "cfg/efi-ext.scc"
> +
> +DEPENDS += 'gen-uefi-sb-keys'
> +
> +inherit sbsign
> +
> +SBSIGN_KEY = "${UEFI_SB_KEYS_DIR}/db.key"
> +SBSIGN_CERT = "${UEFI_SB_KEYS_DIR}/db.crt"
> +
> +# shell variable set inside do_compile task
> +SBSIGN_TARGET_BINARY = "$KERNEL_IMAGE"
> +
> +do_compile:append() {
> +    KERNEL_IMAGE=$(find ${B} -name ${KERNEL_IMAGETYPE} -print -quit)
> +    do_sbsign
> +}
> +
> +RRECOMMENDS:${PN} += "kernel-module-efivarfs"
> +RRECOMMENDS:${PN} += "kernel-module-efivars"
> -- 
> 2.46.0
> 
> 


  reply	other threads:[~2024-08-30 15:16 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-29 16:31 [PATCH v4 00/13] qemuarm64-secureboot: Add UEFI Secure Boot Javier Tia
2024-08-29 16:31 ` [PATCH v4 01/13] qemuarm64-secureboot: Introduce uefi-secureboot machine feature Javier Tia
2024-08-30 15:42   ` Jon Mason
2024-08-29 16:31 ` [PATCH v4 02/13] core-image-minimal: Use UEFI layout disk partitions Javier Tia
2024-08-30 15:32   ` Jon Mason
2024-08-29 16:31 ` [PATCH v4 03/13] layer.conf: Introduce UEFI_SB_KEYS_DIR Javier Tia
2024-08-30 14:00   ` Jon Mason
2024-08-29 16:32 ` [PATCH v4 04/13] uefi-sb-keys.bbclass: Add class to validate UEFI keys Javier Tia
2024-08-30 14:03   ` Jon Mason
2024-08-29 16:32 ` [PATCH v4 05/13] sbsign.bbclass: Add class to sign binaries Javier Tia
2024-08-30 14:12   ` Jon Mason
2024-09-02  6:35     ` Mikko Rapeli
2024-08-29 16:32 ` [PATCH v4 06/13] core-image-minimal: Inherit uefi-sb-keys Javier Tia
2024-08-30 14:14   ` Jon Mason
2024-08-29 16:32 ` [PATCH v4 07/13] meta-arm: Introduce gen-uefi-sb-keys.bb recipe Javier Tia
2024-08-30 14:17   ` Jon Mason
2024-08-29 16:32 ` [PATCH v4 08/13] u-boot: Setup UEFI and Secure Boot Javier Tia
2024-08-30 14:23   ` Jon Mason
2024-08-29 16:32 ` [PATCH v4 09/13] qemuarm64-secureboot: Add meta-secure-core layer as dependency Javier Tia
2024-08-30 15:03   ` Jon Mason
2024-08-29 16:32 ` [PATCH v4 10/13] linux-yocto: Setup UEFI and sign kernel image Javier Tia
2024-08-30 15:16   ` Jon Mason [this message]
2024-08-29 16:32 ` [PATCH v4 11/13] systemd: Add UEFI support Javier Tia
2024-08-30 15:24   ` Jon Mason
2024-09-02  6:43     ` Mikko Rapeli
2024-08-29 16:32 ` [PATCH v4 12/13] systemd-boot: Use it as bootloader & sign UEFI image Javier Tia
2024-08-29 16:32 ` [PATCH v4 13/13] meta-arm: Add UEFI Secure Boot test Javier Tia
2024-08-30 15:28   ` Jon Mason
2024-08-30  3:06 ` [PATCH v4 00/13] qemuarm64-secureboot: Add UEFI Secure Boot Jon Mason
2024-08-30  6:10   ` Mikko Rapeli
2024-08-30 13:24     ` Jon Mason
2024-09-02 17:53       ` Javier Tia

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZtHiUh717gEP6T05@kudzu.us \
    --to=jdmason@kudzu.us \
    --cc=Ross.Burton@arm.com \
    --cc=javier.tia@linaro.org \
    --cc=jon.mason@arm.com \
    --cc=meta-arm@lists.yoctoproject.org \
    --cc=mikko.rapeli@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.