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 C0F63C54EBD for ; Thu, 5 Jan 2023 13:08:40 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B1AD3855A2; Thu, 5 Jan 2023 14:08:38 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1672924118; bh=OhV6Nd4Cx0tF0xd7z1cZbEt0XO+la7EUCPb6LeVrsLc=; h=From:To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=JBTwi6LTmjOQ4LvpNfS2+8gXP+Il2M4XH8RJWmZrNQ8uIxQTqub/vy0VISpLjPkhI EvE7wUA53A9eInLm8G0gG2TIo26APGnTjNdH0xi+YWie5Hxf8Bh2RAIV1qnuxP1a8t ZjMxSHi07oBKkGdWYPDBAkV7FX8X1+MFK/8wIW3k6B5KhyRdDODRBQvwdR6H08Z7Ma g04dLDXoCfEdx5XzrprL/ud4pUTn0DM1tomP/HJCSOk4iZU91sWAyMY/wzhlde57kj TSJRTnkNDYcbJmdQ/vX5oHOr9C4MbAR6CbophlcMJdpOAcsE7pMtXmb/FA08FNcEgS pLhIJUjcQJxCg== Received: from tr.lan (ip-86-49-120-218.bb.vodafone.cz [86.49.120.218]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: marex@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 39D8885580; Thu, 5 Jan 2023 14:08:36 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1672924116; bh=OhV6Nd4Cx0tF0xd7z1cZbEt0XO+la7EUCPb6LeVrsLc=; h=From:To:Cc:Subject:Date:From; b=V6QqW6iNPQRYUONhRpiU1/r5GG/14RzqkuA7Si7xkmuaUNt/BzzswJxkBRBMvSlR0 CV4KD0UVcE5g3Pxq0CRCguJQVTXZGBig3ah440kTNGE0eQHwF6nqGcNtk/vfhEnHZY NMDX82LmzQvi0sZCo7ymZyElzcNYbpYw+BhL1iRQNOZxJ0Bi2izH90tsutPGlk+tUi fOtEX/RLUnZZ3BDkEPp+tqhs+QR272tR2iRLuTh2MYAepEISA6SMLDNvntzatNuPXd O1xt35r0HryF+0p7CxjqW4/ffPZQk8HEscQEqBhJ9jr0xMgggPQiSc9q12KUv6bUVK I66URkFUNdOrw== From: Marek Vasut To: u-boot@lists.denx.de Cc: Marek Vasut , Frieder Schrempf , "Matwey V . Kornilov" , Pali Rohar , Peter Hoyes , Tom Rini Subject: [PATCH] distro_bootcmd: Set distro_bootpart_uuid for block devices Date: Thu, 5 Jan 2023 14:08:23 +0100 Message-Id: <20230105130823.97130-1-marex@denx.de> X-Mailer: git-send-email 2.39.0 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 The assignment of block device nodes in Linux is not deterministic by default, i.e. a newly added eMMC controller or other block device can change the assignment of /dev/mmcblkN (or other block device node like e.g. /dev/sdXy) and prevent the system from picking the correct block device for root filesystem in case the root filesystem is specified on kernel command line using 'root=/dev/mmcblkNpM' (or 'root=/dev/sdXy' etc.). One way out is to derive PARTUUID in U-Boot, which is unique identifier of a partition, and pass that as root=PARTUUID= to Linux via kernel command line. Linux would then find the partition using PARTUUID, no matter on which block device the partition resides and which node was assigned to that block device. Derive the PARTUUID before scanning for extlinux presence and assign it into distro_bootpart_uuid environment variable, which can then be used in extlinux.conf kernel command line specifier. Note that it is not possible to do this in scan_dev_for_extlinux script because this script is called from scan_dev_for_boot script, which is called for both block devices as well as UBI volumes, and we can not derive PARTUUID for UBI volumes. Signed-off-by: Marek Vasut --- Cc: Frieder Schrempf Cc: Matwey V. Kornilov Cc: Pali Rohar Cc: Peter Hoyes Cc: Tom Rini --- include/config_distro_bootcmd.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/config_distro_bootcmd.h b/include/config_distro_bootcmd.h index c3a2414b914..9d2a225e7eb 100644 --- a/include/config_distro_bootcmd.h +++ b/include/config_distro_bootcmd.h @@ -521,6 +521,9 @@ "if fstype ${devtype} " \ "${devnum}:${distro_bootpart} " \ "bootfstype; then " \ + "part uuid ${devtype} " \ + "${devnum}:${distro_bootpart} " \ + "distro_bootpart_uuid ; " \ "run scan_dev_for_boot; " \ "fi; " \ "done; " \ -- 2.39.0