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 E1A79C352A1 for ; Wed, 7 Dec 2022 09:06:03 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C1FA7856F9; Wed, 7 Dec 2022 09:56:53 +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="LgiVq34d"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 468868570E; Wed, 7 Dec 2022 09:56:48 +0100 (CET) Received: from mail-pg1-x52f.google.com (mail-pg1-x52f.google.com [IPv6:2607:f8b0:4864:20::52f]) (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 410FA856F9 for ; Wed, 7 Dec 2022 09:56:45 +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-pg1-x52f.google.com with SMTP id 82so15731934pgc.0 for ; Wed, 07 Dec 2022 00:56:45 -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=zUcykbdpMAC/8K9zNT1Z721PMrtw3zWnyrl+YzcW+gg=; b=LgiVq34dp22DTBlW/fKgl7Y6qLfGy8myrTuv5bGp1Rz2Vv2Lz94iJ7YE+wicUAseDn DYVXt1D2zMopIh1OR4oEKGE28Zz3zbXCuUiupO5TDiVOtvfIWBZaXQRVY3wEiwrw0THH HLuR6u++wTrBH7tjORjoDbFVMHwgZvaTsDuS8= 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=zUcykbdpMAC/8K9zNT1Z721PMrtw3zWnyrl+YzcW+gg=; b=npOs9y/K72rE43f2VHqv6Xmcm3U5kliPcc4DNEtUCenVkEBMNA9A3z9c5ei8mDO2zk bYTne026pParzmngeguOeehiv5ScS+QSAD8AMdAC1BF5n53Tyo4CvR+6z7iceNq+gK9N zo5G6rxFn/f2J4ufruzIbIMcQD9HpCfDACplXbT3kEPy3e5iYR84AImPyB9GC1EFaGqp O3E4txxeqn5py5KOhAMx2fFOQY9uZT8y0+Y7wkOtYxDb8JVH+Su3AdKEgn78ePiJHW5h Cpp13vqMktnpOf+bTFvNeSHbuXCcitWNJwFMhHixCDDFw+IENblm015b5t/EMWSvAEvi 952g== X-Gm-Message-State: ANoB5pkSibv3zedmePCD9G3Z9c8Lti5/kMnHbqVWSIbY7Dj9sI6ttiPg USkhrIefcLEGNXr4ijIIQdOW/E77ry1bsh4P X-Google-Smtp-Source: AA0mqf7AJ4qiiV/RO3bfMhLxgwy2XrZ6PQehDQ6FCT5507schzc71Mtdkgaq3DzPcWcDWWYN6ikhZA== X-Received: by 2002:a65:694e:0:b0:474:6749:407d with SMTP id w14-20020a65694e000000b004746749407dmr62217770pgq.425.1670403403387; Wed, 07 Dec 2022 00:56:43 -0800 (PST) Received: from localhost.localdomain ([27.110.126.54]) by smtp.gmail.com with ESMTPSA id l16-20020a170903121000b0018157b415dbsm14145514plh.63.2022.12.07.00.56.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Dec 2022 00:56:43 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: U-Boot Custodians , Simon Glass Subject: [PATCH 49/71] bootstd: Set the distro_bootpart env var with scripts Date: Wed, 7 Dec 2022 21:51:15 +1300 Message-Id: <20221207085137.445249-50-sjg@chromium.org> X-Mailer: git-send-email 2.39.0.rc0.267.gcb52ba06e7-goog In-Reply-To: <20221207085137.445249-1-sjg@chromium.org> References: <20221207085137.445249-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 --- 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 e438580d9e1..a1d31524efc 100644 --- a/boot/bootmeth_script.c +++ b/boot/bootmeth_script.c @@ -87,6 +87,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) && @@ -97,6 +99,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 f7b821fa10e..75f2064f47c 100644 --- a/include/bootflow.h +++ b/include/bootflow.h @@ -133,6 +133,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; @@ -150,6 +152,7 @@ struct bootflow_iter { int first_glob_method; struct udevice **method_order; bool doing_global; + int method_flags; }; /** -- 2.39.0.rc0.267.gcb52ba06e7-goog