From patchwork Tue Jan 26 13:56:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gary Bisson X-Patchwork-Id: 1431708 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=boundarydevices.com header.i=@boundarydevices.com header.a=rsa-sha256 header.s=google header.b=ibZjNOUY; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DQ7ZX4BTPz9s2g for ; Wed, 27 Jan 2021 00:56:41 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0EB4982344; Tue, 26 Jan 2021 14:56:32 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=boundarydevices.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=boundarydevices.com header.i=@boundarydevices.com header.b="ibZjNOUY"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E872582366; Tue, 26 Jan 2021 14:56:29 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) (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 ED0958002F for ; Tue, 26 Jan 2021 14:56:26 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=boundarydevices.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=gary.bisson@boundarydevices.com Received: by mail-wr1-x429.google.com with SMTP id 6so16553515wri.3 for ; Tue, 26 Jan 2021 05:56:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=boundarydevices.com; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=FGiR6+hoMItl3m8y+FKxTwdKgOlKlUYD6tpHvlUjxQs=; b=ibZjNOUYdE2V3MUdF6VGuX+oL4moJB936JZOc+jaPgvAJFSpP2Gz1VKCvJuc9L8mAE IKt8Sb9A28HNvmfMXU409uzT/Jc+hs8BVtPEkWFegmK0wZuXJJxYjMwfHsFGCCU21bs8 QP7cabtDHD3MwnIQgPE3YCF8Te27NiWHXU0+I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=FGiR6+hoMItl3m8y+FKxTwdKgOlKlUYD6tpHvlUjxQs=; b=oHRlTYj7IyBTAN96grK9FDYtxyIybsHprasWqAVt+JXYq2n5EE2LTCpoWWuFGu08gP nc/CuBtGyNAqcSNhjcBIcdWrg1z2TNUNuy4qo7po8RDcSSxP80NYzvzKEH2iGXbSzoKK UUxdzCub1yCqfhbm1wfT/r3o7e+fSBuV3APtrZjA/5o0XakCnoBVLz4VcUQ3lsPuppaF sigU6Xr8U7TWIK1+Twyk7Zj7AnZrrZ7q/sL7woGUZOxTmMNi5OFPl4EPxKATqx/ZB2P/ tlWYqcU1luy4gWj6/2uZk+dgRjdBTSkjX8zybU21WPO1+YMlmB7PIDrtN1AhBJ35MtTS ohNQ== X-Gm-Message-State: AOAM530+BJvTNCu2jAjz4zmm9c2HpcfzeLNyEKRDkI2mMysR+s/i6qhQ KuYxi3GYbOyHP1L1QqYUJDaTYQ+IZRTgs3RV X-Google-Smtp-Source: ABdhPJxo91kRFxFqEWnabPWJ17AwNlp3KVi6OAhP8Lo8PYmSSaTClPLn1va1sBJeVKxYS2CaPTPlAg== X-Received: by 2002:a5d:60d0:: with SMTP id x16mr6245396wrt.269.1611669386159; Tue, 26 Jan 2021 05:56:26 -0800 (PST) Received: from p1g2.home (2a01cb000f9f0e008f0bd0d6ec94dd0e.ipv6.abo.wanadoo.fr. [2a01:cb00:f9f:e00:8f0b:d0d6:ec94:dd0e]) by smtp.gmail.com with ESMTPSA id s19sm30338037wrf.72.2021.01.26.05.56.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Jan 2021 05:56:25 -0800 (PST) From: Gary Bisson To: u-boot@lists.denx.de Cc: sjg@chromium.org, xypron.glpk@gmx.de, rasmus.villemoes@prevas.dk, Gary Bisson Subject: [PATCH] disk: part_efi: update partition table entries after write Date: Tue, 26 Jan 2021 14:56:23 +0100 Message-Id: <20210126135623.723327-1-gary.bisson@boundarydevices.com> X-Mailer: git-send-email 2.29.2 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.102.3 at phobos.denx.de X-Virus-Status: Clean Fixes fastboot issues when switching from mbr to gpt partition tables. Signed-off-by: Gary Bisson Reviewed-by: Heinrich Schuchardt --- Hi, I hesitated calling this a RFC as I'm not sure everyone will like the idea. Basically the issue encountered was the following: - Device with its storage flashed with a MBR partition table - Run fastboot to flash a new OS (and new partition table) - After flashing a GPT partition table, U-Boot couldn't find any of the partition names from the GPT -> reason is that the partition table entries aren't updated -> so U-Boot still believes it's a MBR table inside and so its parsing fails This commit adds an update of the table entries inside the write_mbr_and_gpt_partitions() function. At first I thought maybe this should be added in fastboot file (fb_mmc.c) but couldn't think of a good reason why this shouldn't happened in part_efi directly. Let me know if you have any questions. Regards, Gary --- disk/part_efi.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/disk/part_efi.c b/disk/part_efi.c index 2f922662e6e..7a24e33d189 100644 --- a/disk/part_efi.c +++ b/disk/part_efi.c @@ -867,6 +867,9 @@ int write_mbr_and_gpt_partitions(struct blk_desc *dev_desc, void *buf) return 1; } + /* Update the partition table entries*/ + part_init(dev_desc); + return 0; } #endif