From patchwork Wed Nov 20 02:43:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Kerr X-Patchwork-Id: 1197778 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47HngG15t6z9sPV for ; Wed, 20 Nov 2019 14:07:38 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.b="xesOHZhr"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 47HngF6wpdzDqv4 for ; Wed, 20 Nov 2019 14:07:37 +1100 (AEDT) X-Original-To: petitboot@lists.ozlabs.org Delivered-To: petitboot@lists.ozlabs.org Received: from ozlabs.org (bilbo.ozlabs.org [203.11.71.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 47Hn9V0mJmzDqWk for ; Wed, 20 Nov 2019 13:45:18 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=ozlabs.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.b="xesOHZhr"; dkim-atps=neutral Received: by ozlabs.org (Postfix, from userid 1023) id 47Hn9T4p4Yz9sPW; Wed, 20 Nov 2019 13:45:17 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ozlabs.org; s=201707; t=1574217917; bh=NeaNMPyOOP2esd+l0MyO9HhQ0HF2hC1ucVL2fl0xC00=; h=From:To:Subject:Date:In-Reply-To:References:From; b=xesOHZhrdj1PIqKQniPCfH6PC7OxCeBv9icn7QZPig1vJnverYfvs+AaNSCvYe1/k jFgbkySuHWezU0LBocGxo4iRn58WEAzhQvQMgKzH9L+tXsN3gwZtkBZd+RGNqLjK/4 2AMgScfHMjzIgSFi1Van5ALyRp1j3sEVL5R3WzMWtL26hqBOdvW3gGg4a0ZXN6D3K0 TezgiOyjDFfqhzY29BeWpw3vip0OmQhh9S7GS8i5GtwwkOQLIr+aLSvUu4ZzFA7fvY FC3RQGBgqgpduYC+ckLDvQVMd5EbxnAsThbqyzaduheTaNaRo6tfY35b5U/gtKfR8J EkRjEZWnLWk5Q== From: Jeremy Kerr To: petitboot@lists.ozlabs.org Subject: [PATCH 09/14] discover/grub2: Add a reference from script to parser Date: Wed, 20 Nov 2019 10:43:01 +0800 Message-Id: <20191120024306.16526-10-jk@ozlabs.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191120024306.16526-1-jk@ozlabs.org> References: <20191120024306.16526-1-jk@ozlabs.org> MIME-Version: 1.0 X-BeenThere: petitboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Petitboot bootloader development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: petitboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Petitboot" Future commands will need to access the parser, so add a reference from struct grub2_script. Signed-off-by: Jeremy Kerr --- discover/grub2/grub2.h | 1 + discover/grub2/script.c | 1 + 2 files changed, 2 insertions(+) diff --git a/discover/grub2/grub2.h b/discover/grub2/grub2.h index eabd6d6..323b461 100644 --- a/discover/grub2/grub2.h +++ b/discover/grub2/grub2.h @@ -91,6 +91,7 @@ struct grub2_statement_for { }; struct grub2_script { + struct grub2_parser *parser; struct grub2_statements *statements; struct list environment; struct list symtab; diff --git a/discover/grub2/script.c b/discover/grub2/script.c index 8a9d91d..34e0400 100644 --- a/discover/grub2/script.c +++ b/discover/grub2/script.c @@ -518,6 +518,7 @@ struct grub2_script *create_script(struct grub2_parser *parser, script = talloc_zero(parser, struct grub2_script); script->ctx = ctx; + script->parser = parser; list_init(&script->symtab); list_init(&script->options);