Skip to contentSkip to conversation

Post genimage.cfg beautify

PATCH In review Giulio Benetti 2 participants 12 messages Nov 9, 2021 – Nov 14, 2021 Arm i.MX and Layerscape

lore
Share & tools
lore
#0 lore raw

v2 cover Post genimage.cfg beautify

This patchset contains other code style fixes and an integration to the Buildroot manual regarding the values suffix notation.

Best regards
Giulio Benetti
Benetti Engineering sas

Giulio Benetti (9):
board/olimex/a20_olinuxino/genimage.cfg: fix option suffix board/altera/socrates_cyclone5/genimage.cfg: fix offset suffix board/friendlyarm/nanopi-neo2/genimage.cfg: fix comment board/orangepi/orangepi-pc2/genimage.cfg: fix comment board/minnowboard/genimage.cfg: fix option assignment spaces board/kontron/pitx-imx8m/genimage.cfg: fix option suffix board/kontron/smarc-sal28/genimage.cfg: fix option suffix docs/manual: add allowed notations section for genimage.cfg files board/nezha/genimage.cfg: fix offset value notation

 board/altera/socrates_cyclone5/genimage.cfg | 2 +-
 board/friendlyarm/nanopi-neo2/genimage.cfg  | 2 +-
 board/kontron/pitx-imx8m/genimage.cfg       | 2 +-
 board/kontron/smarc-sal28/genimage.cfg      | 2 +-
 board/minnowboard/genimage.cfg              | 2 +-
 board/nezha/genimage.cfg                    | 2 +-
 board/olimex/a20_olinuxino/genimage.cfg     | 2 +-
 board/orangepi/orangepi-pc2/genimage.cfg    | 2 +-
 docs/manual/writing-rules.txt               | 5 +++++
 9 files changed, 13 insertions(+), 8 deletions(-)
Signature · 6 lines
2.25.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

PATCH v2 1/9 board/olimex/a20_olinuxino/genimage.cfg: fix option suffix

With commit[1] I've introduced a code style bug:
offset = 8KB
so let's substitute 8KB with 8K.

[1]: https://gitlab.com/buildroot.org/buildroot/-/commit/43bfa1cf1046b0e44e87a02bc5a358bf1de5bfdd

---
V1->V2: reworded as suggested by Luca Ceresoli

---
 board/olimex/a20_olinuxino/genimage.cfg | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
