* [Buildroot] [PATCH next] board/friendlyarm/nanopi-neo: fix uboot partition size
@ 2024-08-15 17:28 Dong Wang
2024-08-15 17:50 ` Yann E. MORIN
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: Dong Wang @ 2024-08-15 17:28 UTC (permalink / raw)
To: buildroot; +Cc: Dong Wang, Thomas Petazzoni
This patch fixes the wrongly calculated uboot partition size in
genimage.cfg. The size should be 1016K, which is
1MB (typical partition start) - 8K(offset dictated by the bootrom).
Signed-off-by: Dong Wang <wangdong115@foxmail.com>
---
board/friendlyarm/nanopi-neo/genimage.cfg | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/board/friendlyarm/nanopi-neo/genimage.cfg b/board/friendlyarm/nanopi-neo/genimage.cfg
index ec78fd0e56..8d6bdd3295 100644
--- a/board/friendlyarm/nanopi-neo/genimage.cfg
+++ b/board/friendlyarm/nanopi-neo/genimage.cfg
@@ -7,7 +7,7 @@ image sdcard.img {
in-partition-table = false
image = "u-boot-sunxi-with-spl.bin"
offset = 8K
- size = 1000K # 1MB - 8KB(offset) - 16KB(GPT)
+ size = 1016K # 1MB - 8KB(offset)
}
partition rootfs {
--
2.25.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [Buildroot] [PATCH next] board/friendlyarm/nanopi-neo: fix uboot partition size
2024-08-15 17:28 [Buildroot] [PATCH next] board/friendlyarm/nanopi-neo: fix uboot partition size Dong Wang
@ 2024-08-15 17:50 ` Yann E. MORIN
2024-08-15 17:58 ` Darren Wang
2024-08-15 18:19 ` Yann E. MORIN
2024-08-15 19:50 ` Thomas Petazzoni via buildroot
2 siblings, 1 reply; 9+ messages in thread
From: Yann E. MORIN @ 2024-08-15 17:50 UTC (permalink / raw)
To: Dong Wang; +Cc: Thomas Petazzoni, buildroot
Dong Wang, All,
Thanks for your contribution.
On 2024-08-16 01:28 +0800, Dong Wang spake thusly:
> This patch fixes the wrongly calculated uboot partition size in
> genimage.cfg. The size should be 1016K, which is
> 1MB (typical partition start) - 8K(offset dictated by the bootrom).
It seems you are using an old version of Buildroot, as the defconfig
and board files for nanopi_neo were removed with commit c0a44ba0dfbf
(configs/friendlyarm_nanopi_neo: drop defconfig), in August 2022, two
years ago.
If you are still using nanopi_neo and have access to that board, then
you are welcome to submit it again, of course!
Regards,
Yann E. MORIN.
> Signed-off-by: Dong Wang <wangdong115@foxmail.com>
> ---
> board/friendlyarm/nanopi-neo/genimage.cfg | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/board/friendlyarm/nanopi-neo/genimage.cfg b/board/friendlyarm/nanopi-neo/genimage.cfg
> index ec78fd0e56..8d6bdd3295 100644
> --- a/board/friendlyarm/nanopi-neo/genimage.cfg
> +++ b/board/friendlyarm/nanopi-neo/genimage.cfg
> @@ -7,7 +7,7 @@ image sdcard.img {
> in-partition-table = false
> image = "u-boot-sunxi-with-spl.bin"
> offset = 8K
> - size = 1000K # 1MB - 8KB(offset) - 16KB(GPT)
> + size = 1016K # 1MB - 8KB(offset)
> }
>
> partition rootfs {
> --
> 2.25.1
>
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Buildroot] [PATCH next] board/friendlyarm/nanopi-neo: fix uboot partition size
2024-08-15 17:50 ` Yann E. MORIN
@ 2024-08-15 17:58 ` Darren Wang
2024-08-15 18:14 ` Yann E. MORIN
0 siblings, 1 reply; 9+ messages in thread
From: Darren Wang @ 2024-08-15 17:58 UTC (permalink / raw)
To: Yann E. MORIN; +Cc: Thomas Petazzoni, buildroot
Hi Yann,
On 2024/8/16 01:50, Yann E. MORIN wrote:
> Dong Wang, All,
>
> Thanks for your contribution.
>
> On 2024-08-16 01:28 +0800, Dong Wang spake thusly:
>> This patch fixes the wrongly calculated uboot partition size in
>> genimage.cfg. The size should be 1016K, which is
>> 1MB (typical partition start) - 8K(offset dictated by the bootrom).
>
> It seems you are using an old version of Buildroot, as the defconfig
> and board files for nanopi_neo were removed with commit c0a44ba0dfbf
> (configs/friendlyarm_nanopi_neo: drop defconfig), in August 2022, two
> years ago. >
> If you are still using nanopi_neo and have access to that board, then
> you are welcome to submit it again, of course!
I already did! See
https://git.buildroot.net/buildroot/commit/?id=4265790541e925708364e1e86038bd2884eec3a5
This is an follow up on the above commit to resolve Thomas's comments!
>
> Regards,
> Yann E. MORIN.
>
>> Signed-off-by: Dong Wang <wangdong115@foxmail.com>
>> ---
>> board/friendlyarm/nanopi-neo/genimage.cfg | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/board/friendlyarm/nanopi-neo/genimage.cfg b/board/friendlyarm/nanopi-neo/genimage.cfg
>> index ec78fd0e56..8d6bdd3295 100644
>> --- a/board/friendlyarm/nanopi-neo/genimage.cfg
>> +++ b/board/friendlyarm/nanopi-neo/genimage.cfg
>> @@ -7,7 +7,7 @@ image sdcard.img {
>> in-partition-table = false
>> image = "u-boot-sunxi-with-spl.bin"
>> offset = 8K
>> - size = 1000K # 1MB - 8KB(offset) - 16KB(GPT)
>> + size = 1016K # 1MB - 8KB(offset)
>> }
>>
>> partition rootfs {
>> --
>> 2.25.1
>>
>> _______________________________________________
>> buildroot mailing list
>> buildroot@buildroot.org
>> https://lists.buildroot.org/mailman/listinfo/buildroot
>
Thanks!
Dong Wang
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Buildroot] [PATCH next] board/friendlyarm/nanopi-neo: fix uboot partition size
2024-08-15 17:58 ` Darren Wang
@ 2024-08-15 18:14 ` Yann E. MORIN
0 siblings, 0 replies; 9+ messages in thread
From: Yann E. MORIN @ 2024-08-15 18:14 UTC (permalink / raw)
To: Darren Wang; +Cc: Thomas Petazzoni, buildroot
Darren, All,
On 2024-08-16 01:58 +0800, Darren Wang spake thusly:
> On 2024/8/16 01:50, Yann E. MORIN wrote:
[--SNIP--]
> > If you are still using nanopi_neo and have access to that board, then
> > you are welcome to submit it again, of course!
> I already did! See https://git.buildroot.net/buildroot/commit/?id=4265790541e925708364e1e86038bd2884eec3a5
Damned, I missed that it was so recent, and forgot to look it up on the
next branch. Sorry for the confusion. Thanks!
Regards,
Yann E. MORIN.
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Buildroot] [PATCH next] board/friendlyarm/nanopi-neo: fix uboot partition size
2024-08-15 17:28 [Buildroot] [PATCH next] board/friendlyarm/nanopi-neo: fix uboot partition size Dong Wang
2024-08-15 17:50 ` Yann E. MORIN
@ 2024-08-15 18:19 ` Yann E. MORIN
2024-08-15 18:22 ` Dong Wang
2024-08-15 19:50 ` Thomas Petazzoni via buildroot
2 siblings, 1 reply; 9+ messages in thread
From: Yann E. MORIN @ 2024-08-15 18:19 UTC (permalink / raw)
To: Dong Wang; +Cc: Thomas Petazzoni, buildroot
Dong Wang, All,
On 2024-08-16 01:28 +0800, Dong Wang spake thusly:
> This patch fixes the wrongly calculated uboot partition size in
> genimage.cfg. The size should be 1016K, which is
> 1MB (typical partition start) - 8K(offset dictated by the bootrom).
>
> Signed-off-by: Dong Wang <wangdong115@foxmail.com>
Applied to next, thanks!
Again, sorry for the confusion.
Regards,
Yann E. MORIN.
> ---
> board/friendlyarm/nanopi-neo/genimage.cfg | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/board/friendlyarm/nanopi-neo/genimage.cfg b/board/friendlyarm/nanopi-neo/genimage.cfg
> index ec78fd0e56..8d6bdd3295 100644
> --- a/board/friendlyarm/nanopi-neo/genimage.cfg
> +++ b/board/friendlyarm/nanopi-neo/genimage.cfg
> @@ -7,7 +7,7 @@ image sdcard.img {
> in-partition-table = false
> image = "u-boot-sunxi-with-spl.bin"
> offset = 8K
> - size = 1000K # 1MB - 8KB(offset) - 16KB(GPT)
> + size = 1016K # 1MB - 8KB(offset)
> }
>
> partition rootfs {
> --
> 2.25.1
>
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Buildroot] [PATCH next] board/friendlyarm/nanopi-neo: fix uboot partition size
2024-08-15 18:19 ` Yann E. MORIN
@ 2024-08-15 18:22 ` Dong Wang
0 siblings, 0 replies; 9+ messages in thread
From: Dong Wang @ 2024-08-15 18:22 UTC (permalink / raw)
To: Yann E. MORIN; +Cc: Thomas Petazzoni, buildroot
Yann,
On 2024/8/16 02:19, Yann E. MORIN wrote:
> Dong Wang, All,
>
> On 2024-08-16 01:28 +0800, Dong Wang spake thusly:
>> This patch fixes the wrongly calculated uboot partition size in
>> genimage.cfg. The size should be 1016K, which is
>> 1MB (typical partition start) - 8K(offset dictated by the bootrom).
>>
>> Signed-off-by: Dong Wang <wangdong115@foxmail.com>
>
> Applied to next, thanks!
Thanks a lot!
>
> Again, sorry for the confusion.
My bad! I should have let you know in the first patch!
>
> Regards,
> Yann E. MORIN.
>
>> ---
>> board/friendlyarm/nanopi-neo/genimage.cfg | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/board/friendlyarm/nanopi-neo/genimage.cfg b/board/friendlyarm/nanopi-neo/genimage.cfg
>> index ec78fd0e56..8d6bdd3295 100644
>> --- a/board/friendlyarm/nanopi-neo/genimage.cfg
>> +++ b/board/friendlyarm/nanopi-neo/genimage.cfg
>> @@ -7,7 +7,7 @@ image sdcard.img {
>> in-partition-table = false
>> image = "u-boot-sunxi-with-spl.bin"
>> offset = 8K
>> - size = 1000K # 1MB - 8KB(offset) - 16KB(GPT)
>> + size = 1016K # 1MB - 8KB(offset)
>> }
>>
>> partition rootfs {
>> --
>> 2.25.1
>>
>> _______________________________________________
>> buildroot mailing list
>> buildroot@buildroot.org
>> https://lists.buildroot.org/mailman/listinfo/buildroot
>
Best,
Dong Wang
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Buildroot] [PATCH next] board/friendlyarm/nanopi-neo: fix uboot partition size
2024-08-15 17:28 [Buildroot] [PATCH next] board/friendlyarm/nanopi-neo: fix uboot partition size Dong Wang
2024-08-15 17:50 ` Yann E. MORIN
2024-08-15 18:19 ` Yann E. MORIN
@ 2024-08-15 19:50 ` Thomas Petazzoni via buildroot
2024-08-15 20:00 ` Yann E. MORIN
2 siblings, 1 reply; 9+ messages in thread
From: Thomas Petazzoni via buildroot @ 2024-08-15 19:50 UTC (permalink / raw)
To: Dong Wang; +Cc: Yann E. MORIN, buildroot
Hello,
On Fri, 16 Aug 2024 01:28:26 +0800
Dong Wang <wangdong115@foxmail.com> wrote:
> This patch fixes the wrongly calculated uboot partition size in
> genimage.cfg. The size should be 1016K, which is
> 1MB (typical partition start) - 8K(offset dictated by the bootrom).
>
> Signed-off-by: Dong Wang <wangdong115@foxmail.com>
> ---
> board/friendlyarm/nanopi-neo/genimage.cfg | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/board/friendlyarm/nanopi-neo/genimage.cfg b/board/friendlyarm/nanopi-neo/genimage.cfg
> index ec78fd0e56..8d6bdd3295 100644
> --- a/board/friendlyarm/nanopi-neo/genimage.cfg
> +++ b/board/friendlyarm/nanopi-neo/genimage.cfg
> @@ -7,7 +7,7 @@ image sdcard.img {
> in-partition-table = false
> image = "u-boot-sunxi-with-spl.bin"
> offset = 8K
> - size = 1000K # 1MB - 8KB(offset) - 16KB(GPT)
> + size = 1016K # 1MB - 8KB(offset)
Actually, does this size argument really make sense? This space will
automatically take the size of the "u-boot-sunxi-with-spl.bin" file I
believe. Or is it needed to make sure that the next partition doesn't
start before 1 MB?
Why is it important that the size is 1MB - 8KB, and not 1MB or 2MB ?
Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Buildroot] [PATCH next] board/friendlyarm/nanopi-neo: fix uboot partition size
2024-08-15 19:50 ` Thomas Petazzoni via buildroot
@ 2024-08-15 20:00 ` Yann E. MORIN
2024-08-16 16:15 ` Dong Wang
0 siblings, 1 reply; 9+ messages in thread
From: Yann E. MORIN @ 2024-08-15 20:00 UTC (permalink / raw)
To: Thomas Petazzoni; +Cc: Dong Wang, buildroot
Thomas, All,
On 2024-08-15 21:50 +0200, Thomas Petazzoni via buildroot spake thusly:
> On Fri, 16 Aug 2024 01:28:26 +0800
> Dong Wang <wangdong115@foxmail.com> wrote:
> > This patch fixes the wrongly calculated uboot partition size in
> > genimage.cfg. The size should be 1016K, which is
> > 1MB (typical partition start) - 8K(offset dictated by the bootrom).
[--SNIP--]
> > - size = 1000K # 1MB - 8KB(offset) - 16KB(GPT)
> > + size = 1016K # 1MB - 8KB(offset)
> Actually, does this size argument really make sense? This space will
> automatically take the size of the "u-boot-sunxi-with-spl.bin" file I
> believe. Or is it needed to make sure that the next partition doesn't
> start before 1 MB?
>
> Why is it important that the size is 1MB - 8KB, and not 1MB or 2MB ?
The above has two effects:
- ensure the uboot image is not bigger than the allocated space,
- the filesystem image (rootfs) is aligned to a 1MiB boundary.
The latter could be achieved by setting offset=1MiB (or 2MiB or
whatever). I'm not sure how genimage would handle the case where the
uboot image would be too big that the offset of the next partition could
not be honored...
Regards,
Yann E. MORIN.
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Buildroot] [PATCH next] board/friendlyarm/nanopi-neo: fix uboot partition size
2024-08-15 20:00 ` Yann E. MORIN
@ 2024-08-16 16:15 ` Dong Wang
0 siblings, 0 replies; 9+ messages in thread
From: Dong Wang @ 2024-08-16 16:15 UTC (permalink / raw)
To: Yann E. MORIN, Thomas Petazzoni; +Cc: buildroot
Yann, All,
On 2024/8/16 04:00, Yann E. MORIN wrote:
> Thomas, All,
>
> On 2024-08-15 21:50 +0200, Thomas Petazzoni via buildroot spake thusly:
>> On Fri, 16 Aug 2024 01:28:26 +0800
>> Dong Wang <wangdong115@foxmail.com> wrote:
>>> This patch fixes the wrongly calculated uboot partition size in
>>> genimage.cfg. The size should be 1016K, which is
>>> 1MB (typical partition start) - 8K(offset dictated by the bootrom).
> [--SNIP--]
>>> - size = 1000K # 1MB - 8KB(offset) - 16KB(GPT)
>>> + size = 1016K # 1MB - 8KB(offset)
>> Actually, does this size argument really make sense? This space will
>> automatically take the size of the "u-boot-sunxi-with-spl.bin" file I
>> believe. Or is it needed to make sure that the next partition doesn't
>> start before 1 MB?
>>
>> Why is it important that the size is 1MB - 8KB, and not 1MB or 2MB ?
>
> The above has two effects:
> - ensure the uboot image is not bigger than the allocated space,
> - the filesystem image (rootfs) is aligned to a 1MiB boundary.
>
> The latter could be achieved by setting offset=1MiB (or 2MiB or
> whatever). I'm not sure how genimage would handle the case where the
> uboot image would be too big that the offset of the next partition could
> not be honored...
From the doc of the genimage project, yes, sanity checks are done so
that no partitions overlap.
https://github.com/pengutronix/genimage/blob/v18/README.rst#the-image-section
"The partition must not overlap any other partition, or the areas
occupied by the partition table."
I also verified this behavior by changing the offset to a smaller one
(rootfs offset=128K < uboot image size ~500K). genimage.sh would fail
with the log:
ERROR: hdimage(sdcard.img): partition rootfs (offset 0x20000, size
0x3c00000) overlaps previous partition u-boot (offset 0x2000, size 0x7cca8)
Maybe I can send another patch to use offset=1M for rootfs?
>
> Regards,
> Yann E. MORIN.
>
Thanks,
Dong
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2024-08-16 16:16 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-15 17:28 [Buildroot] [PATCH next] board/friendlyarm/nanopi-neo: fix uboot partition size Dong Wang
2024-08-15 17:50 ` Yann E. MORIN
2024-08-15 17:58 ` Darren Wang
2024-08-15 18:14 ` Yann E. MORIN
2024-08-15 18:19 ` Yann E. MORIN
2024-08-15 18:22 ` Dong Wang
2024-08-15 19:50 ` Thomas Petazzoni via buildroot
2024-08-15 20:00 ` Yann E. MORIN
2024-08-16 16:15 ` Dong Wang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox