From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: Johannes Zink <j.zink@pengutronix.de>, distrokit@pengutronix.de
Cc: patchwork-jzi@pengutronix.de
Subject: Re: [DistroKit] [PATCH 3/5] v8a: images: generate sparse images from rock3a initramfs, kernel and dtb
Date: Tue, 6 Jun 2023 17:26:29 +0200 [thread overview]
Message-ID: <2a9d6033-3ab0-70ac-6b27-072e9af2f6ef@pengutronix.de> (raw)
In-Reply-To: <b4b38edf-7217-7fe0-fd88-ab322b9e209f@pengutronix.de>
On 06.06.23 17:04, Johannes Zink wrote:
> On 6/6/23 16:51, Ahmad Fatoum wrote:
>> Hello Johannes,
>>
>> On 06.06.23 16:47, Johannes Zink wrote:
>>> On 6/6/23 16:41, Ahmad Fatoum wrote:
>>>> On 06.06.23 16:31, Johannes Zink wrote:
>>>>> This allows to load the images to barebox using android fastboot, since
>>>>> otherwise the sparse header is missing and the image size is not
>>>>> properly aligned as required by fastboot.
>>>>
>>>> IME fastboot just complains and transfers the files anyway. In that
>>>> case building sparse images just adds complication. Did your fastboot
>>>> command fail without this change?
>>>>
>>>
>>> Uploading non-sparse images failed with an error
>>>
>>> Invalid sparse file format at header magic
>>> error: write_sparse_skip_chunk: don't care size 45251584 is not a multiple of the block size 4096
>>>
>>> at the host tool, which is why I decided to use sparse images.
>>
>> 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.
>>> 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.
Cheers,
Ahmad
>>
>> Cheers,
>> Ahmad
>>
>>
>>>
>>> Johannes
>>>
>>>
>>>>>
>>>>> Signed-off-by: Johannes Zink <j.zink@pengutronix.de>
>>>>> ---
>>>>> configs/platform-v8a/config/images/rock3a.config | 21 +++++++++++++++++++++
>>>>> 1 file changed, 21 insertions(+)
>>>>>
>>>>> diff --git a/configs/platform-v8a/config/images/rock3a.config b/configs/platform-v8a/config/images/rock3a.config
>>>>> index 522d82cdc9c9..cb0c7c4e575d 100644
>>>>> --- a/configs/platform-v8a/config/images/rock3a.config
>>>>> +++ b/configs/platform-v8a/config/images/rock3a.config
>>>>> @@ -44,3 +44,24 @@ image barebox-rock3a.norimg {
>>>>> image = "barebox-rock3a.img"
>>>>> }
>>>>> }
>>>>> +
>>>>> +image initramfs-sparse.img {
>>>>> + android-sparse {
>>>>> + image = "root.cpio.gz"
>>>>> + block-size = 4k
>>>>> + }
>>>>> +}
>>>>> +
>>>>> +image kernel-sparse.img {
>>>>> + android-sparse {
>>>>> + image = "linuximage"
>>>>> + block-size = 4k
>>>>> + }
>>>>> +}
>>>>> +
>>>>> +image dtb-rock3a-sparse.img {
>>>>> + android-sparse {
>>>>> + image = "rk3568-rock-3a.dtb"
>>>>> + block-size = 4k
>>>>> + }
>>>>> +}
>>>>>
>>>>
>>>
>>
>
--
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 |
next prev parent reply other threads:[~2023-06-06 15:26 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-06 14:31 [DistroKit] [PATCH 0/5] enable uploading kernel, dtb and initramfs over fastboot and boot it on Rock3A Johannes Zink
2023-06-06 14:31 ` [DistroKit] [PATCH 1/5] v8a: enable initrd generation Johannes Zink
2023-06-06 14:37 ` Ahmad Fatoum
2023-06-06 14:44 ` Johannes Zink
2023-06-06 14:59 ` Jan Lübbe
2023-06-06 15:02 ` Johannes Zink
2023-06-06 14:31 ` [DistroKit] [PATCH 2/5] v8a: kernel: enable initramfs in kernel config Johannes Zink
2023-06-06 14:37 ` Ahmad Fatoum
2023-06-06 14:31 ` [DistroKit] [PATCH 3/5] v8a: images: generate sparse images from rock3a initramfs, kernel and dtb Johannes Zink
2023-06-06 14:41 ` Ahmad Fatoum
2023-06-06 14:42 ` Ahmad Fatoum
2023-06-06 14:49 ` Johannes Zink
2023-06-06 14:54 ` Ahmad Fatoum
2023-06-06 14:47 ` Johannes Zink
2023-06-06 14:51 ` Ahmad Fatoum
2023-06-06 15:04 ` Johannes Zink
2023-06-06 15:26 ` Ahmad Fatoum [this message]
2023-06-08 7:28 ` Ahmad Fatoum
2023-06-06 14:31 ` [DistroKit] [PATCH 4/5] v8a: barebox: enable loading kernel, dtb and initrd via fastboot Johannes Zink
2023-06-06 14:44 ` Ahmad Fatoum
2023-06-06 14:54 ` Johannes Zink
2023-06-08 7:36 ` Ahmad Fatoum
2023-06-09 6:26 ` Johannes Zink
2023-06-06 15:04 ` Jan Lübbe
2023-06-06 15:14 ` Johannes Zink
2023-06-06 15:16 ` Jan Lübbe
2023-06-06 14:31 ` [DistroKit] [PATCH 5/5] v8a: barebox: add a boot target for fastboot loaded image files Johannes Zink
2023-06-06 14:47 ` Ahmad Fatoum
2023-06-06 15:07 ` Jan Lübbe
2023-06-06 15:13 ` Johannes Zink
2023-06-09 9:53 ` Johannes Zink
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2a9d6033-3ab0-70ac-6b27-072e9af2f6ef@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=distrokit@pengutronix.de \
--cc=j.zink@pengutronix.de \
--cc=patchwork-jzi@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox