From patchwork Wed Mar 28 15:51:37 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 149286 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 D02B7B6EF3 for ; Thu, 29 Mar 2012 02:54:08 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id CE2362839A; Wed, 28 Mar 2012 17:53:09 +0200 (CEST) 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 mjq5G9eEfehq; Wed, 28 Mar 2012 17:53:09 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4863A2833B; Wed, 28 Mar 2012 17:52:54 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 822B328382 for ; Wed, 28 Mar 2012 17:52:47 +0200 (CEST) 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 qBidiYG4LKKR for ; Wed, 28 Mar 2012 17:52:36 +0200 (CEST) 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-gx0-f172.google.com (mail-gx0-f172.google.com [209.85.161.172]) by theia.denx.de (Postfix) with ESMTPS id 3EBD628348 for ; Wed, 28 Mar 2012 17:52:04 +0200 (CEST) Received: by ggmi1 with SMTP id i1so813162ggm.3 for ; Wed, 28 Mar 2012 08:52:02 -0700 (PDT) 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=l2yP+kKA3dkLRzG3VXjBlyYcYutjkB2m9ldIOwPuUTA=; b=FJOPomHJZNTmXpu4ePLHpXCS76n1TuBie0QYfgCT2rGcQkE6TY4kGpoB414h7fGTxz lD5LxT6QEezhSmS06/Dw/AP4FN7BDBM0UA5zWjhFTOG7ZHbD8c0e3CxDSCk6Je0gOFUD IDd2IiAxqqvoPLp3RzM7/r9CFDaHqznBLadx+yho+LzvrvY0NM1YgPINvXPeqMMZXU3g QYnZ39oRsTREV5MTINJvsiBWGosbiIXjtumWZ+Kj+anLh4EqEYz0Yz0ov4+neChGUEL5 Nvoi4oPvrCShMCYd2qHiAtakwDyRQFg1fX2UtvuJiKos2JHm7zH6gqw8O+kJ8+Vq/V3n GbSQ== Received: by 10.60.13.37 with SMTP id e5mr29838982oec.70.1332949922482; Wed, 28 Mar 2012 08:52:02 -0700 (PDT) Received: from rob-laptop.i.smooth-stone.com ([173.226.190.126]) by mx.google.com with ESMTPS id yw3sm3354179obb.7.2012.03.28.08.52.00 (version=SSLv3 cipher=OTHER); Wed, 28 Mar 2012 08:52:01 -0700 (PDT) From: Rob Herring To: u-boot@lists.denx.de Date: Wed, 28 Mar 2012 10:51:37 -0500 Message-Id: <1332949898-6502-7-git-send-email-robherring2@gmail.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1332949898-6502-1-git-send-email-robherring2@gmail.com> References: <1332949898-6502-1-git-send-email-robherring2@gmail.com> Cc: Rob Herring Subject: [U-Boot] [PATCH 6/7] pxe: parse initrd file from append string 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 For syslinux, the initrd can be set in the append string as "initrd=", so try to find it there if we haven't already set the initrd. Signed-off-by: Rob Herring --- common/cmd_pxe.c | 15 ++++++++++++++- doc/README.pxe | 3 --- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/common/cmd_pxe.c b/common/cmd_pxe.c index ac1bc56..4ad067a 100644 --- a/common/cmd_pxe.c +++ b/common/cmd_pxe.c @@ -999,6 +999,7 @@ static int parse_label_menu(char **c, struct pxe_menu *cfg, static int parse_label(char **c, struct pxe_menu *cfg) { struct token t; + int len; char *s = *c; struct pxe_label *label; int err; @@ -1033,10 +1034,22 @@ static int parse_label(char **c, struct pxe_menu *cfg) case T_APPEND: err = parse_sliteral(c, &label->append); + if (label->initrd) + break; + s = strstr(label->append, "initrd="); + if (!s) + break; + s += 7; + len = (int)(strchr(s, ' ') - s); + label->initrd = malloc(len + 1); + strncpy(label->initrd, s, len); + label->initrd[len] = '\0'; + break; case T_INITRD: - err = parse_sliteral(c, &label->initrd); + if (!label->initrd) + err = parse_sliteral(c, &label->initrd); break; case T_LOCALBOOT: diff --git a/doc/README.pxe b/doc/README.pxe index 95cd9b9..2bbf53d 100644 --- a/doc/README.pxe +++ b/doc/README.pxe @@ -224,9 +224,6 @@ PXELINUX and U-boot's pxe support. - U-boot's pxe expects U-boot uimg's as kernels. Anything that would work with the 'bootm' command in U-boot could work with the 'pxe boot' command. -- U-boot's pxe doesn't recognize initrd options in the append command - you - must specify initrd files using the initrd command. - - U-boot's pxe only recognizes a single file on the initrd command line. It could be extended to support multiple.