From patchwork Wed Mar 17 19:54:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilias Apalodimas X-Patchwork-Id: 403217 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp777293jai; Wed, 17 Mar 2021 12:55:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx/Ty8HbSWssUA+g9z7EAB1A1hieLNInyclo/pFhD0H2nx1qVvWsfXhxJ/ovPytQoUFByEy X-Received: by 2002:aa7:cc98:: with SMTP id p24mr26646542edt.187.1616010916521; Wed, 17 Mar 2021 12:55:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616010916; cv=none; d=google.com; s=arc-20160816; b=nHl4OUYt40qIDSGaqzEei3KkKqoknm+jihfSDD58r67JnhdgqEgsaseCIFuMNkLmRd e0m2Eby0yMEHBkoRNEUOkZ9rB3A8tEEXvRHxC7SBSTryWsMTySsYQ7mI4r+Nrdva6d8m DtaSLqFxqBQRI6WODu1V+ec6fsuafeumeNKd/cB0qZVqBvhoDQBx54l+U33u9Tai0BKL XTXY+R25jYyizAR7nuRw3CvMK4BpXWMvPysqlfn428IDhDssxdxB6pY599n9iXc8jwVW J7YWeC03rGZcWxhpArH7WKYslty+WvUCFYhV2QhBMN/ESmuch1WasiRbxgE07kxj4bcN jGkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=fR6M+9zLg2wte5PLhkmoFgtpxWx44iAgNCIPX9LM7BU=; b=F9grV3L1CH8bnv/6PfKQVUA3O/2TmIU33+WWjMwHIEV8z4p82C9m4AJyPbc02b+PYe nn3X4RkUWAYUCnSKsm+Xm74LoO6taEvnORAt1RCZ/m8xCHxAH0PmbPsO7z2KjbU6JkBI FMQhliw9UCEWEv2Iq6vO/RsADoLrsh/b4Tcrs6C3JFbJvlwIvIwpkwG7GrC84NG3n8WI 8bK2/pMIADHAAReEXPIQChoGJpy3MVVOwIYz0IwTvKz8XAz9yDkg/z0azImmU5zqTKbY fW1bAshNqxHMR+cSG+GC4iKdJ2fAd/rqCG7+T0amMpn1qwRqgzEcQ/seXx/ajr6YD0y4 tHqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=l2LqzOFo; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id bs9si16572902edb.575.2021.03.17.12.55.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Mar 2021 12:55:16 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=l2LqzOFo; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id CAD28803AB; Wed, 17 Mar 2021 20:55:13 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="l2LqzOFo"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4E68C803AB; Wed, 17 Mar 2021 20:55:12 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 02F5C80040 for ; Wed, 17 Mar 2021 20:55:08 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=ilias.apalodimas@linaro.org Received: by mail-wm1-x332.google.com with SMTP id w203-20020a1c49d40000b029010c706d0642so5886185wma.0 for ; Wed, 17 Mar 2021 12:55:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=fR6M+9zLg2wte5PLhkmoFgtpxWx44iAgNCIPX9LM7BU=; b=l2LqzOFox26kDSBKlv/x7fo1uzm6QtEIbio33dQr372UvKK4QbTEFjZlKIRjqvwjxO 4YZnErg1KKxufbHcEQCMl+nXxQtPiHfZlb/Ruit16gi2WP2Lk5qlp/Eo21rR246aYOJE i353x5WAMZHTeiOP7OtUbCSebs1edH4KMeKEDJyVjmiSC8sdB+u00+6/YX/Q0shklq/f TPnymmAEqSuogvL2HePUMPw9mUI6pzUkx+BhBC3qGKKEY7I01AOR9VhBX12hnlQfqfNU WYayK47ve7ndt+d5h/LxX+T6eMGzBWpaNONhtqUmBLomOqER7TE6FnGEn3llUv0Om2aU 9MBA== 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:mime-version :content-transfer-encoding; bh=fR6M+9zLg2wte5PLhkmoFgtpxWx44iAgNCIPX9LM7BU=; b=B1yH+D7l9G3KeJgiVJ3QL7N0V5v521IOQwdUed4obgA5RCMFKbIf8t8/TQ2kUevTi7 C3C0GU5KWwq8AxjuJoHHmsoiD9+RlHbROXYbVqfcQgiMIqyTAn+1knb3A+/Kmehetefm tFvYwWjLQHe8UN+zlj3CRQI5enVKElDfEcltoEZizMNaWFvG0yZO52VbqumeV5yk2RBH C1bdTuA3oIUHSkUKARaDmpstOSWHuVzF7ZcPYf/JbgyZOV/buWgW4wjnmf7c6pKMXpWf tv+fBOsdtHukRznKbO+ewlvZvNlPh8b0P8UkyWVHcAI6dPJywSpDzYJ+rs0tQtys6n5m 9Zhw== X-Gm-Message-State: AOAM5308txRZYwKSkaIXHOIizW54cEiDXmVjAl9H+VbGKyQuIabf08y8 wJ6wHbO+cjQD014gXkklt5V+9w== X-Received: by 2002:a1c:a958:: with SMTP id s85mr417413wme.138.1616010908508; Wed, 17 Mar 2021 12:55:08 -0700 (PDT) Received: from localhost.localdomain (ppp-94-64-113-158.home.otenet.gr. [94.64.113.158]) by smtp.gmail.com with ESMTPSA id z82sm3343853wmg.19.2021.03.17.12.55.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Mar 2021 12:55:08 -0700 (PDT) From: Ilias Apalodimas To: xypron.glpk@gmx.de Cc: takahiro.akashi@linaro.org, Ilias Apalodimas , Alexander Graf , Sughosh Ganu , u-boot@lists.denx.de Subject: [PATCH 0/5 v4] Loadfile2 for initrd loading Date: Wed, 17 Mar 2021 21:54:57 +0200 Message-Id: <20210317195505.337105-1-ilias.apalodimas@linaro.org> X-Mailer: git-send-email 2.31.0 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.4 at phobos.denx.de X-Virus-Status: Clean Hi! This is v4 of [1] Changes since v3: - Slightly tweaked the efidebug argument parsing following Heinrich's suggestion. Instead of calculating the file device path initially and appending the initrd, the 2 two device paths are now calculated independently and concatenated later, allowing us to easier handle the various switches (-i, -b etc) - Fixed documentation typo that prevented htmldocs from building - Removed [1/6] patch which was already merged Changes since v2: - Lengths checks when interpreting a device path, to make sure we aren't going out of bounds - renamed efi_get_file_size -> efi_file_size and moved it in efi_file.c - Fix uninitialized variable related errors reported by Cppcheck - Fixed various error messages for easier end user readability - renamed _efi_dp_append() -> efi_dp_append_or_concatenate() - Picked up Reviewed-by tags - Enabling the protocol by default Changes since v1: - minor coding style fixes from Heinrich - changed the DP format. Instead of VenMedia - 0x01 - initrd, we skip the 0x01 between VenMedia and the first file. - final device path is stripped in efi_get_dp_from_boot() instead of get_initrd_fp() - Fixed comments on documentation [1] https://lists.denx.de/pipermail/u-boot/2021-March/443399.html Ilias Apalodimas (5): efi_loader: Add device path related functions for initrd via Boot#### efi_loader: Add helper functions for EFI efi_loader: Replace config option for initrd loading efidebug: add multiple device path instances on Boot#### doc: Update uefi documentation for initrd loading options cmd/bootefi.c | 3 + cmd/efidebug.c | 191 +++++++++++++---- doc/board/emulation/qemu_capsule_update.rst | 4 +- doc/uefi/uefi.rst | 24 ++- include/efi_loader.h | 12 ++ lib/efi_loader/Kconfig | 17 +- lib/efi_loader/Makefile | 1 + lib/efi_loader/efi_bootmgr.c | 19 +- lib/efi_loader/efi_device_path.c | 106 ++++++++- lib/efi_loader/efi_file.c | 39 ++++ lib/efi_loader/efi_helper.c | 98 +++++++++ lib/efi_loader/efi_load_initrd.c | 202 +++++++++++------- lib/efi_loader/efi_var_common.c | 33 +++ .../test_efi_capsule/test_capsule_firmware.py | 6 +- test/py/tests/test_efi_secboot/test_signed.py | 16 +- .../test_efi_secboot/test_signed_intca.py | 8 +- .../tests/test_efi_secboot/test_unsigned.py | 8 +- 17 files changed, 625 insertions(+), 162 deletions(-) create mode 100644 lib/efi_loader/efi_helper.c -- 2.31.0