From patchwork Wed Sep 26 22:37:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Erico Nunes X-Patchwork-Id: 975482 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="pr8GuZ5L"; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42LCWT5FHqz9s47 for ; Thu, 27 Sep 2018 08:37:57 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id CF2A086A0C; Wed, 26 Sep 2018 22:37:52 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rVVXtx31nnYN; Wed, 26 Sep 2018 22:37:50 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id D4A8B86A6F; Wed, 26 Sep 2018 22:37:50 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id BBCC61C14A4 for ; Wed, 26 Sep 2018 22:37:44 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id B987F867F2 for ; Wed, 26 Sep 2018 22:37:44 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 12NASDU-RDD5 for ; Wed, 26 Sep 2018 22:37:43 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by whitealder.osuosl.org (Postfix) with ESMTPS id 0D42E86785 for ; Wed, 26 Sep 2018 22:37:43 +0000 (UTC) Received: by mail-wm1-f66.google.com with SMTP id n23-v6so65058wmc.1 for ; Wed, 26 Sep 2018 15:37:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=sdPDXLz8aIMP2Lu0ESQy9825G2nKdSJ1kelpdLA4QIA=; b=pr8GuZ5LE2wXmKO+IvqNTUFM9nMfJOXBgRyEkmuYcd4yeF7hGHj7cRF9Jwwf/tx56M YZSH7lpjiCEz3P66cqKmhABpbEGC3Xq6qWOguOJJm2q3+hVZrD/9G6GY4z5NRZS0IbnG j6oU+2szuAOVT3TvshNvyqxmh6+4dEAI52VcUnWZNFc0HFw35khhENxRELYm6O52yhk9 k8a99Qvv4dk8dzaFer30SMng7J7gL8qnQggb3oY4yxeobQeyoSsUM95Z6TxQXTcAlEMh wKhrL9t1CbBZWPcn0IoA3VLsOOwz7f2SoRvKTENMNBsXx8JpAqzxHA9Lx06xZufYSA30 OqGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=sdPDXLz8aIMP2Lu0ESQy9825G2nKdSJ1kelpdLA4QIA=; b=JADiM7z4S5KvGyOI7Ey7eoiGLszK5PCd8qWmTa6QqR+y2q+ycWvV+WyAHzvvMP6VL4 eBWCf3lOFGB0QMkcr49OBILeuI1DgQHCqqg4nrDljsYkE+Zeh8hwNVd7Uf4zsmnSZqcr czP3MuM7qUxvNdHt0+u8mxqvWRD0lXwUMvMuZTGiYe1Oq8q6flZByueYBenNh/hEmls/ Qnr/BWO9LY3o71ImgbR/nvq42Q0d5Wg1l7yrp/Tju0sYDpFOxFfL3QkGD1v3wd41oC60 LLjn8Y1/nYxRsFwkTjTorY74YSxs9U1DzuUmAPPNG8hmhi5yb/5tAZm2b0lg9qhOk//7 a67A== X-Gm-Message-State: ABuFfojmVXcmwdcgv4sfIW8z4UJDKfTLMCCGjYSPqTeOrNpEhjN3Dt6m V8HsEBHUC8UJvgNk8wuHbRNwQT4d X-Google-Smtp-Source: ACcGV61N8uPLnwng10I+z7dg12igzaKTvtKA+8ekB3UZ3xYgZCL2Km3eHMtBS9MTRGKOlJSNSShylw== X-Received: by 2002:a1c:7212:: with SMTP id n18-v6mr5974619wmc.33.1538001461323; Wed, 26 Sep 2018 15:37:41 -0700 (PDT) Received: from localhost.localdomain (ip-78-102-114-60.net.upcbroadband.cz. [78.102.114.60]) by smtp.gmail.com with ESMTPSA id x132-v6sm6438230wmg.3.2018.09.26.15.37.40 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 26 Sep 2018 15:37:40 -0700 (PDT) From: Erico Nunes To: buildroot@buildroot.org Date: Thu, 27 Sep 2018 00:37:18 +0200 Message-Id: <20180926223719.12604-5-nunes.erico@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180926223719.12604-1-nunes.erico@gmail.com> References: <20180926223719.12604-1-nunes.erico@gmail.com> Subject: [Buildroot] [PATCH v3 4/5] configs/aarch64_efi_defconfig: new defconfig X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Petazzoni MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" New generic defconfig for aarch64, to run on aarch64 servers compliant with EFI firmware and ACPI. This can also be tested with qemu, and is useful so that we have an arm defconfig with grub enabled. Tested with qemu 2.11.2 and AAVMF, the aarch64 virtual machine UEFI firmware. Signed-off-by: Erico Nunes --- board/aarch64-efi/genimage-efi.cfg | 30 +++++++++++++++++++++++++++ board/aarch64-efi/grub.cfg | 6 ++++++ board/aarch64-efi/post-image.sh | 5 +++++ board/aarch64-efi/readme.txt | 17 +++++++++++++++ configs/aarch64_efi_defconfig | 33 ++++++++++++++++++++++++++++++ 5 files changed, 91 insertions(+) create mode 100644 board/aarch64-efi/genimage-efi.cfg create mode 100644 board/aarch64-efi/grub.cfg create mode 100755 board/aarch64-efi/post-image.sh create mode 100644 board/aarch64-efi/readme.txt create mode 100644 configs/aarch64_efi_defconfig diff --git a/board/aarch64-efi/genimage-efi.cfg b/board/aarch64-efi/genimage-efi.cfg new file mode 100644 index 0000000000..f93ab9d64f --- /dev/null +++ b/board/aarch64-efi/genimage-efi.cfg @@ -0,0 +1,30 @@ +image efi-part.vfat { + vfat { + file startup.nsh { + image = "efi-part/startup.nsh" + } + file EFI { + image = "efi-part/EFI" + } + file Image { + image = "Image" + } + } + size = 32M +} + +image disk.img { + + hdimage { + } + + partition boot { + partition-type = 0xEF + image = "efi-part.vfat" + } + + partition root { + partition-type = 0x83 + image = "rootfs.ext2" + } +} diff --git a/board/aarch64-efi/grub.cfg b/board/aarch64-efi/grub.cfg new file mode 100644 index 0000000000..ab88da91b9 --- /dev/null +++ b/board/aarch64-efi/grub.cfg @@ -0,0 +1,6 @@ +set default="0" +set timeout="5" + +menuentry "Buildroot" { + linux /Image root=/dev/vda2 rootwait console=ttyAMA0 +} diff --git a/board/aarch64-efi/post-image.sh b/board/aarch64-efi/post-image.sh new file mode 100755 index 0000000000..f0214dc866 --- /dev/null +++ b/board/aarch64-efi/post-image.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +BOARD_DIR="$(dirname $0)" + +cp -f ${BOARD_DIR}/grub.cfg ${BINARIES_DIR}/efi-part/EFI/BOOT/grub.cfg diff --git a/board/aarch64-efi/readme.txt b/board/aarch64-efi/readme.txt new file mode 100644 index 0000000000..e62278f6d2 --- /dev/null +++ b/board/aarch64-efi/readme.txt @@ -0,0 +1,17 @@ +Run the emulation with: + +qemu-system-aarch64 \ + -M virt \ + -cpu cortex-a57 \ + -m 512 \ + -nographic \ + -bios \ + -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 . diff --git a/configs/aarch64_efi_defconfig b/configs/aarch64_efi_defconfig new file mode 100644 index 0000000000..e4e20b09ba --- /dev/null +++ b/configs/aarch64_efi_defconfig @@ -0,0 +1,33 @@ +# Architecture +BR2_aarch64=y + +# Toolchain, required for eudev and grub +BR2_TOOLCHAIN_BUILDROOT_WCHAR=y + +# System +BR2_TARGET_GENERIC_GETTY_PORT="ttyAMA0" +BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y + +## Required tools to create bootable media +BR2_PACKAGE_HOST_GENIMAGE=y + +# Bootloader +BR2_TARGET_GRUB2=y +BR2_TARGET_GRUB2_AARCH64_EFI=y + +# Filesystem / image +BR2_TARGET_ROOTFS_EXT2=y +BR2_TARGET_ROOTFS_EXT2_4=y +BR2_TARGET_ROOTFS_EXT2_SIZE="200M" +# BR2_TARGET_ROOTFS_TAR is not set +BR2_ROOTFS_POST_IMAGE_SCRIPT="board/aarch64-efi/post-image.sh support/scripts/genimage.sh" +BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/aarch64-efi/genimage-efi.cfg" + +# Linux headers same as kernel, a 4.18 series +BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_18=y + +# Kernel +BR2_LINUX_KERNEL=y +BR2_LINUX_KERNEL_CUSTOM_VERSION=y +BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.18.10" +BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y