From patchwork Mon Nov 7 13:07:15 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Hobbs X-Patchwork-Id: 124071 X-Patchwork-Delegate: wd@denx.de 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 E0320B6F80 for ; Tue, 8 Nov 2011 00:16:48 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 03FEA28C89; Mon, 7 Nov 2011 14:16:45 +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 NqSwZAn941rq; Mon, 7 Nov 2011 14:16:44 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6D4C228BF8; Mon, 7 Nov 2011 14:16:41 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A99BD28BF8 for ; Mon, 7 Nov 2011 14:16: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 n5SORB0t8qud for ; Mon, 7 Nov 2011 14:16:37 +0100 (CET) X-Greylist: delayed 543 seconds by postgrey-1.27 at theia; Mon, 07 Nov 2011 14:16:36 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 smtp185.dfw.emailsrvr.com (smtp185.dfw.emailsrvr.com [67.192.241.185]) by theia.denx.de (Postfix) with ESMTPS id 9132228BE0 for ; Mon, 7 Nov 2011 14:16:36 +0100 (CET) Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp18.relay.dfw1a.emailsrvr.com (SMTP Server) with ESMTP id 18908268112; Mon, 7 Nov 2011 08:07:31 -0500 (EST) X-Virus-Scanned: OK Received: by smtp18.relay.dfw1a.emailsrvr.com (Authenticated sender: jason.hobbs-AT-calxeda.com) with ESMTPSA id BBE052680D4; Mon, 7 Nov 2011 08:07:29 -0500 (EST) Received: by jhobbs-laptop (sSMTP sendmail emulation); Mon, 07 Nov 2011 07:07:29 -0600 From: "Jason Hobbs" To: u-boot@lists.denx.de Date: Mon, 7 Nov 2011 07:07:15 -0600 Message-Id: <1320671235-9224-1-git-send-email-jason.hobbs@calxeda.com> X-Mailer: git-send-email 1.7.5.4 Cc: Ricardo Salveti de Araujo Subject: [U-Boot] [PATCH] pxe: make the first label the implicit default X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 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 If no default label is specified, but a situation arises where the default label should be used, treat the first label specified as the default label. Signed-off-by: Jason Hobbs Cc: Ricardo Salveti de Araujo Cc: Wolfgang Denk --- common/cmd_pxe.c | 17 ++++++++++++++--- 1 files changed, 14 insertions(+), 3 deletions(-) diff --git a/common/cmd_pxe.c b/common/cmd_pxe.c index 3efd700..9426f5b 100644 --- a/common/cmd_pxe.c +++ b/common/cmd_pxe.c @@ -1273,10 +1273,21 @@ static void handle_pxe_menu(struct pxe_menu *cfg) menu_destroy(m); - if (err < 1) - return; + /* + * err == 1 means we got a choice back from menu_get_choice. + * + * err == -ENOENT if the menu was setup to select the default but no + * default was set. in that case, we should continue trying to boot + * labels that haven't been attempted yet. + * + * otherwise, the user interrupted or there was some other error and + * we give up. + */ - label_boot(choice); + if (err == 1) + label_boot(choice); + else if (err != -ENOENT) + return; boot_unattempted_labels(cfg); }