From patchwork Thu Mar 18 15:42:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "D. Olsson" X-Patchwork-Id: 1455340 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=2605:bc80:3010::136; helo=smtp3.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=senzilla.io header.i=@senzilla.io header.a=rsa-sha256 header.s=protonmail3 header.b=i8TXWQHZ; dkim-atps=neutral Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4F1Wk420mXz9sS8 for ; Fri, 19 Mar 2021 02:52:12 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 8C98A6064D; Thu, 18 Mar 2021 15:52:07 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2gIVP4uszy8H; Thu, 18 Mar 2021 15:52:06 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp3.osuosl.org (Postfix) with ESMTP id C344460601; Thu, 18 Mar 2021 15:52:05 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 14BCA1BF341 for ; Thu, 18 Mar 2021 15:51:15 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id ADC9D4EE34 for ; Thu, 18 Mar 2021 15:51:14 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp4.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=senzilla.io Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8c2s7Nl4tG5h for ; Thu, 18 Mar 2021 15:51:13 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 Received: from mail-41103.protonmail.ch (mail-41103.protonmail.ch [185.70.41.103]) by smtp4.osuosl.org (Postfix) with ESMTPS id B47404EE32 for ; Thu, 18 Mar 2021 15:51:13 +0000 (UTC) Received: from mail-02.mail-europe.com (mail-02.mail-europe.com [51.89.119.103]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by mail-41103.protonmail.ch (Postfix) with ESMTPS id 4F1WWg3NVqz4wx7y for ; Thu, 18 Mar 2021 15:43:11 +0000 (UTC) Authentication-Results: mail-41103.protonmail.ch; dkim=pass (2048-bit key) header.d=senzilla.io header.i=@senzilla.io header.b="i8TXWQHZ" Date: Thu, 18 Mar 2021 15:42:56 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=senzilla.io; s=protonmail3; t=1616082180; bh=g1cbXOeDJcwpLdXL8Ngb5Z0sdSc/RUH5N/Nx/Pg09K8=; h=Date:To:From:Cc:Reply-To:Subject:From; b=i8TXWQHZxCU0UfvMjp3GN7jHBqrfMOSXxb9j1sbjMXuYgHcFKEUXCIb1rqr8RZtBd PO6QqEcGjOWuigPuIrbShZ13xHzlpMx4udcIhinQLvNFYREjxbnE04HZrW97d69MxE /MqmrnUHi/tYv9XlpAesMBMPKUx7Hk9Uy62x4YOs34CfLJtkJsY0PQ3HmKpFqjJ9uY qJ1nShP0D7mLetvK1qgGHGxlBhkmXxbERPRZDw7o5S7fgTs1u/iTPsurLDJdYCt8m5 dU+F4qn34wrpOy5gNByRwVQ2nQ1jMkoZLDEmqHVgdQlErLGB4Nkd46UiwhjLNqMNDF D2e68okgMs/Yg== To: buildroot@buildroot.org Message-ID: MIME-Version: 1.0 Subject: [Buildroot] [PATCH v4 04/10] configs/aarch64_efi_defconfig: build the EDK2 firmware from source X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Dick Olsson via buildroot Reply-To: Dick Olsson Cc: Dick Olsson Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Prior to this, you had to manually download a pre-built EDK2 flash device image (QEMU_EFI.fd) in order to boot this configuration with QEMU. Now, the configuration is building EDK2 from source. Signed-off-by: Dick Olsson --- Revision 4: * Addressed review items from Yann E. MORIN * Simplified resizing of the flash images with the trucate command Revision 3: * post-image.sh will now provide resized flash devices * readme.txt suggests pflash instead of bios Revision 2: * Explicitly added the default EDK2 platform to defconfig Signed-off-by: Dick Olsson --- board/aarch64-efi/post-image.sh | 6 +++++- board/aarch64-efi/readme.txt | 9 ++++----- configs/aarch64_efi_defconfig | 2 ++ 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/board/aarch64-efi/post-image.sh b/board/aarch64-efi/post-image.sh index f0214dc866..63a582d99a 100755 --- a/board/aarch64-efi/post-image.sh +++ b/board/aarch64-efi/post-image.sh @@ -1,5 +1,9 @@ -#!/bin/sh +#!/bin/bash BOARD_DIR="$(dirname $0)" cp -f ${BOARD_DIR}/grub.cfg ${BINARIES_DIR}/efi-part/EFI/BOOT/grub.cfg + +# The QEMU virt machine expects flash devices to be 64M. +truncate -s 64M "${BINARIES_DIR}/QEMU_EFI.fd" +truncate -s 64M "${BINARIES_DIR}/QEMU_VARS.fd" diff --git a/board/aarch64-efi/readme.txt b/board/aarch64-efi/readme.txt index 65a6345b6c..d0f900c616 100644 --- a/board/aarch64-efi/readme.txt +++ b/board/aarch64-efi/readme.txt @@ -22,13 +22,12 @@ qemu-system-aarch64 \ -cpu cortex-a57 \ -m 512 \ -nographic \ - -bios \ + -drive file=output/images/QEMU_EFI_RESIZED.fd,if=pflash,format=raw \ + -drive file=output/images/QEMU_VARS_RESIZED.fd,if=pflash,format=raw \ -drive file=output/images/disk.img,if=none,format=raw,id=hd0 \ -device virtio-blk-device,drive=hd0 \ -netdev user,id=eth0 \ -device virtio-net-device,netdev=eth0 -Note that needs to point to a valid aarch64 UEFI -firmware image for qemu. -It may be provided by your distribution as a edk2-aarch64 or AAVMF -package, in path such as /usr/share/edk2/aarch64/QEMU_EFI.fd . +Note that output/images/QEMU_*.fd are the flash device files built by +the EDK2 package. diff --git a/configs/aarch64_efi_defconfig b/configs/aarch64_efi_defconfig index 99600575ed..0e8d7f8c1c 100644 --- a/configs/aarch64_efi_defconfig +++ b/configs/aarch64_efi_defconfig @@ -12,6 +12,8 @@ BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y BR2_PACKAGE_HOST_GENIMAGE=y # Bootloader +BR2_TARGET_EDK2=y +BR2_TARGET_EDK2_PLATFORM_ARM_VIRT_QEMU=y BR2_TARGET_GRUB2=y BR2_TARGET_GRUB2_ARM64_EFI=y