From patchwork Mon Nov 7 08:34:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emmanuel Vadot X-Patchwork-Id: 691825 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 3tC5PL6zNwz9vGR for ; Mon, 7 Nov 2016 19:35:50 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=bidouilliste.com header.i=@bidouilliste.com header.b="CK0vNREg"; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 57C33A75E9; Mon, 7 Nov 2016 09:35:34 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id w4U5LIflkcTx; Mon, 7 Nov 2016 09:35:34 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4A5EAA7579; Mon, 7 Nov 2016 09:35:27 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id EE183A75DE for ; Mon, 7 Nov 2016 09:35:21 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id eUzwXioQgnv3 for ; Mon, 7 Nov 2016 09:35:21 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) by theia.denx.de (Postfix) with ESMTPS id 066C3A75CF for ; Mon, 7 Nov 2016 09:35:15 +0100 (CET) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) by mail.blih.net (OpenSMTPD) with ESMTP id ead86db3 for ; Mon, 7 Nov 2016 09:35:14 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=bidouilliste.com; h=from :to:cc:subject:date:message-id:in-reply-to:references; s=mail; bh=m1YbmS/srurnW5++X4/aBESC5zo=; b=CK0vNREgJ7/KVZMKKw93fREtEe92 wFHs9Na1mCFRR7xXwuRGJf7yNBLNb1H19m+mtZniZKH7AC3R2XnY/IeGnVVnfFhz X2KP0CDonEOi+VzbauaQEcBS/aRgwIr/FWHalv0AKC0uRovF5Q1KUmKtivqWKgpx aLTZWqiGByBeThI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=bidouilliste.com; h=from:to :cc:subject:date:message-id:in-reply-to:references; q=dns; s= mail; b=fKvPZhYxiO01N5T+hvssWQ0Zn0uM2lbA++cfA1VHnn39SfB9ICIKEUYU 7GoRXuPOmQ4NhWSQIbPUhQ4vRQel+Z+DzNVtS0Ty64hPsTHniZVHR8nTiIs6zCdF Yg9vON0ca3Ej+yu+4b/4Kh8ppD3uFrGYNLXbLttKvFHkxVNMe/8= Received: from knuckles.blih.net (ip-54.net-82-216-203.roubaix.rev.numericable.fr [82.216.203.54]) by mail.blih.net (OpenSMTPD) with ESMTPSA id 700d7324 TLS version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NO for ; Mon, 7 Nov 2016 09:35:14 +0100 (CET) Received: from elbarto (uid 1001) (envelope-from manu@bidouilliste.com) id 386b5d by knuckles.blih.net (DragonFly Mail Agent v0.11); Mon, 07 Nov 2016 09:35:13 +0100 From: Emmanuel Vadot To: u-boot@lists.denx.de Date: Mon, 7 Nov 2016 09:34:31 +0100 Message-Id: <20161107083431.24855-5-manu@bidouilliste.com> X-Mailer: git-send-email 2.9.2 In-Reply-To: <20161107083431.24855-1-manu@bidouilliste.com> References: <20161107083431.24855-1-manu@bidouilliste.com> Subject: [U-Boot] [PATCH 4/4] distro_bootcmd: Add command to run FreeBSD X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Add commands that scans for the FreeBSD loader and run it if found. FreeBSD has two loader: ubldr which is an ELF binary and ubldr.bin which is a PIE binary. Signed-off-by: Emmanuel Vadot --- include/config_distro_bootcmd.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/include/config_distro_bootcmd.h b/include/config_distro_bootcmd.h index 9ecaf38..0f5d385 100644 --- a/include/config_distro_bootcmd.h +++ b/include/config_distro_bootcmd.h @@ -153,6 +153,36 @@ #define SCAN_DEV_FOR_EFI #endif +#ifdef CONFIG_FREEBSD +#define BOOTENV_SHARED_FREEBSD \ + "boot_freebsd_binary=" \ + "load ${devtype} ${devnum}:${distro_bootpart} " \ + "${kernel_addr_r} ubldr.bin; " \ + "go ${kernel_addr_r}\0" \ + \ + "boot_freebsd_elf=" \ + "load ${devtype} ${devnum}:${distro_bootpart} " \ + "${kernel_addr_r} ubldr; " \ + "bootelf ${kernel_addr_r}\0" \ + \ + "scan_dev_for_freebsd=" \ + "if test -e ${devtype} ${devnum}:${distro_bootpart} " \ + "ubldr.bin; then " \ + "echo Found FreeBSD U-Boot Loader (bin);" \ + "run boot_freebsd_binary; " \ + "echo FREEBSD FAILED: continuing...; " \ + "elif test -e ${devtype} ${devnum}:${distro_bootpart} " \ + "ubldr; then " \ + "echo Found FreeBSD U-Boot Loader (elf);" \ + "run boot_freebsd_elf; " \ + "echo FREEBSD FAILED: continuing...; " \ + "fi;\0" +#define SCAN_DEV_FOR_FREEBSD "run scan_dev_for_freebsd;" +#else +#define BOOTENV_SHARED_FREEBSD +#define SCAN_DEV_FOR_FREEBSD +#endif + #ifdef CONFIG_CMD_SATA #define BOOTENV_SHARED_SATA BOOTENV_SHARED_BLKDEV(sata) #define BOOTENV_DEV_SATA BOOTENV_DEV_BLKDEV @@ -326,6 +356,7 @@ BOOTENV_SHARED_IDE \ BOOTENV_SHARED_UBIFS \ BOOTENV_SHARED_EFI \ + BOOTENV_SHARED_FREEBSD \ "boot_prefixes=/ /boot/\0" \ "boot_scripts=boot.scr.uimg boot.scr\0" \ "boot_script_dhcp=boot.scr.uimg\0" \ @@ -369,6 +400,7 @@ "run scan_dev_for_scripts; " \ "done;" \ SCAN_DEV_FOR_EFI \ + SCAN_DEV_FOR_FREEBSD \ "\0" \ \ "scan_dev_for_boot_part=" \