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 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 5A2F5C433EF for ; Tue, 25 Jan 2022 14:43:43 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C4EA081432; Tue, 25 Jan 2022 15:43:40 +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=1643121820; bh=nvYb3gG3jssrBoObMYf+vA+7tVUv0MoieZax9eNgK9k=; h=To:cc:From:Subject:In-reply-to:References:Date:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=IZtdyl+BW8HTIUn/2iss1waGcwHE34jWb2I9XuK28j+rkyyhx0Fu5Ju7rPybWSLMi 41rXGzwZiOIZOqhnDezfnL9k7gI5zLIy8HI+fpsfl7bwR/NKK8Tskr6mkijmR7sPWz 4qr0iUfem2MdnOX5445ZWexDK76fttdxUBxlp+shPm8uGJkZclrppjtL6BYEAata8H /UNqS9IvvSHH48p6XPoVeM67Ovhw/YJYCXphjzIkwKALtsGJu7UjvoxytNrMNrOQOM xtTiBWfvZ+8qN/4JJ88WMeEw+3hn559SUzRRuOPnVRA5C3FTo7k26SByEWnCn8O409 XJRCNV80bvD6g== Received: from janitor.denx.de (unknown [62.91.23.180]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: noc@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id C269B80F3F for ; Tue, 25 Jan 2022 15:43:38 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1643121818; bh=nvYb3gG3jssrBoObMYf+vA+7tVUv0MoieZax9eNgK9k=; h=To:cc:From:Subject:In-reply-to:References:Date:From; b=ZsEnIodTnXCC1HyfA6V81O37s22ZYMALaDTmIIIOlKSnmiZz26LPeXXP2ypUxAhqt D84B5Sx+b21bFvQYG5YITrw9ZQpZXv+OoKwI5VSXeF0mi3nFiBDkPxi8T45n8AHJPs KZmKECHGPNrMqK3PsqNIcvhGlM183fOLFm/H3VxN06nY7b258pSqgjH3pOnbG49W/U fNoyU6zu678KkyM7391wxCNhn8m2wGPXrV/cfzrFKprGhignxelfSBNQfcrLuGJULq bLXujw+UyweeJSUP3MuSagAHVsPL5hWwNowUmNHwWQJf44i53KphqtfNMsohRXR8Wk BsEXBC6n/im8Q== Received: by janitor.denx.de (Postfix, from userid 108) id 73596A0228; Tue, 25 Jan 2022 15:43:38 +0100 (CET) Received: from gemini.denx.de (gemini.denx.de [10.4.0.2]) by janitor.denx.de (Postfix) with ESMTPS id CB29AA0057; Tue, 25 Jan 2022 15:43:29 +0100 (CET) Received: from gemini.denx.de (localhost [IPv6:::1]) by gemini.denx.de (Postfix) with ESMTP id AE6551E1062; Tue, 25 Jan 2022 15:43:29 +0100 (CET) To: Ying-Chun Liu cc: u-boot@lists.denx.de, "Ying-Chun Liu (PaulLiu)" From: Wolfgang Denk Subject: Re: [RFC 0/2] A/B firmware update based in eMMC boot partition. MIME-Version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 8bit In-reply-to: <20220125135535.224061-1-grandpaul@gmail.com> References: <20220125135535.224061-1-grandpaul@gmail.com> Comments: In-reply-to Ying-Chun Liu message dated "Tue, 25 Jan 2022 21:55:33 +0800." Date: Tue, 25 Jan 2022 15:43:29 +0100 Message-ID: <3678646.1643121809@gemini.denx.de> 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.5 at phobos.denx.de X-Virus-Status: Clean Dear Ying-Chun Liu, In message <20220125135535.224061-1-grandpaul@gmail.com> you wrote: > > I've implemented A/B firmware update based on eMMC hw partitions. > Normally we have 2 boot partitions on eMMC. One is active and another > is inactive. We can then flash the firmware to the inactive one and > make it active. We have been doing software updates using U-Boot scripts etc. for many, many years. But during that time a large number of restrictions and shortcomings became clear. this is why projects like SWUpdate [1] came into life, and U-Boot supports this only with very basic features: - watchdog support to reset a hanging system - boot counter to switch to an alternate boot command in case of too many failed boot attempts That's all. Not more is needed, and not more should be used in U-Boot. I'm not sure if you know SWUpdate - if not, you should definitely look into it. I strongly recommend not to try to reinvent that wheel - poorly - in U-Boot. We have been there before, and got rid of this approach for a pretty long list of good reasons. [1] https://sbabic.github.io/swupdate/ Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de "More software projects have gone awry for lack of calendar time than for all other causes combined." - Fred Brooks, Jr., _The Mythical Man Month_