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 73363C433EF for ; Tue, 12 Oct 2021 19:44:26 +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 8C00C60ED4 for ; Tue, 12 Oct 2021 19:44:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 8C00C60ED4 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=konsulko.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 6E52B834FB; Tue, 12 Oct 2021 21:44:17 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com 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=konsulko.com header.i=@konsulko.com header.b="SM0uHaon"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 35AA7834FB; Tue, 12 Oct 2021 21:44:15 +0200 (CEST) Received: from mail-qt1-x831.google.com (mail-qt1-x831.google.com [IPv6:2607:f8b0:4864:20::831]) (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 5AEDE8352D for ; Tue, 12 Oct 2021 21:44:05 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qt1-x831.google.com with SMTP id c28so428231qtv.11 for ; Tue, 12 Oct 2021 12:44:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=d18885s0PyNi8xoJM5JC4Jpc1wU9TjOXXg7WSu1FrYc=; b=SM0uHaon2sWG1Ot8UtBZti8IcN/ShScDyZIWGaMHRFg9LKcqhs2f0B2trJyJ8l+AOM uKl4ophXJ1B8Rm4gKhEJDgt3KzT25/DUeiPjDk570u/DP+wrxuz4XH6xK3hO/BDadlSk iVV1ZiHZzDpWigFcsZeyRZpodVZmBRjDokQyY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=d18885s0PyNi8xoJM5JC4Jpc1wU9TjOXXg7WSu1FrYc=; b=5pqLDgkTJAdSfwjm6/NXS3A+GaNtoDYdQFfrW7RowL1237YnF81PfDTG9DOd/v+xyK WxtJa1fh+KLrKcrOCdMYfTwL+pxsPGAm36C8hg/ssstU6cFaZbt78LWkzELOLFGeRUOZ 2Mm41PncvzRjioeyokBAqGncpeb+bTE9M9+MhrvVCu46PzCSzfo5/H6rlVMuLKCjDSgv 360jMrXUeumL9MgoO93lgSeZuEiVEzqhMLMcw0Lmp6qFuWOaqoPkRteoOOFI9qkq1TZs ITjXkHogta1x7dUcnwR5zbeUzm3xsUbWdT6GW7kUGkaeAr4ktBccUAwNZ2WPGQwrWzXl zWbQ== X-Gm-Message-State: AOAM530CcLave1FwOWsAVHF1LJqVMpBT+W/ILuER1GPQ0nb/AZ+cwAtf bMWahBVxhmfvjYcS0rdCDj+zYQ== X-Google-Smtp-Source: ABdhPJyMAj19ZNDwDHjw+iGkHJ2FFLb4IoJHK+EcFdBEgI0j37uyssfH8mwBpaNcJrP96y2BSiw9nA== X-Received: by 2002:ac8:5d86:: with SMTP id d6mr24698986qtx.180.1634067844053; Tue, 12 Oct 2021 12:44:04 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b01-cbda-e98d-c49f-f596-1fb5.res6.spectrum.com. [2603:6081:7b01:cbda:e98d:c49f:f596:1fb5]) by smtp.gmail.com with ESMTPSA id d186sm204246qkg.25.2021.10.12.12.44.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Oct 2021 12:44:03 -0700 (PDT) Date: Tue, 12 Oct 2021 15:44:01 -0400 From: Tom Rini To: Artem Lapkin Cc: sjg@chromium.org, narmstrong@baylibre.com, twarren@nvidia.com, andre.przywara@arm.com, u-boot@lists.denx.de, u-boot-amlogic@groups.io, art@khadas.com, nick@khadas.com, gouwa@khadas.com Subject: Re: [PATCH] distro_boot: Fix bootfile env after calling boot_extlinux Message-ID: <20211012194401.GF7964@bill-the-cat> References: <20211012085544.3206394-1-art@khadas.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="AjD4W703GQxY/I8S" Content-Disposition: inline In-Reply-To: <20211012085544.3206394-1-art@khadas.com> X-Clacks-Overhead: GNU Terry Pratchett 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 --AjD4W703GQxY/I8S Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Oct 12, 2021 at 04:55:44PM +0800, Artem Lapkin wrote: > Problem >=20 > 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". >=20 > 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. >=20 > Solution >=20 > Save and restore default bootfile env value when boot_extlinux is used. >=20 > Example > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > 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... > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >=20 > Signed-off-by: Artem Lapkin > --- > include/config_distro_bootcmd.h | 2 ++ > 1 file changed, 2 insertions(+) >=20 > diff --git a/include/config_distro_bootcmd.h b/include/config_distro_boot= cmd.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=3D${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 --=20 Tom --AjD4W703GQxY/I8S Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmFl5YEACgkQFHw5/5Y0 tywbbAv+PBpq9C/TUw0OuETo6Fe/5NjzEX+56pZfvRh0IMpKGV/WSV0HtLxeyDCv B7Z5Skjbs5EtkbEtp5AbPTJnHw0lytS5/qZOGdpTfL2ozLCcdd45syXA+nxALNIb WHWEyajZfoolULieN7xni/CrHQXGayf6XZ8yKFJVG4gyk8vQxlGtwOBp+R7UmX0y asrPOMwNQcsQvB2Kguz1FXKUwgGnOJalcu53JYMkYpdeGJFhuolos/VAgDscxIrQ DZdI5cpN3EinZSFqGMi3FD2zEyNwmFxFD437eefjy9h+O3zjIyhyuQbmSSiebyRS +TtxUmJwTyylL7Ij3uqBV7KwPKVxOwwv6vpOqCzXgnqMS4acmJENg8FWhoGKlId6 xP7L84rr+FWiOw8ad3LRsDrebCc95lFYBLIv/4MUJz4e1k7NWsaJLsQnOOY11sFg aXey4CI0I3ESd/4bd0BWdhF6NGXmM+1u+m4h/Zue2n7O9q77KEimNEE2w53RiN15 HWBb6LGu =tG8e -----END PGP SIGNATURE----- --AjD4W703GQxY/I8S--