Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp7967612rwb; Mon, 12 Dec 2022 23:41:40 -0800 (PST) X-Google-Smtp-Source: AA0mqf6w5GGiIDzgcEz1hNiUsKc6xzuEjO992HjF+hNNuWx8aAWqsUWzuV5peij22tFaZZNzXBY0 X-Received: by 2002:a05:6a20:69a0:b0:9d:efbe:52ae with SMTP id t32-20020a056a2069a000b0009defbe52aemr31041133pzk.30.1670917300578; Mon, 12 Dec 2022 23:41:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670917300; cv=none; d=google.com; s=arc-20160816; b=y1VQ/n+FQv01rSFUFAzBIHXA8z3dXmMs44bkgK5BySN1+SOg6M7Yx+/TbVUfPrGhUf OIyfiT+Mv0tBuairK+M/Om44g17I5OALyUc/zovXc/Q++407ZIKKsPHsh4S75gqiO7Ha PYTnO0Fg9F1rqnAF+/9Zv9NqRK+26kX2BRwriWBQ5cTNyMhCoH+znVkY/2qWlJJdc98I blN/neRHAXkTo2DoTjoN9qiD6uaKmqE3mKhLcLNrhN0+9RJfVI9dyPmHyi6jQsTEHYYx eTf2JIy1c2d2wFCaerD631klN5S6X8Nu6FH7VsasskBJXiHObkweC4bHOzjOWRxIKu4/ 76xA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=s0r3sKZ22FIW4RvgWC+odYHiBjrvzyEHiairyKLURUw=; b=zKo54fRHn0NL0EEoBtBHCFzbO5CE5GFeiVTdu42wyYthG8EBPJzTN3Q7rZJGonSzMY CI8hLMolFSm5VRIa7ZQPJhNPrb8le5X+IQz6vcC3fmc0bw5/lf30/A+C9Z5qlJvETktY 0mEYmS1wz+k74mF2iasi1jzZkpVBl+SqUKNBFO6le8PwwD+BOSiacQtW7ciIocYVeec5 J3LMBDcjifPrYtGtjEV+b3AbIXmoIGl8p//1HLl3uQuevNU0VhM9FDahHNpKcTxCmAxC QOpcgqvxa7VuUnPkwzMC+L4X/FhsIzL6u+gbs2lALoL07OUvJg3vVr2ftIp3uVusQNtI gkCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=Fm6ZNDDE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 67-20020a630646000000b0046af0960898si12236214pgg.625.2022.12.12.23.41.30; Mon, 12 Dec 2022 23:41:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=Fm6ZNDDE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234515AbiLMGs3 (ORCPT + 74 others); Tue, 13 Dec 2022 01:48:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37772 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233753AbiLMGs1 (ORCPT ); Tue, 13 Dec 2022 01:48:27 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1607817E25; Mon, 12 Dec 2022 22:48:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=s0r3sKZ22FIW4RvgWC+odYHiBjrvzyEHiairyKLURUw=; b=Fm6ZNDDEmC3fVLokI8VI0Gp2MS Yh8D7Z85GByribjANlhRTC6B/h6YIlKrFAQHvCcVzw+9DOKKK7UkrjjRAhjdEKIZRgS7CQYm3Tcfq 3JCkXGKhXxCwv76phRO+ch2i56rSxizrcJN4qDcOdxwmdm3xPyT69TcMYIEzKwj+fogN1QKOXMGh9 qsHMLVS7x9/gMv6Lxvaq91BRXMAwjJAsw852mPRphL/7O7d+H5TiUOu7Wdx4whLSQ8Th7XMmbqGJG GmsFz+lDdQxVtbjr0sBEBhEZOyKElejvc9NRU9qr5x/xNSvOgr/VlZtDqGUKm0NxBFPjO0nUhj3+y KuL5dk/A==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1p4z5I-00Btcm-Bb; Tue, 13 Dec 2022 06:48:12 +0000 Date: Mon, 12 Dec 2022 22:48:12 -0800 From: Christoph Hellwig To: Daniel Golle Cc: Christoph Hellwig , Richard Weinberger , Matthew Wilcox , Jens Axboe , "Martin K. Petersen" , Chaitanya Kulkarni , Wolfram Sang , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH 1/4] init: move block device helpers from init/do_mounts.c Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_PDS_OTHER_BAD_TLD autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 12, 2022 at 11:02:33AM +0000, Daniel Golle wrote: > The thing is that there isn't anything extraordinarily complex here, > just dynamically partitioning a block device based on a well-known > format. Yes, but a completely non-standard format that nests inside an partition. > Using initramfs implies that we would need a 2nd copy of the standard C > library and libfdt, both alone will already occupy more than just a > single 64kB block of flash. Why do you need libfdt? And with a simple statically linked kpartx you won't pull in much of libc either. > I understand that from the point of view of > classic x86 servers or even embedded devices with eMMC this seems > negligible. However, keep in mind that a huge number of existing > devices and also new designs of embedded devices often boot from just a > few megabytes of NOR flash, and there every byte counts. So I've worked quite a bit on really small deeply embedded systems, and for those I wouldn't even think of using strange image formats or the rather wasteful GPT partition format. There we wouldn't dare to use paritions or weird image formats, but > > What is the point of the uImage.FIT? > > It is the format used by Das U-Boot, which is by far the most common > bootloader found on small embedded devices running Linux. > Is is already used by Das U-Boot to validate and load kernel, > devicetree, initramfs, ... to RAM before launching Linux. > I've included a link to the documentation[1] which gives insights > regarding the motivation to create such a format. That doesn't explain why you'd want to use it. Nor how people came up with it. > In fact, that's only one out of three possible uses in which parsing > the contained sub-image boundaries can be useful: > * On devices with NOR flash uImage.FIT is stored in an MTD partition, > hence the uImage.FIT partition parser (or small stackable block > driver) would then operate on top of /dev/mtdblockX. > > * On devices with NAND flash uImage.FIT is stored in a UBI volume, > hence in this case /dev/ubiblockX needs to be processed. And all the mtdblock / ubiblock is due to the lack of a native mtd/ubi backend for squashfs? Why can't we take the block layer out of the loop entirely? > I hope this explains my motivation. Please ask should there by any > doubts or if any of my explainations above are not clear. None of this explains the silly nesting inside the GPT partition. It is not needed for the any use cases and the root probem here. Without that you could simply implement a parition format, with that you get into crazy nesting behavior. Note that it would have any benefit over just not doing this silly image. Maybe someone just needs to go back and come up wit ha scheme that actually works and implement that in uboot as well.