board/olimex/a20_olinuxino/genimage.cfg +1 -1
index 5a735ed2de..b48e12a831 100644
@@ -5,7 +5,7 @@ image sdcard.img {
 	partition u-boot {
 		in-partition-table = "no"
 		image = "u-boot-sunxi-with-spl.bin"
-		offset = 8KB
+		offset = 8K
 		size = 1016K # 1MB - 8KB
 	}
 
Signature · 6 lines
2.25.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw

PATCH v2 2/9 board/altera/socrates_cyclone5/genimage.cfg: fix offset suffix

In reply to Giulio Benetti

For consistency 'offset = 256k' must be 'offset = 256K'

---
 board/altera/socrates_cyclone5/genimage.cfg | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
board/altera/socrates_cyclone5/genimage.cfg +1 -1
index 0af3f2ec60..d31c3838be 100644
@@ -24,7 +24,7 @@ image uboot.img {
 	partition uboot-full {
 		in-partition-table = "no"
 		image = "u-boot.img"
-		offset = 256k
+		offset = 256K
 	}
 
 	size = 1M
Signature · 6 lines
2.25.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#3 lore raw

PATCH v2 3/9 board/friendlyarm/nanopi-neo2/genimage.cfg: fix comment

In reply to Giulio Benetti

For consistency comment '# 1MB - 40K' must be '# 1MB - 40KB'.

---
 board/friendlyarm/nanopi-neo2/genimage.cfg | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
board/friendlyarm/nanopi-neo2/genimage.cfg +1 -1
index 45d081e197..3163a06592 100644
@@ -24,7 +24,7 @@ image sdcard.img {
 		in-partition-table = "no"
 		image = "u-boot.itb"
 		offset = 40K
-		size = 1M # 1MB - 40K
+		size = 1M # 1MB - 40KB
 	}
 
 	partition boot {
Signature · 6 lines
2.25.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#4 lore raw

PATCH v2 4/9 board/orangepi/orangepi-pc2/genimage.cfg: fix comment

In reply to Giulio Benetti

For consistency comment '# 1MB - 40K' must be '# 1MB - 40KB'.

---
 board/orangepi/orangepi-pc2/genimage.cfg | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
board/orangepi/orangepi-pc2/genimage.cfg +1 -1
index 72adc47518..cc8695c9f1 100644
@@ -24,7 +24,7 @@ image sdcard.img {
 		in-partition-table = "no"
 		image = "u-boot.itb"
 		offset = 40K
-		size = 1M # 1MB - 40K
+		size = 1M # 1MB - 40KB
 	}
 
 	partition boot {
Signature · 6 lines
2.25.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#5 lore raw

PATCH v2 5/9 board/minnowboard/genimage.cfg: fix option assignment spaces

In reply to Giulio Benetti

Option 'size=10M' must be 'size = 10M'.

---
 board/minnowboard/genimage.cfg | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
board/minnowboard/genimage.cfg +1 -1
index 34b3070901..2eccce2de4 100644
@@ -9,7 +9,7 @@ image efi-part.vfat {
 		}
 	}
 
-	size=10M
+	size = 10M
 }
 
 # Create the sdcard image, pulling in
Signature · 6 lines
2.25.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#6 lore raw

PATCH v2 6/9 board/kontron/pitx-imx8m/genimage.cfg: fix option suffix

In reply to Giulio Benetti

Option 'offset = 4k' must be 'offset = 4K'.

---
 board/kontron/pitx-imx8m/genimage.cfg | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
board/kontron/pitx-imx8m/genimage.cfg +1 -1
index c335b0c026..c78ef0f910 100644
@@ -5,7 +5,7 @@ image sdcard.img {
 	partition imx-boot {
 		in-partition-table = "no"
 		image = "imx8-boot-sd.bin"
-		offset = 33k
+		offset = 33K
 	}
 
 	partition rootfs {
Signature · 6 lines
2.25.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
author Acked-by Heiko Thiery on v2 6/9
#7 lore raw

Re: [Buildroot] [PATCH v2 6/9] board/kontron/pitx-imx8m/genimage.cfg: fix option suffix

Sorry, I've forgotten,

Quoted 3 lines · Giulio Benetti

Option 'offset = 4k' must be 'offset = 4K'.

---
V1->V2:
* reworded 'option = 4K' to 'offset = 4K' as suggested by Heiko Thiery

Quoted 18 lines
---
  board/kontron/pitx-imx8m/genimage.cfg | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
board/kontron/pitx-imx8m/genimage.cfg +1 -1
index c335b0c026..c78ef0f910 100644
@@ -5,7 +5,7 @@ image sdcard.img {
  	partition imx-boot {
  		in-partition-table = "no"
  		image = "imx8-boot-sd.bin"
-		offset = 33k
+		offset = 33K
  	}
 
  	partition rootfs {
Signature · 6 lines
Giulio Benetti
Benetti Engineering sas
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#8 lore raw

PATCH v2 7/9 board/kontron/smarc-sal28/genimage.cfg: fix option suffix

In reply to Giulio Benetti

Option 'offset = 4k' must be 'offset = 4K'.

---
 board/kontron/smarc-sal28/genimage.cfg | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
board/kontron/smarc-sal28/genimage.cfg +1 -1
index f3fb77e00a..8c8a7baaae 100644
@@ -4,7 +4,7 @@ image sdcard-emmc.img {
 	}
 
 	partition rcw {
-		offset = 4k
+		offset = 4K
 		in-partition-table = "no"
 		image = "rcw.bin"
 	}
Signature · 6 lines
2.25.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#9 lore raw

PATCH v2 8/9 docs/manual: add allowed notations section for genimage.cfg files

In reply to Giulio Benetti

Add allowed notations section for genimage.cfg files by specifying the accepted suffix or prefix. Note that "K" has been decided to specify KiloBytes as 1024 bytes. This has been done because in Buildroot the 90% of the cases were using "K" and not "k".

---
 docs/manual/writing-rules.txt | 5 +++++
 1 file changed, 5 insertions(+)
docs/manual/writing-rules.txt +5 -0
index 28cb0fe4f1..138c39db14 100644
@@ -192,6 +192,11 @@ image sdimage.img {
 * Filename must at least begin with genimage prefix and have the .cfg
   extension to be easy to recognize.
 
+* Allowed notations for +offset+ and +size+ options are: +G+, +M+, +K+(not k).
+  If it's not possible to express a precise byte count with notations above
+  then use hexadecimal +0x+ prefix or, as last chance, the byte count.
+  In comments instead use +GB+, +MB+, +KB+(not kb) in place of +G+, +M+, +K+.
+
 The +genimage.cfg+ files are the input for the genimage tool used in
 Buildroot to generate the final image file(i.e. sdcard.img). For further
 details about the _genimage_ language, refer to
Signature · 6 lines
2.25.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#10 lore raw

PATCH v2 9/9 board/nezha/genimage.cfg: fix offset value notation

In reply to Giulio Benetti

Option "offset = 12288K" must be "offset = 12M" according to the new guidelines specified in Buildroot Manual with previous patch.

---
 board/nezha/genimage.cfg | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
board/nezha/genimage.cfg +1 -1
index 9860b83eca..783391fb99 100644
@@ -19,7 +19,7 @@ image sdcard.img {
 	partition u-boot-1 {
 		in-partition-table = "no"
 		image = "u-boot.toc1"
-		offset = 12288K
+		offset = 12M
 	}
 
 	partition u-boot-2 {
Signature · 6 lines
2.25.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#11 lore raw
In reply to Giulio Benetti
Quoted 10 lines · On Tue, 9 Nov 2021 11:18:35 +0100 Giulio Benetti…

Giulio Benetti (9):
board/olimex/a20_olinuxino/genimage.cfg: fix option suffix board/altera/socrates_cyclone5/genimage.cfg: fix offset suffix board/friendlyarm/nanopi-neo2/genimage.cfg: fix comment board/orangepi/orangepi-pc2/genimage.cfg: fix comment board/minnowboard/genimage.cfg: fix option assignment spaces board/kontron/pitx-imx8m/genimage.cfg: fix option suffix board/kontron/smarc-sal28/genimage.cfg: fix option suffix docs/manual: add allowed notations section for genimage.cfg files board/nezha/genimage.cfg: fix offset value notation

Series applied to next, with some really minor adjustments on two patches.

Thanks!

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot