From mboxrd@z Thu Jan 1 00:00:00 1970 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 36459C433EF for ; Thu, 14 Oct 2021 04:32:53 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 1A2C160E0C for ; Thu, 14 Oct 2021 04:32:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 1A2C160E0C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 818A28314A; Thu, 14 Oct 2021 06:32:49 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com 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=gmail.com header.i=@gmail.com header.b="hjfKIkqF"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9D1368360A; Thu, 14 Oct 2021 06:32:46 +0200 (CEST) Received: from mail-il1-x12c.google.com (mail-il1-x12c.google.com [IPv6:2607:f8b0:4864:20::12c]) (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 ED63782EA5 for ; Thu, 14 Oct 2021 06:32:41 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=email2tema@gmail.com Received: by mail-il1-x12c.google.com with SMTP id s3so2146508ild.0 for ; Wed, 13 Oct 2021 21:32:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=9TLMcdLTL8X8pJrlUkYh4Twcxc/Zrw6YXRn137Rzzh4=; b=hjfKIkqF+FCdqXmCvT7+oCJn5C1i+kOdHNDmpKrrl+J3QO7YrSVXkK44riRa8liT9R wKykkt/JdguthpKtdbeU+OcBnjN+pWNh1DcwMb1B9whoKOkUzbsG6ps30ufg1VLFwLvr 39UmIjyKgeptb6Uy9aum4OAywTUUNP4E0zfr1/ol+i3fhZs7ogILWwUYS9YWuuspLypB v/I5D78EJ8+ylMr2eBkhDVlH4xVq9zDoVV7qEvY+ngLmxIDn18nG2c43KyNEmk/q44oe 7pLiRdQGwcFcd1a7NLreR3vQ3uieWcZL+1QQ2z3ax6hV6pxIHLALbKUp+xjGIIVrSQtB w48Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9TLMcdLTL8X8pJrlUkYh4Twcxc/Zrw6YXRn137Rzzh4=; b=eV/v68LIGr3EqwPjrhfGhgtV8AfR2Y8lO8ZcKcLOWUfXgjsb+D5pOeXoffbPfEFKTM /O3PHbxkTvExcT4yx/OfYggxTlIliKOuAvhKehGoFQK8Dw/h0HeS065Lw7VCq0HwE7CA XJ4vB8GygD8akeFrSsJkh5Dy/i194F3P0RN7D9qiiqunEpV4O+18hASmvSk2uJJXXpTN 0FkiMwE0WwgpdL5nvBXMtx0C3RwxVuXDp8W3KkzLJdZGleTQ8Cpl40Z0WqKwTBbvPmte 9u3E5nJE8A9XIPbG6ysbPh/cTpimq4j07O8xj09dQenr0qb4UkOP4VMd7XpLif7HwuU8 hMNw== X-Gm-Message-State: AOAM5308uaj2Qgzvmw9rFjI2e9sdPO/tENB6GM3WjXstaKIphNFG8yl6 F01957WrVvOOT3MbCEabk6EGlDivfA7hDewmwHg= X-Google-Smtp-Source: ABdhPJyWiOdZSVY84GX23A4r6QiApm4cCBDiyW9LZw8cu5cKv9GpTYcIkAohSNsjkzhRqfi4trcGcJtSF9kh3ZOGUhY= X-Received: by 2002:a05:6e02:b2a:: with SMTP id e10mr718447ilu.53.1634185960188; Wed, 13 Oct 2021 21:32:40 -0700 (PDT) MIME-Version: 1.0 References: <20211012085544.3206394-1-art@khadas.com> <20211012194401.GF7964@bill-the-cat> <20211012210721.GG7964@bill-the-cat> In-Reply-To: From: Art Nikpal Date: Thu, 14 Oct 2021 12:32:28 +0800 Message-ID: Subject: Re: [PATCH] distro_boot: Fix bootfile env after calling boot_extlinux To: Simon Glass Cc: Tom Rini , Neil Armstrong , Tom Warren , Andre Przywara , U-Boot Mailing List , u-boot-amlogic@groups.io, Artem Lapkin , Nick Xie , Gouwa Wang Content-Type: text/plain; charset="UTF-8" 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.103.2 at phobos.denx.de X-Virus-Status: Clean > could you check out my syslinux refactor > series? It could use some review. > > http://patchwork.ozlabs.org/project/uboot/list/?series=264265 Yes ! But I already can't apply this series for actual uboot code (need to change) maybe u can make v3 patches for actual uboot state. I checked it quickly. This series has many useful improvements! > Here's the patch where (I believe) this problem was addressed: > http://patchwork.ozlabs.org/project/uboot/patch/20210927092350.v2.11.I6a01e73ef114448e39cb6899c21f6c169e4da216@changeid/ look like yes and if your series will be applied my patch already no need. On Thu, Oct 14, 2021 at 12:58 AM Simon Glass wrote: > > Hi Art, > > On Tue, 12 Oct 2021 at 21:45, Art Nikpal wrote: > > > > Yes changes inside include/config_distro_bootcmd.h not the best solution for this issue. > > I think it is better to change sysboot cmd and i have prepared another solution already! > > https://patchwork.ozlabs.org/project/uboot/patch/20211013033912.3297227-1-art@khadas.com/ > > how about this ? > > Seem reasonable to me, but could you check out my syslinux refactor > series? It could use some review. > > http://patchwork.ozlabs.org/project/uboot/list/?series=264265 > > > - Simon > > > > > On Wed, Oct 13, 2021 at 5:07 AM Tom Rini wrote: > >> > >> On Tue, Oct 12, 2021 at 02:31:18PM -0600, Simon Glass wrote: > >> > Hi Tom, > >> > > >> > On Tue, 12 Oct 2021 at 13:44, Tom Rini wrote: > >> > > > >> > > On Tue, Oct 12, 2021 at 04:55:44PM +0800, Artem Lapkin wrote: > >> > > > >> > > > Problem > >> > > > > >> > > > PXE cannot boot normally after Sysboot changed the bootfile env (called > >> > > > from boot_extlinux) from the default "boot.scr.uimg" to > >> > > > "/boot/extlinux/extlinux.conf". > >> > > > > >> > > > In addition, an unbootable extlinux configuration will also make the PXE > >> > > > boot unbootable, because it will use the incorrect path "/boot/extlinux/" > >> > > > from the bootfile env. > >> > > > > >> > > > Solution > >> > > > > >> > > > Save and restore default bootfile env value when boot_extlinux is used. > >> > > > > >> > > > Example > >> > > > ================================================================ > >> > > > Hit SPACE in 2 seconds to stop autoboot > >> > > > ... is now current device > >> > > > Found /boot/extlinux/extlinux.conf > >> > > > Retrieving file: /boot/extlinux/extlinux.conf > >> > > > 413 bytes read in 2 ms (201.2 KiB/s) > >> > > > Skipping Krescue for failure retrieving kernel > >> > > > SCRIPT FAILED: continuing... > >> > > > ... > >> > > > Speed: 1000, full duplex > >> > > > BOOTP broadcast 1 > >> > > > DHCP client bound to address 192.168.11.151 (8 ms) > >> > > > Using ethernet@ff3f0000 device > >> > > > TFTP from server 192.168.11.1; our IP address is 192.168.11.151 > >> > > > Filename '/boot/extlinux/pxelinux.cfg/default'. > >> > > > Not retrying... > >> > > > ================================================================ > >> > > > > >> > > > Signed-off-by: Artem Lapkin > >> > > > --- > >> > > > include/config_distro_bootcmd.h | 2 ++ > >> > > > 1 file changed, 2 insertions(+) > >> > > > > >> > > > diff --git a/include/config_distro_bootcmd.h b/include/config_distro_bootcmd.h > >> > > > index 3f724aa10f..db3d1b2362 100644 > >> > > > --- a/include/config_distro_bootcmd.h > >> > > > +++ b/include/config_distro_bootcmd.h > >> > > > @@ -445,7 +445,9 @@ > >> > > > "${devnum}:${distro_bootpart} " \ > >> > > > "${prefix}${boot_syslinux_conf}; then " \ > >> > > > "echo Found ${prefix}${boot_syslinux_conf}; " \ > >> > > > + "bootfile_bak=${bootfile}; " \ > >> > > > "run boot_extlinux; " \ > >> > > > + "setenv bootfile ${bootfile_bak}; " \ > >> > > > "echo SCRIPT FAILED: continuing...; " \ > >> > > > "fi\0" \ > >> > > > \ > >> > > > >> > > We've had this kind of problem before, and the answer is that variables > >> > > should be local, not global in scope. In this case, I see that the way > >> > > the pxe/sysboot code works is that we have to env_set("..") in one place > >> > > to env_get("..") in another, so I don't see a way around this. > >> > > > >> > > Reviewed-by: Tom Rini > >> > > >> > IMO a better approach will be the bootflow implementation. I hope to > >> > get v2 out early next week. > >> > >> I'm not sure if the bootflow way of going here would or would not have > >> the same problem, or perhaps a slightly different problem. At heart > >> here, "sysboot" calls env_set(...) and then calls in to the pxe code > >> which does env_get(...). So now I wonder how this would be fixed in > >> bootflow, since we aren't dealing with the environment directly. > >> > >> -- > >> Tom