From patchwork Tue Oct 12 08:55:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Art Nikpal X-Patchwork-Id: 1539645 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=FJMej+ic; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HT8f72WVpz9sR4 for ; Tue, 12 Oct 2021 19:56:13 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B2B07820E3; Tue, 12 Oct 2021 10:56:01 +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="FJMej+ic"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 244FE8321C; Tue, 12 Oct 2021 10:55:59 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) (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 E9E4180ECC for ; Tue, 12 Oct 2021 10:55:55 +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-pj1-x1030.google.com with SMTP id qe4-20020a17090b4f8400b0019f663cfcd1so1394252pjb.1 for ; Tue, 12 Oct 2021 01:55:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=H4b5A+uQFIgyI5gwvtfWtDYq+950IKqyve6aNO5RDzM=; b=FJMej+ichqwyCarYkYCSUEoqnefMhfofFoPa+XLJgRFMROxJJWwlmZwSzSudoIoWTQ wXv8e224uqEqPOQX5ivXJ21BiShKARPCPpmdIIrbji1NBsvu91wxpv4ZXEGS28/ktB6W k9nbKeMw4BIrwYA+C+5iGsYsprpr3QiZywpiR4VQ51y91A81DHR20gpyNBXUGO3LsvOc djbhl9bPnkFD2klVFQ82ycwj0gXz034CAOmBHomNh9D4Cc3oRTMiMwVWzcNs+2Uzr9S2 m/qlVwSXMfhkgwUP3EKD0HxhTpCgmJLUjVZCnyKD+5DAJGDl2ENEuLeo/E04+PjZkcC9 Z0Jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=H4b5A+uQFIgyI5gwvtfWtDYq+950IKqyve6aNO5RDzM=; b=pa6PaJBYn27cnOI27dvcbdooApobR76hhNVUDvsyY9Tz1J0WYbLcauUKZLxr4wiABC lb4s4z3B1Dpdf6u+ge92qhnUbwTZHdp/DCFTfRt+jWTBC9hcNEdVIEtrHVOTytp3rkiJ hOFn6i3Cfm9ViF47/n/B4hTFiWY6NBFrzT3pHavyMLfaHXBg8UkFH9HE5+NwRrlZjqqT NNDN9B/An6EouFKsbnL2kKn2CoMKGfPjFktt6r7Ohudb1MCph6BPz78vDoGEauMVCLzJ IoMIIR/UM8e1K5zcL2AcI5Y6YeCE8iXsYQwMDTtE8a9dK+nKQmFPZApfbtMDpXd0aYgL tC9w== X-Gm-Message-State: AOAM531D3qq7yb0zL+qEFaUI7rBWP1WleCnVkAE7SUdeB6HgGYN8V8Mi n8mYKo3EfpthlCnlgpHaD8s= X-Google-Smtp-Source: ABdhPJwCDTkguDnJ+7tWxGC/8+N5tA+jJ5PbmGL5GsKaAo/S9wEbiM1NNg8D+S6q/kx+HHLvzWP8kA== X-Received: by 2002:a17:90a:9291:: with SMTP id n17mr4556673pjo.243.1634028954189; Tue, 12 Oct 2021 01:55:54 -0700 (PDT) Received: from localhost.localdomain (104.194.74.249.16clouds.com. [104.194.74.249]) by smtp.gmail.com with ESMTPSA id k9sm10179310pfa.88.2021.10.12.01.55.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Oct 2021 01:55:53 -0700 (PDT) From: Artem Lapkin X-Google-Original-From: Artem Lapkin To: sjg@chromium.org Cc: trini@konsulko.com, 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: [PATCH] distro_boot: Fix bootfile env after calling boot_extlinux Date: Tue, 12 Oct 2021 16:55:44 +0800 Message-Id: <20211012085544.3206394-1-art@khadas.com> X-Mailer: git-send-email 2.25.1 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.103.2 at phobos.denx.de X-Virus-Status: Clean 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 Reviewed-by: Tom Rini Reviewed-by: Simon Glass --- 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" \ \