From patchwork Mon Dec 3 03:00:28 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 203278 X-Patchwork-Delegate: joe.hershberger@gmail.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 D20AA2C00B5 for ; Mon, 3 Dec 2012 14:02:55 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 870B44A088; Mon, 3 Dec 2012 04:02:38 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de 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 bFExANPdfMH1; Mon, 3 Dec 2012 04:02:38 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0CFE44A08B; Mon, 3 Dec 2012 04:01:58 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D63204A0A1 for ; Mon, 3 Dec 2012 04:01:46 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de 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 SPmvhQn+3p+p for ; Mon, 3 Dec 2012 04:01:44 +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-ob0-f172.google.com (mail-ob0-f172.google.com [209.85.214.172]) by theia.denx.de (Postfix) with ESMTPS id 698004A053 for ; Mon, 3 Dec 2012 04:01:18 +0100 (CET) Received: by mail-ob0-f172.google.com with SMTP id za17so1976153obc.3 for ; Sun, 02 Dec 2012 19:01:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=EyjCCeziF5Lg4ZKF8UpvrjC0+QQ4cx0t8IX4WLBonsg=; b=mZKChGDyLY4NlOx5vwlQoWKVXrWIfvzyEAxcKWJ8ro2RhDnp9pSE5CRp+iMrDPWeLL oq/5dGViA6U4AenNyrOgqKb6BYoJ/hzJ5XYFPd8tZkBsn+0d0SMofN6I7WSmDm6wd6ct fdYuOK7pjtloO+KY4nOsL9+DrsBQJKAsevP9xeckT5I7pCoiiwUPD4KOS/licOoJoK+Y 0JNF3K/OOpQKYhNIKV9pSEdByKjKvqZgbdgo5ysqNsODUBKvA1/NCYdD8jEhccPM2LSF XVrmCAcr+1RmaqgdYVkHUVulwGHi+h2bM9o3vsmFZAZ1bcb2ASlrY40Fp5+RSOkSMWPd Qqkg== Received: by 10.182.38.65 with SMTP id e1mr3230966obk.3.1354503677996; Sun, 02 Dec 2012 19:01:17 -0800 (PST) Received: from rob-laptop.grandenetworks.net (65-36-73-129.dyn.grandenetworks.net. [65.36.73.129]) by mx.google.com with ESMTPS id vq7sm9420855oeb.13.2012.12.02.19.01.15 (version=SSLv3 cipher=OTHER); Sun, 02 Dec 2012 19:01:17 -0800 (PST) From: Rob Herring To: u-boot@lists.denx.de Date: Sun, 2 Dec 2012 21:00:28 -0600 Message-Id: <1354503629-25621-10-git-send-email-robherring2@gmail.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1354503629-25621-1-git-send-email-robherring2@gmail.com> References: <1354503629-25621-1-git-send-email-robherring2@gmail.com> Cc: trini@ti.com, Rob Herring Subject: [U-Boot] [PATCH 09/10] pxe: add support for per arch and SoC default paths X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de From: Rob Herring A pxelinux server setup for "default" menu is typically an x86 binary. This does not work well with a mixed architecture setup. Extend the default search to look for default-- and then default- before falling back to just "default". Signed-off-by: Rob Herring --- common/cmd_pxe.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/common/cmd_pxe.c b/common/cmd_pxe.c index 93c8df5..f834d31 100644 --- a/common/cmd_pxe.c +++ b/common/cmd_pxe.c @@ -26,6 +26,13 @@ #define MAX_TFTP_PATH_LEN 127 +const char *pxe_default_paths[] = { + "default-" CONFIG_SYS_ARCH "-" CONFIG_SYS_SOC, + "default-" CONFIG_SYS_ARCH, + "default", + NULL +}; + /* * Like getenv, but prints an error if envvar isn't defined in the * environment. It always returns what getenv does, so it can be used in @@ -339,7 +346,7 @@ do_pxe_get(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { char *pxefile_addr_str; unsigned long pxefile_addr_r; - int err; + int err, i = 0; do_getfile = do_get_tftp; @@ -362,14 +369,21 @@ do_pxe_get(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) */ if (pxe_uuid_path((void *)pxefile_addr_r) > 0 || pxe_mac_path((void *)pxefile_addr_r) > 0 - || pxe_ipaddr_paths((void *)pxefile_addr_r) > 0 - || get_pxelinux_path("default", (void *)pxefile_addr_r) > 0) { + || pxe_ipaddr_paths((void *)pxefile_addr_r) > 0) { printf("Config file found\n"); return 0; } + while (pxe_default_paths[i]) { + if (get_pxelinux_path(pxe_default_paths[i], (void *)pxefile_addr_r) > 0) { + printf("Config file found\n"); + return 0; + } + i++; + } + printf("Config file not found\n"); return 1;