From patchwork Tue Jun 12 10:18:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Martinez Canillas X-Patchwork-Id: 928223 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.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 414m7X2YfPz9s0W for ; Tue, 12 Jun 2018 20:18:48 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 414m7X15d2zF4Gx for ; Tue, 12 Jun 2018 20:18:48 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=redhat.com X-Original-To: petitboot@lists.ozlabs.org Delivered-To: petitboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=redhat.com (client-ip=74.125.82.47; helo=mail-wm0-f47.google.com; envelope-from=javierm@redhat.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=redhat.com Received: from mail-wm0-f47.google.com (mail-wm0-f47.google.com [74.125.82.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 414m7P70GPzF4GX for ; Tue, 12 Jun 2018 20:18:41 +1000 (AEST) Received: by mail-wm0-f47.google.com with SMTP id v131-v6so22171167wma.1 for ; Tue, 12 Jun 2018 03:18:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=LempDzf9GpB8yJQoYjaOEQWipowwAtYFrUWMKeFHFXM=; b=HD4IQrZOipzipz8pMsfMPnHTOHAw4zQ4ziiOrI0ZsmIcG59I11EyNo0Achp2EHrmsA 7Ro3MwfKimL6NXyUPLgkMKC6vgFo4LG3NsunQ3xSia1AoNsJUJSfafQ30ag/azh8eY54 4Ay4iKraXRUStmxZdJnc9MCCpK7Xjkmlg3v2gYozMnbQAH7q282nq7pKRLieXTYufSFT LwjiIeHkWBe/JBK+W/2XmJcRxhJN++dlBuFfBXU3sIQOcTlcFxaQ+l46/BPnVTIYuwLA hjen7UMVxDUlNJanyOZg4oKnR0SHMmUhgerHL8unSol+WK5PcrGWIwZE2BFzmhxy3kXR c6MA== X-Gm-Message-State: APt69E3WL185hA0Dh84eZC2vhdZrQYivK5yUW6IahcRrZuVEY/4QXoYD 2qtXmh7dv3ahr+rxkG9CeGiZgB8x0dw= X-Google-Smtp-Source: ADUXVKI9FPltZKyHFLcZGNH4CZeCu9Wr09Z7Sma+lg5z++ysibhoWOmFzlSwIrWMgonqAXXlEz/Iww== X-Received: by 2002:a1c:9d49:: with SMTP id g70-v6mr1822710wme.134.1528798717932; Tue, 12 Jun 2018 03:18:37 -0700 (PDT) Received: from minerva.redhat.com ([90.77.100.34]) by smtp.gmail.com with ESMTPSA id m58-v6sm1275862wrf.61.2018.06.12.03.18.36 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 12 Jun 2018 03:18:37 -0700 (PDT) From: Javier Martinez Canillas To: petitboot@lists.ozlabs.org Subject: [PATCH v3 0/3] discover/grub: Some improvements and fixes for BLS support Date: Tue, 12 Jun 2018 12:18:31 +0200 Message-Id: <20180612101835.20872-1-javierm@redhat.com> X-Mailer: git-send-email 2.17.1 X-BeenThere: petitboot@lists.ozlabs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Petitboot bootloader development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Hlavac , Peter Jones , Javier Martinez Canillas , Samuel Mendoza-Jonas MIME-Version: 1.0 Errors-To: petitboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Petitboot" Hello, This series contains some improvements and fixes for issues that I found when doing more extensive testing of the Petitboot BLS support. Patch #1 is just a small fix for the parser_scandir() stub function used in the test harness. Patch #2 allows BLS snippets to not only be in a /boot partition but also in the root partition if /boot isn't a mount point. This configuration is already supported by the grub.cfg file but I missed for BLS files. Patch #3 improves the environment variables evaluation for BLS files, to be in par of what's supported by the grub.cfg file. Changes since v2: - Don't add a terminating null byte since talloc_strndup() already does that. Changes since v1: - Don't propagate errors when expanding env vars since these may not be defined. Best regards, Javier Javier Martinez Canillas (3): test/parser: Make parser_scandir() ignore files with path len less than dir discover/grub: Use different paths to search for the BLS directory discover/grub: Improve BLS grub environment variables expansion discover/grub2/blscfg.c | 107 ++++++++++++++---- .../test-grub2-blscfg-default-filename.c | 8 +- test/parser/test-grub2-blscfg-default-index.c | 14 ++- test/parser/test-grub2-blscfg-default-title.c | 8 +- test/parser/test-grub2-blscfg-multiple-bls.c | 7 +- test/parser/test-grub2-blscfg-opts-config.c | 2 + test/parser/test-grub2-blscfg-opts-grubenv.c | 6 +- test/parser/utils.c | 3 + 8 files changed, 120 insertions(+), 35 deletions(-)