From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Thu, 08 Jun 2023 09:28:59 +0200 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1q7A4r-00FS23-6p for lore@lore.pengutronix.de; Thu, 08 Jun 2023 09:28:59 +0200 Received: from localhost ([127.0.0.1] helo=metis.ext.pengutronix.de) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1q7A4o-0002bh-70; Thu, 08 Jun 2023 09:28:58 +0200 Received: from ptz.office.stw.pengutronix.de ([2a0a:edc0:0:900:1d::77] helo=[127.0.0.1]) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1q7A4g-0002b0-FY; Thu, 08 Jun 2023 09:28:50 +0200 Message-ID: Date: Thu, 8 Jun 2023 09:28:50 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.1 Content-Language: en-US From: Ahmad Fatoum To: Johannes Zink , distrokit@pengutronix.de References: <20230606-default_enable_fastboot_rock3a-v1-0-42195d538df2@pengutronix.de> <20230606-default_enable_fastboot_rock3a-v1-3-42195d538df2@pengutronix.de> <934f9d86-e7cb-ed58-7a0a-f27465f6b4d2@pengutronix.de> <088608ad-dad6-f6c1-0b51-415c5b508b23@pengutronix.de> <2a9d6033-3ab0-70ac-6b27-072e9af2f6ef@pengutronix.de> In-Reply-To: <2a9d6033-3ab0-70ac-6b27-072e9af2f6ef@pengutronix.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [DistroKit] [PATCH 3/5] v8a: images: generate sparse images from rock3a initramfs, kernel and dtb X-BeenThere: distrokit@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: DistroKit Mailinglist List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: patchwork-jzi@pengutronix.de Sender: "DistroKit" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: distrokit-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false On 06.06.23 17:26, Ahmad Fatoum wrote: > On 06.06.23 17:04, Johannes Zink wrote: >> On 6/6/23 16:51, Ahmad Fatoum wrote: >>> On 06.06.23 16:47, Johannes Zink wrote: >>> Can you describe how to reproduce this with a normal DistroKit build? >> >> sure, just apply this series (or at least patch 1/5 for initrd generation), run ptxdist images and expose a fastboot partition on the DUT by calling >> >> usbgadget -A /tmp/initramfs(initramfs)c >> >> then use fastboot to upload the cpio.gz from your distrokit build dir >> >> fastboot flash initramfs platform-v8a/images/initramfs-sparse.img > > I can reproduce this with fastboot version 28.0.2-debian. > It wasn't always like that. I assume -S 0 wasn't always the > default, but I haven't checked the code. I think it's worth a bug > report. I gave this a try and I am not so sure anymore this is a bug. Small images are uploaded without problem. This cut off seems to be 8M. Above 8M, transferred file size is rounded up to be a multiple of 4096 bytes. Files that are not aligned and bigger than 8M trigger the issue. I assume we had not noticed this before because we either flash disk images which are 4K aligned or we flash small images which were < 8M. I haven't looked into the fastboot client code, but a look would be worthwhile to decide how to proceed. >>>> It saves upload time anyway, at least for the initramfs, so it's a good idea to use sparse images, anyway. >>> >>> Sparse is a compression algorithm, albeit a very primitive one. Your kernel and >>> initrd should already be compressed, so if you have savings from compressing >>> them again with sparse, there's something wrong IMO. >>> >>> The device tree is small enough that it shouldn't matter. > > As mentioned, I don't think double compression is useful. > On our side, we can likely just use -S 1 to restore the old behavior. -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |