Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A4D59C46467 for ; Sun, 8 Jan 2023 03:00:53 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A3F9185692; Sun, 8 Jan 2023 03:56:25 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="Fk3ef/CB"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2DD508545F; Sun, 8 Jan 2023 03:55:59 +0100 (CET) Received: from mail-il1-x133.google.com (mail-il1-x133.google.com [IPv6:2607:f8b0:4864:20::133]) (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 A89098545F for ; Sun, 8 Jan 2023 03:51:30 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x133.google.com with SMTP id m15so3301416ilq.2 for ; Sat, 07 Jan 2023 18:51:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=hMrWsBXFeeY/6WnWTjF8GGRQWGM2yIbIxLaNQslLkwY=; b=Fk3ef/CB7d+nw4M5GYYfvt3Gg8LIH3f/wueKh3MEZyRaSEkIcCIwqvACwenllD06No K/4mFnlgK+UQnrZGJHrghxebOTTp/VvYcsanVXX/eD6I4sSfQepWhCt3ZUscMgxpr9b7 NrNK7jLNvbdvCZt4gzvxvYO6mp2cIvgjFH6iI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hMrWsBXFeeY/6WnWTjF8GGRQWGM2yIbIxLaNQslLkwY=; b=Up1/pEDktMQUjmBPh5zMvRN7hkQMxVgNhYMqB+0SZCvDPMyNE5Gh7N1eY/8tJTjf6u FkbkRkV1MTt4o7xIaDgWiAvlg6kXn2Tn4qdBHRpmPfVwOzntQ8ZRwjuPjuRzv6kB+fnT B7dFX3WNNJG3f+40eJObwg5TPyVdQo7/tsT7HEja3FObaEtI/KSrgv02zQSfp7X5O+91 nH7D/bB68PS/YuH80aU6mLBBxdhvHpyvzsRuLXCiYy2WrRkx3zm77g93q+eZHnaOVwxq DZ1GaxlmKyUB8fojQKa0gf2PjbPUVLM1a8xRAza3ipGhh+2U/w/q+568s7zvJAxGP/gn Ig0Q== X-Gm-Message-State: AFqh2koj8YzdWpgxlAW0Mlw6AdcfWxyYDGmAzDG0YBqPumzPs+B/YUqL MCdCPbjhafrxlsSqkRk2vjY93MqJkeGuliKt X-Google-Smtp-Source: AMrXdXvDq1P2T6/+xNWTtJPO8tYSxKHjOnqhTDGcH0fMwQrTGKtqOaBROb7v2hp7GbNOE4WbuH/PJg== X-Received: by 2002:a92:c60e:0:b0:304:b79a:5008 with SMTP id p14-20020a92c60e000000b00304b79a5008mr44836022ilm.29.1673146290186; Sat, 07 Jan 2023 18:51:30 -0800 (PST) Received: from sjg1.roam.corp.google.com (c-71-56-217-229.hsd1.co.comcast.net. [71.56.217.229]) by smtp.gmail.com with ESMTPSA id c17-20020a92bd11000000b00302a00aaefasm1622174ile.26.2023.01.07.18.51.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Jan 2023 18:51:30 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: U-Boot Custodians , Simon Glass Subject: [PATCH v2 49/71] bootstd: Set the distro_bootpart env var with scripts Date: Sat, 7 Jan 2023 19:50:25 -0700 Message-Id: <20230108025047.522240-50-sjg@chromium.org> X-Mailer: git-send-email 2.39.0.314.g84b9a713c41-goog In-Reply-To: <20230108025047.522240-1-sjg@chromium.org> References: <20230108025047.522240-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.103.6 at phobos.denx.de X-Virus-Status: Clean This environment variable is supposed to be set so that the script knows which partition holds the script. Set it before invoking the script. Signed-off-by: Simon Glass --- (no changes since v1) boot/bootmeth_script.c | 3 +++ include/bootflow.h | 3 +++ 2 files changed, 6 insertions(+) diff --git a/boot/bootmeth_script.c b/boot/bootmeth_script.c index 11dab91c18c..f062cb97ca0 100644 --- a/boot/bootmeth_script.c +++ b/boot/bootmeth_script.c @@ -125,6 +125,8 @@ static int script_boot(struct udevice *dev, struct bootflow *bflow) ret = env_set("devtype", blk_get_devtype(bflow->blk)); if (!ret) ret = env_set_hex("devnum", desc->devnum); + if (!ret) + ret = env_set_hex("distro_bootpart", bflow->part); if (!ret) ret = env_set("prefix", bflow->subdir); if (!ret && IS_ENABLED(CONFIG_ARCH_SUNXI) && @@ -135,6 +137,7 @@ static int script_boot(struct udevice *dev, struct bootflow *bflow) log_debug("devtype: %s\n", env_get("devtype")); log_debug("devnum: %s\n", env_get("devnum")); + log_debug("distro_bootpart: %s\n", env_get("distro_bootpart")); log_debug("prefix: %s\n", env_get("prefix")); log_debug("mmc_bootdev: %s\n", env_get("mmc_bootdev")); diff --git a/include/bootflow.h b/include/bootflow.h index bf71b09edad..ed9b61f5118 100644 --- a/include/bootflow.h +++ b/include/bootflow.h @@ -144,6 +144,8 @@ enum bootflow_flags_t { * appear first, then the global ones, if any * @doing_global: true if we are iterating through the global bootmeths (which * happens before the normal ones) + * @method_flags: flags controlling which methods should be used for this @dev + * (enum bootflow_meth_flags_t) */ struct bootflow_iter { int flags; @@ -161,6 +163,7 @@ struct bootflow_iter { int first_glob_method; struct udevice **method_order; bool doing_global; + int method_flags; }; /** -- 2.39.0.314.g84b9a713c41-goog