Skip to contentSkip to conversation

Introduce a genimage infra

PATCH New Ezequiel Garcia 5 participants 30 messages Apr 13, 2016 – Apr 15, 2016

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover Introduce a genimage infra

As suggested by Arnout here's a series introducing a genimage infra to remove all the duplicated genimage incantation (they are all identical!).

BTW, it seems this topic was brought on the 2014 Developer day at FOSDEM:

http://elinux.org/Buildroot:DeveloperDaysFOSDEM2014#Genimages

In addition to the infra stuff, I took the liberty of fixing all the boards currently using genimage, but I've tested just a couple:
Minnowboard Max and Olimex A20 Olinuxino Micro.

Comments? Feedback?

Ezequiel Garcia (15):
fs: add genimage infra
board/minnowboard-max: Leverage the new genimage infra board/olimex_a20_olinuxino: Leverage the new genimage infra board/wandboard: Leverage the new genimage infra board/firefly: Leverage the new genimage infra board/cubieboard2: Leverage the new genimage infra board/arietta-g25: Leverage the new genimage infra board/imx6ulevk: Leverage the new genimage infra board/galileo: Leverage the new genimage infra board/pandaboard: Leverage the new genimage infra board/boundarydevices: Leverage the new genimage infra board/imx233_olinuxino: Leverage the new genimage infra board/orangepipc: Leverage the new genimage infra board/raspberry*: Leverage the new genimage infra board/via_imx6_vab820: Leverage the new genimage infra

 board/acmesystems/arietta-g25/post-image.sh      | 16 ----------
 board/boundarydevices/common/post-image.sh       | 16 ----------
 board/cubietech/cubieboard2/post-image.sh        | 16 ----------
 board/firefly/firefly-rk3288/post-build.sh       |  4 +++
 board/firefly/firefly-rk3288/post-image.sh       | 20 ------------
 board/freescale/imx6ulevk/post-image.sh          | 15 ---------
 board/intel/galileo/post-image.sh                | 13 --------
 board/minnowboard-max/genimage.cfg               | 34 +++++++++++++++++++++
 board/minnowboard-max/readme.txt                 | 39 ++++++++----------------
 board/olimex/a20_olinuxino/post-image.sh         | 16 ----------
 board/olimex/imx233_olinuxino/post-image.sh      | 14 ---------
 board/orangepi/orangepipc/post-build.sh          |  5 +++
 board/orangepi/orangepipc/post-image.sh          | 22 -------------
 board/pandaboard/post-image.sh                   | 16 ----------
 board/raspberrypi/post-build.sh                  |  8 +++++
 board/raspberrypi/post-image.sh                  | 22 -------------
 board/wandboard/post-image.sh                    | 16 ----------
 configs/acmesystems_arietta_g25_128mb_defconfig  |  4 +--
 configs/acmesystems_arietta_g25_256mb_defconfig  |  4 +--
 configs/cubieboard2_defconfig                    |  5 +--
 configs/firefly_rk3288_defconfig                 |  4 +--
 configs/firefly_rk3288_demo_defconfig            |  4 +--
 configs/freescale_imx6ulevk_defconfig            |  4 +--
 configs/galileo_defconfig                        |  4 +--
 configs/minnowboard_max_defconfig                |  8 +++++
 configs/nitrogen6sx_defconfig                    |  4 +--
 configs/nitrogen6x_defconfig                     |  4 +--
 configs/nitrogen7_defconfig                      |  4 +--
 configs/olimex_a20_olinuxino_lime2_defconfig     |  2 --
 configs/olimex_a20_olinuxino_lime_defconfig      |  4 +--
 configs/olimex_a20_olinuxino_lime_mali_defconfig |  4 +--
 configs/olimex_a20_olinuxino_micro_defconfig     |  4 +--
 configs/olimex_imx233_olinuxino_defconfig        |  3 +-
 configs/orangepipc_defconfig                     |  4 +--
 configs/pandaboard_defconfig                     |  4 +--
 configs/raspberrypi2_defconfig                   |  5 +--
 configs/raspberrypi_defconfig                    |  5 +--
 configs/via_imx6_vab820_defconfig                |  4 +--
 configs/wandboard_defconfig                      |  5 +--
 fs/Config.in                                     |  1 +
 fs/genimage/Config.in                            | 20 ++++++++++++
 fs/genimage/genimage.mk                          | 21 +++++++++++++
 42 files changed, 157 insertions(+), 270 deletions(-)
 delete mode 100755 board/acmesystems/arietta-g25/post-image.sh
 delete mode 100755 board/boundarydevices/common/post-image.sh
 delete mode 100755 board/cubietech/cubieboard2/post-image.sh
 delete mode 100755 board/firefly/firefly-rk3288/post-image.sh
 delete mode 100755 board/freescale/imx6ulevk/post-image.sh
 delete mode 100755 board/intel/galileo/post-image.sh
 create mode 100644 board/minnowboard-max/genimage.cfg
 delete mode 100755 board/olimex/a20_olinuxino/post-image.sh
 delete mode 100755 board/orangepi/orangepipc/post-image.sh
 delete mode 100755 board/pandaboard/post-image.sh
 create mode 100755 board/raspberrypi/post-build.sh
 delete mode 100755 board/raspberrypi/post-image.sh
 delete mode 100755 board/wandboard/post-image.sh
 create mode 100644 fs/genimage/Config.in
 create mode 100644 fs/genimage/genimage.mk
Signature · 1 line
2.7.0
#1 lore raw

PATCH 1/15 fs: add genimage infra

Currently, all the boards using genimage are using the same command incantation. Therefore, let's introduce a new filesystem infra to factorize them and allow easier genimage setup.

This commit adds a new genimage infra, by calling genimage with a user-provided config file. The user is still responsible of enabling the apropriate rootfs filesystem images.

---
 fs/Config.in            |  1 +
 fs/genimage/Config.in   | 20 ++++++++++++++++++++
 fs/genimage/genimage.mk | 21 +++++++++++++++++++++
 3 files changed, 42 insertions(+)
 create mode 100644 fs/genimage/Config.in
 create mode 100644 fs/genimage/genimage.mk
fs/Config.in +1 -0
index 51ccf28169ef..94fe1446047f 100644
@@ -5,6 +5,7 @@ source "fs/cloop/Config.in"
 source "fs/cpio/Config.in"
 source "fs/cramfs/Config.in"
 source "fs/ext2/Config.in"
+source "fs/genimage/Config.in"
 source "fs/initramfs/Config.in"
 source "fs/iso9660/Config.in"
 source "fs/jffs2/Config.in"
fs/genimage/Config.in new file +20 -0
new file mode 100644
index 000000000000..749494652464
@@ -0,0 +1,20 @@
+config BR2_TARGET_ROOTFS_GENIMAGE
+	bool "full system image using genimage"
+	help
+	  Generate a full system image using the genimage tool
+	  and a user-provided configuration file. The image generated
+	  will contain a partition table and will be ready to be copied
+	  onto storage media, such as MMC, NAND or NOR devices.
+
+	  Keep in mind that you probably require to enable a rootfs
+	  filesystem image, according to the genimage config file that you
+	  provide.
+
+if BR2_TARGET_ROOTFS_GENIMAGE
+
+config BR2_TARGET_ROOTFS_GENIMAGE_CFG
+	string "genimage config file"
+	help
+	  Genimage user configuration file.
+
+endif # BR2_TARGET_ROOTFS_GENIMAGE
fs/genimage/genimage.mk new file +21 -0
new file mode 100644
index 000000000000..17c146b6b519
@@ -0,0 +1,21 @@
+################################################################################
+#
+# Generate a system image using genimage
+#
+################################################################################
+
+ROOTFS_GENIMAGE_DEPENDENCIES = host-genimage
+
+GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
+
+define ROOTFS_GENIMAGE_CMD
+	$(RM) -rf ${GENIMAGE_TMP} &&		\
+	$(HOST_DIR)/usr/bin/genimage		\
+		--rootpath ${TARGET_DIR}	\
+		--tmppath ${GENIMAGE_TMP}	\
+		--inputpath ${BINARIES_DIR}	\
+		--outputpath ${BINARIES_DIR}	\
+		--config ${BR2_TARGET_ROOTFS_GENIMAGE_CFG}
+endef
+
+$(eval $(call ROOTFS_TARGET,genimage))
Signature · 1 line
2.7.0
#2 lore raw

PATCH 1/15 fs: add genimage infra

Hello,

Quoted 17 lines · Ezequiel Garcia
fs/genimage/genimage.mk new file +11 -0
new file mode 100644
index 000000000000..17c146b6b519
@@ -0,0 +1,21 @@
+################################################################################
+#
+# Generate a system image using genimage
+#
+################################################################################
+
+ROOTFS_GENIMAGE_DEPENDENCIES = host-genimage
+
+GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
+
+define ROOTFS_GENIMAGE_CMD

fs/genimage/genimage.mk line 21

Quoted 10 lines
fs/genimage/genimage.mk new file +10 -0
+	$(RM) -rf ${GENIMAGE_TMP} &&		\
+	$(HOST_DIR)/usr/bin/genimage		\
+		--rootpath ${TARGET_DIR}	\
+		--tmppath ${GENIMAGE_TMP}	\
+		--inputpath ${BINARIES_DIR}	\
+		--outputpath ${BINARIES_DIR}	\
+		--config ${BR2_TARGET_ROOTFS_GENIMAGE_CFG}
+endef
+
+$(eval $(call ROOTFS_TARGET,genimage))

A genimage.cfg file typically references some filesystem images like ext2/3/4 images. But I don't see anything in your implementation that ensures that the filesystem images that are used by the genimage.cfg file are produced *before* the genimage image is created. Am I missing something ?

Also, I think the infra should probably handle the dosfstools/mtools dependency that we need for many platforms to build a small FAT filesystem. So maybe a sub-option like BR2_TARGET_ROOTFS_GENIMAGE_BUILDS_FATFS or something like that, that would just select the appropriate packages.

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#3 lore raw

PATCH 1/15 fs: add genimage infra

In reply to Ezequiel Garcia
Quoted 7 lines · Ezequiel Garcia

Currently, all the boards using genimage are using the same command incantation. Therefore, let's introduce a new filesystem infra to factorize them and allow easier genimage setup.

This commit adds a new genimage infra, by calling genimage with a user-provided config file. The user is still responsible of enabling the apropriate rootfs filesystem images.

And for enabling dosfstools/mtools (as observed by Thomas).

Quoted 15 lines
---
  fs/Config.in            |  1 +
  fs/genimage/Config.in   | 20 ++++++++++++++++++++
  fs/genimage/genimage.mk | 21 +++++++++++++++++++++
  3 files changed, 42 insertions(+)

create mode 100644 fs/genimage/Config.in
create mode 100644 fs/genimage/genimage.mk

fs/Config.in +0 -0
index 51ccf28169ef..94fe1446047f 100644

fs/Config.in source "fs/cloop/Config.in" · line 8

Quoted 4 lines
fs/Config.in +1 -0
@@ -5,6 +5,7 @@ source "fs/cloop/Config.in"
  source "fs/cpio/Config.in"
  source "fs/cramfs/Config.in"
  source "fs/ext2/Config.in"
+source "fs/genimage/Config.in"

I think this shouldn't be done alphabetically, but really at the end.

Quoted 10 lines
fs/Config.in +0 -0
  source "fs/initramfs/Config.in"
  source "fs/iso9660/Config.in"
  source "fs/jffs2/Config.in"
fs/genimage/Config.in new file +1 -0
new file mode 100644
index 000000000000..749494652464
@@ -0,0 +1,20 @@
+config BR2_TARGET_ROOTFS_GENIMAGE

fs/genimage/Config.in line 11

Quoted 10 lines
fs/genimage/Config.in new file +10 -0
+	bool "full system image using genimage"
+	help
+	  Generate a full system image using the genimage tool
+	  and a user-provided configuration file. The image generated
+	  will contain a partition table and will be ready to be copied
+	  onto storage media, such as MMC, NAND or NOR devices.
+
+	  Keep in mind that you probably require to enable a rootfs
+	  filesystem image, according to the genimage config file that you
+	  provide.

And to select mtools/dosfstools. Thomas proposed to add an option for that.
For me, either an explicit genimage option or just adding the help text for it is OK.

Quoted 15 lines
fs/genimage/Config.in new file +9 -0
+
+if BR2_TARGET_ROOTFS_GENIMAGE
+
+config BR2_TARGET_ROOTFS_GENIMAGE_CFG
+	string "genimage config file"
+	help
+	  Genimage user configuration file.
+
+endif # BR2_TARGET_ROOTFS_GENIMAGE
fs/genimage/genimage.mk new file +0 -0
new file mode 100644
index 000000000000..17c146b6b519

fs/genimage/genimage.mk line 9

Quoted 9 lines
fs/genimage/genimage.mk new file +9 -0
@@ -0,0 +1,21 @@
+################################################################################
+#
+# Generate a system image using genimage
+#
+################################################################################
+
+ROOTFS_GENIMAGE_DEPENDENCIES = host-genimage
+
+GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"

Variable name should be ROOTFS_GENIMAGE_TMP

fs/genimage/genimage.mk line 12

Quoted 3 lines
fs/genimage/genimage.mk new file +3 -0
+
+define ROOTFS_GENIMAGE_CMD
+	$(RM) -rf ${GENIMAGE_TMP} &&		\
  && is not needed, treat it as two separate commands.
  -f is not needed, it is already in $(RM).
  All variables should use $(), not ${} (below as well).

fs/genimage/genimage.mk line 13

Quoted 1 line
fs/genimage/genimage.mk new file +1 -0
+	$(HOST_DIR)/usr/bin/genimage		\

We don't generally align \ (annoying whitespace changes when you add a line).

fs/genimage/genimage.mk line 21

Quoted 8 lines
fs/genimage/genimage.mk new file +8 -0
+		--rootpath ${TARGET_DIR}	\
+		--tmppath ${GENIMAGE_TMP}	\
+		--inputpath ${BINARIES_DIR}	\
+		--outputpath ${BINARIES_DIR}	\
+		--config ${BR2_TARGET_ROOTFS_GENIMAGE_CFG}
+endef
+
+$(eval $(call ROOTFS_TARGET,genimage))

I think that, like for initramfs, the infra has little to offer here. And it
is in fact in the way, because (as observed by Thomas) you'll want to add

rootfs-genimage: $(TARGETS_ROOTFS)

which leads to a circular dependency.

So to make sure that it happens in the right order, I think you need something
like:

rootfs-genimage: $(TARGETS_ROOTFS) $(ROOTFS_GENIMAGE_DEPENDENCIES)

	$(RM) -r $(ROOTFS_GENIMAGE_TMP)
	$(HOST_DIR)/usr/bin/genimage \
		...

ifeq ($(BR2_TARGET_ROOTFS_GENIMAGE),y)

target-post-image: rootfs-genimage

# Make sure the genimage dependencies appear in graph-depends show-targets:

	@echo $(ROOTFS_GENIMAGE_DEPENDENCIES)

ifeq ($(wildcard $(BR2_TARGET_ROOTFS_GENIMAGE_CFG),)) $(error $(BR2_TARGET_ROOTFS_GENIMAGE_CFG) does not exist)

endif

However, I'm afraid that we're moving a bit too fast after all. There are
several open issues still:

- Do post-image scripts come before or after genimage?
- What with the dosfstools/mtools dependency?
- Should we support genimage.cfg files that are generated from a post-image script?
- Should we support several genimage.cfg files, producing several images (e.g. a NAND and a SD image)?

So, the current approach works well for the bundled defconfigs, but for real
use cases I think it's a bit too limited to be practical after all.

Therefore, at least as a first step, I guess it's better to just move the
script to a common place, e.g. to package/genimage/post-image.sh. Let it take a single argument for the genimage.cfg file, and add some documentation to the manual.

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
#4 lore raw

PATCH 1/15 fs: add genimage infra

Hello,

Quoted 15 lines · Arnout Vandecappelle

I think that, like for initramfs, the infra has little to offer here. And it
is in fact in the way, because (as observed by Thomas) you'll want to add

rootfs-genimage: $(TARGETS_ROOTFS)

which leads to a circular dependency.

So to make sure that it happens in the right order, I think you need something
like:

rootfs-genimage: $(TARGETS_ROOTFS) $(ROOTFS_GENIMAGE_DEPENDENCIES)

	$(RM) -r $(ROOTFS_GENIMAGE_TMP)
	$(HOST_DIR)/usr/bin/genimage \
		...
Quoted 7 lines

ifeq ($(BR2_TARGET_ROOTFS_GENIMAGE),y)

target-post-image: rootfs-genimage

# Make sure the genimage dependencies appear in graph-depends show-targets:

	@echo $(ROOTFS_GENIMAGE_DEPENDENCIES)

But then is it really something that belongs to fs/ ? It really isn't a filesystem.

Quoted 11 lines

However, I'm afraid that we're moving a bit too fast after all. There are
several open issues still:

- Do post-image scripts come before or after genimage?
- What with the dosfstools/mtools dependency?
- Should we support genimage.cfg files that are generated from a post-image script?
- Should we support several genimage.cfg files, producing several images (e.g. a NAND and a SD image)?

So, the current approach works well for the bundled defconfigs, but for real
use cases I think it's a bit too limited to be practical after all.

Do we need to support all real use cases? I think we should support the common use cases, and the more complicated use cases can be handled via a special post-image script. That's really the general philosophy of Buildroot IMO: handle the most common cases nicely, and leave enough extension scripts/hooks to allow people to plug their scripts to handle the more complicated/specific cases.

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#5 lore raw

PATCH 1/15 fs: add genimage infra

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

Hi,

Quoted 6 lines
Quoted 3 lines

# Make sure the genimage dependencies appear in graph-depends show-targets:
@echo $(ROOTFS_GENIMAGE_DEPENDENCIES)

But then is it really something that belongs to fs/ ? It really isn't a filesystem.

No, it is closer to the post-image script. Where do you suggest to move it? system/?

Quoted 12 lines
Quoted 11 lines

However, I'm afraid that we're moving a bit too fast after all. There are several open issues still:

- Do post-image scripts come before or after genimage?
- What with the dosfstools/mtools dependency?
- Should we support genimage.cfg files that are generated from a post-image script?
- Should we support several genimage.cfg files, producing several images (e.g. a NAND and a SD image)?

So, the current approach works well for the bundled defconfigs, but for real use cases I think it's a bit too limited to be practical after all.

Quoted 6 lines

Do we need to support all real use cases? I think we should support the common use cases, and the more complicated use cases can be handled via a special post-image script. That's really the general philosophy of Buildroot IMO: handle the most common cases nicely, and leave enough extension scripts/hooks to allow people to plug their scripts to handle the more complicated/specific cases.

Agreed, but it is good to think about the questions Arnout listed to think about what is really the common use case.

The definition of the post-image script was to run something at the very end, so I think we should do genimage before post-image (even though I could imagine use cases for the opposite as well).

For the dosfstools/mtools dependencies I think a simple sub option pulling them in is most sensible.

Supporting multiple genimage.cfg files (like we do for device_tables / post-build / post-image, ..) IMHO makes sense and looks simple to do.

Signature · 2 lines
Venlig hilsen,
Peter Korsgaard 
#6 lore raw

PATCH 1/15 fs: add genimage infra

Quoted 34 lines · Peter Korsgaard
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

Hi,

Quoted 6 lines
Quoted 3 lines

# Make sure the genimage dependencies appear in graph-depends show-targets:
@echo $(ROOTFS_GENIMAGE_DEPENDENCIES)

But then is it really something that belongs to fs/ ? It really isn't a filesystem.

No, it is closer to the post-image script. Where do you suggest to move it? system/?

Quoted 12 lines
Quoted 11 lines

However, I'm afraid that we're moving a bit too fast after all. There are several open issues still:

- Do post-image scripts come before or after genimage?
- What with the dosfstools/mtools dependency?
- Should we support genimage.cfg files that are generated from a post-image script?
- Should we support several genimage.cfg files, producing several images (e.g. a NAND and a SD image)?

So, the current approach works well for the bundled defconfigs, but for real use cases I think it's a bit too limited to be practical after all.

Quoted 6 lines

Do we need to support all real use cases? I think we should support the common use cases, and the more complicated use cases can be handled via a special post-image script. That's really the general philosophy of Buildroot IMO: handle the most common cases nicely, and leave enough extension scripts/hooks to allow people to plug their scripts to handle the more complicated/specific cases.

Quoted 6 lines

Agreed, but it is good to think about the questions Arnout listed to think about what is really the common use case.

The definition of the post-image script was to run something at the very end, so I think we should do genimage before post-image (even though I could imagine use cases for the opposite as well).

Yes, so eventually we'll have a post-rootfs script...

Quoted 6 lines

For the dosfstools/mtools dependencies I think a simple sub option pulling them in is most sensible.

Supporting multiple genimage.cfg files (like we do for device_tables / post-build / post-image, ..) IMHO makes sense and looks simple to do.

Well, compared to the really simple solution that Ezequiel has now, I think
the code will look quite a bit more complicated when there are multiple genimage.cfg files.

Oh, and one more question: should we somehow make sure that the images
generated by the different scripts don't have the same name?

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
#7 lore raw

PATCH 1/15 fs: add genimage infra

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Arnout" == Arnout Vandecappelle <[email protected]> writes:

Hi,

Quoted 7 lines · Peter Korsgaard
Quoted 4 lines

The definition of the post-image script was to run something at the very end, so I think we should do genimage before post-image (even though I could imagine use cases for the opposite as well).

Yes, so eventually we'll have a post-rootfs script...

Possibly, yes ;)

Quoted 9 lines
Quoted 5 lines

For the dosfstools/mtools dependencies I think a simple sub option pulling them in is most sensible.

Supporting multiple genimage.cfg files (like we do for device_tables / post-build / post-image, ..) IMHO makes sense and looks simple to do.

Well, compared to the really simple solution that Ezequiel has now, I
think the code will look quite a bit more complicated when there are multiple genimage.cfg files.

Wouldn't it basically just sticking the logic in a loop over the words in BR2_TARGET_ROOTFS_GENIMAGE_CFG?

Quoted 2 lines

Oh, and one more question: should we somehow make sure that the
images generated by the different scripts don't have the same name?

No, I don't think we should do any parsing/verification of the .cfg files. If the user specifies files that aren't built or overwrites already existing files then they are themselves to blame.

Signature · 2 lines
Venlig hilsen,
Peter Korsgaard 
#8 lore raw

PATCH 1/15 fs: add genimage infra

All,

On 2016-04-14 23:37 +0200, Peter Korsgaard spake thusly:

Quoted 11 lines
Quoted 8 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Arnout" == Arnout Vandecappelle <[email protected]> writes:

Quoted 2 lines · Peter Korsgaard

Supporting multiple genimage.cfg files (like we do for device_tables / post-build / post-image, ..) IMHO makes sense and looks simple to do.

Well, compared to the really simple solution that Ezequiel has now, I
think the code will look quite a bit more complicated when there are multiple genimage.cfg files.

Wouldn't it basically just sticking the logic in a loop over the words in BR2_TARGET_ROOTFS_GENIMAGE_CFG?

It is already possible and perfectly legit to declare more than one image in a genimage config file, as far as I can see.

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#9 lore raw

PATCH 1/15 fs: add genimage infra

Quoted 7 lines
Quoted 4 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Yann" == Yann E MORIN <[email protected]> writes:

Wouldn't it basically just sticking the logic in a loop over the words in BR2_TARGET_ROOTFS_GENIMAGE_CFG?

It is already possible and perfectly legit to declare more than one image in a genimage config file, as far as I can see.

Ahh, so we can then just concatenate all files specified and pass to genimage - Nice!

Signature · 2 lines
Venlig hilsen,
Peter Korsgaard 
#10 lore raw

PATCH 1/15 fs: add genimage infra

In reply to Arnout Vandecappelle

Hello,

Quoted 3 lines · Arnout Vandecappelle

Therefore, at least as a first step, I guess it's better to just move the
script to a common place, e.g. to package/genimage/post-image.sh. Let it take a single argument for the genimage.cfg file, and add some documentation to the manual.

As an after-thought, this seems like a good idea. This is really a very simple and minimal change, and is easy to do.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#11 lore raw

PATCH 1/15 fs: add genimage infra

Quoted 11 lines · Thomas Petazzoni

Hello,

Quoted 3 lines · Arnout Vandecappelle

Therefore, at least as a first step, I guess it's better to just move the
script to a common place, e.g. to package/genimage/post-image.sh. Let it take a single argument for the genimage.cfg file, and add some documentation to the manual.

As an after-thought, this seems like a good idea. This is really a very simple and minimal change, and is easy to do.

I realize this is a simple step forward, but I'm wondering if we can sort out the open
questions around a proper genimage infra, and just go for the big solution instead.

Signature · 2 lines
Ezequiel Garc?a, VanguardiaSur
www.vanguardiasur.com.ar
#12 lore raw

PATCH 1/15 fs: add genimage infra

In reply to Thomas Petazzoni
Quoted 11 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

Hello,

Quoted 3 lines · Arnout Vandecappelle

Therefore, at least as a first step, I guess it's better to just move the script to a common place, e.g. to package/genimage/post-image.sh. Let it take a single argument for the genimage.cfg file, and add some documentation to the manual.

As an after-thought, this seems like a good idea. This is really a very simple and minimal change, and is easy to do.

The only complication is that you cannot directly pass arguments to post-image scripts, you have to use BR2_ROOTFS_POST_SCRIPT_ARGS (and it gets used for all scripts).

Signature · 1 line
Bye, Peter Korsgaard
#13 lore raw

PATCH 1/15 fs: add genimage infra

Quoted 9 lines · Peter Korsgaard
Quoted 8 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

Hello,

Quoted 3 lines · Arnout Vandecappelle

Therefore, at least as a first step, I guess it's better to just move the script to a common place, e.g. to package/genimage/post-image.sh. Let it take a single argument for the genimage.cfg file, and add some documentation to the manual.

Quoted 6 lines
Quoted 2 lines

As an after-thought, this seems like a good idea. This is really a very simple and minimal change, and is easy to do.

The only complication is that you cannot directly pass arguments to post-image scripts, you have to use BR2_ROOTFS_POST_SCRIPT_ARGS (and it gets used for all scripts).

I really don't think that this is a limitation. Especially if you don't pass
the file, but the directory as the argument; that would be potentially useful for other post-image scripts as well.

So I tend to prefer the simple common-script-in-package/genimage solution.

That said, if Ezequiel posts a patch that takes into account all my concerns,
I'll be happy to Ack it.

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
#14 lore raw

PATCH 2/15 board/minnowboard-max: Leverage the new genimage infra

In reply to Ezequiel Garcia

Let's rework the board and config files to use the recently added genimage infra, which generates the SD card image directly.

---
 board/minnowboard-max/genimage.cfg | 34 +++++++++++++++++++++++++++++++++
 board/minnowboard-max/readme.txt   | 39 ++++++++++++--------------------------
 configs/minnowboard_max_defconfig  |  8 ++++++++
 3 files changed, 54 insertions(+), 27 deletions(-)
 create mode 100644 board/minnowboard-max/genimage.cfg
board/minnowboard-max/genimage.cfg new file +34 -0
new file mode 100644
index 000000000000..6cf787430752
@@ -0,0 +1,34 @@
+# Create an image of the efi partition
+image efi-part.vfat {
+	vfat {
+		file startup.nsh {
+			image = "efi-part/startup.nsh"
+		}
+		file EFI {
+			image = "efi-part/EFI"
+		}
+		file bzImage {
+			image = "bzImage"
+		}
+	}
+	size=10M
+}
+
+# Create the sdcard image, pulling in
+#  * the image created by buildroot
+#  * the efi-partition created above
+image sdcard.img {
+	hdimage {
+	}
+
+	partition boot {
+		partition-type = 0xEF
+		image = "efi-part.vfat"
+	}
+
+	partition rootfs {
+		partition-type = 0x83
+		image = "rootfs.ext4"
+		size = 512M
+	}
+}
board/minnowboard-max/readme.txt +12 -27
index 5f52369b97d6..dfad2aba2123 100644
@@ -1,40 +1,25 @@
-Prepare the SD card for the Minnow Board MAX
+How to get started with the Minnow Board MAX
 ============================================
 
- 1. Partition the SD card with a GPT partition table
+1. Build
 
-    sudo cgdisk /dev/mmcblk0
+  Apply the defconfig:
 
-    Create two partitions:
+  $ make minnowboard_max_defconfig
 
-     a) First partition of a few dozens of megabytes, which will be
-        used to store the bootloader and the kernel image. Type must
-        be EF00 (EFI partition).
+  Add any additional packages required and build:
 
-     b) Second partition of any size, which will be used to store the
-        root filesystem. Type must be 8300 (Linux filesystem)
+  $ make
 
- 2. Prepare the boot partition
+2. Write the SD card
 
-    We will format it, mount it, copy the EFI data generated by
-    Buildroot, and the kernel image.
+  The build process will create a SD card image in output/images.
+  Write the image to an mSD card, insert into the Minnowboard MAX
+  and power the board on.
 
-    sudo mkfs.vfat -F 32 -n boot /dev/mmcblk0p1
-    sudo mount /dev/mmcblk0p1 /mnt
-    sudo cp -a output/images/efi-part/* /mnt/
-    sudo cp output/images/bzImage /mnt/
-    sudo umount /mnt
+  $ dd if=output/images/sdcard.img of=/dev/mmcblk0; sync
 
- 3. Prepare the root partition
-
-    We will format it, mount it, and extract the root filesystem.
-
-    sudo mkfs.ext4 -L root /dev/mmcblk0p2
-    sudo mount /dev/mmcblk0p2 /mnt
-    sudo tar -C /mnt -xf output/images/rootfs.tar
-    sudo umount /mnt
-
- 4. Enjoy
+3. Enjoy
 
 Additional information about this board can be found at
 http://www.minnowboard.org/ or http://wiki.minnowboard.org/MinnowBoard_MAX
configs/minnowboard_max_defconfig +8 -0
index 98996db958ff..3d2fc041938c 100644
@@ -8,6 +8,7 @@ BR2_ROOTFS_POST_BUILD_SCRIPT="board/minnowboard-max/post-build.sh"
 
 # Linux headers same as kernel, a 4.4 series
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_4=y
+BR2_PACKAGE_HOST_DOSFSTOOLS=y
 
 # Needed for ethernet
 BR2_PACKAGE_LINUX_FIRMWARE=y
@@ -23,3 +24,10 @@ BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/minnowboard-max/linux.config"
 # Bootloader
 BR2_TARGET_GRUB2=y
 BR2_TARGET_GRUB2_X86_64_EFI=y
+
+# Filesystem image
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_ROOTFS_EXT2_4=y
+BR2_TARGET_ROOTFS_GENIMAGE=y
+BR2_TARGET_ROOTFS_GENIMAGE_CFG="board/minnowboard-max/genimage.cfg"
+# BR2_TARGET_ROOTFS_TAR is not set
Signature · 1 line
2.7.0
#15 lore raw

PATCH 3/15 board/olimex_a20_olinuxino: Leverage the new genimage infra

In reply to Ezequiel Garcia

Let's rework the board and config files to use the recently added genimage infra, which generates the SD card image directly.

---
 board/olimex/a20_olinuxino/post-image.sh         | 16 ----------------
 configs/olimex_a20_olinuxino_lime2_defconfig     |  2 --
 configs/olimex_a20_olinuxino_lime_defconfig      |  4 ++--
 configs/olimex_a20_olinuxino_lime_mali_defconfig |  4 ++--
 configs/olimex_a20_olinuxino_micro_defconfig     |  4 ++--
 5 files changed, 6 insertions(+), 24 deletions(-)
 delete mode 100755 board/olimex/a20_olinuxino/post-image.sh
board/olimex/a20_olinuxino/post-image.sh deleted +0 -16
deleted file mode 100755
index 9cca1b1789ec..000000000000
@@ -1,16 +0,0 @@
-#!/bin/sh
-
-BOARD_DIR="$(dirname $0)"
-GENIMAGE_CFG="${BOARD_DIR}/genimage.cfg"
-GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
-
-rm -rf "${GENIMAGE_TMP}"
-
-genimage                           \
-	--rootpath "${TARGET_DIR}"     \
-	--tmppath "${GENIMAGE_TMP}"    \
-	--inputpath "${BINARIES_DIR}"  \
-	--outputpath "${BINARIES_DIR}" \
-	--config "${GENIMAGE_CFG}"
-
-exit $?
configs/olimex_a20_olinuxino_lime2_defconfig +0 -2
index 57dda72f295f..dfb41c9aa60e 100644
@@ -7,7 +7,6 @@ BR2_TARGET_GENERIC_HOSTNAME="a20-olinuxino"
 BR2_TARGET_GENERIC_ISSUE="Welcome to OLinuXino!"
 BR2_TARGET_GENERIC_GETTY_PORT="ttyS0"
 BR2_ROOTFS_POST_BUILD_SCRIPT="board/olimex/a20_olinuxino/post-build.sh"
-BR2_ROOTFS_POST_IMAGE_SCRIPT="board/olimex/a20_olinuxino/post-image.sh"
 BR2_ROOTFS_POST_SCRIPT_ARGS="board/olimex/a20_olinuxino/boot.cmd $(TARGET_DIR)/boot"
 BR2_LINUX_KERNEL=y
 BR2_LINUX_KERNEL_CUSTOM_VERSION=y
@@ -28,5 +27,4 @@ BR2_TARGET_UBOOT_CUSTOM_VERSION=y
 BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2015.01"
 BR2_TARGET_UBOOT_SPL=y
 BR2_TARGET_UBOOT_SPL_NAME="u-boot-sunxi-with-spl.bin"
-BR2_PACKAGE_HOST_GENIMAGE=y
 BR2_PACKAGE_HOST_UBOOT_TOOLS=y
configs/olimex_a20_olinuxino_lime_defconfig +2 -2
index bfa95c4e605e..8bb8c2c04bf3 100644
@@ -12,7 +12,6 @@ BR2_TARGET_GENERIC_ISSUE="Welcome to OLinuXino!"
 BR2_TARGET_GENERIC_GETTY=y
 BR2_TARGET_GENERIC_GETTY_PORT="ttyS0"
 BR2_ROOTFS_POST_BUILD_SCRIPT="board/olimex/a20_olinuxino/post-build.sh"
-BR2_ROOTFS_POST_IMAGE_SCRIPT="board/olimex/a20_olinuxino/post-image.sh"
 BR2_ROOTFS_POST_SCRIPT_ARGS="board/olimex/a20_olinuxino/boot.cmd $(TARGET_DIR)/boot"
 
 # Kernel
@@ -28,6 +27,8 @@ BR2_LINUX_KERNEL_INSTALL_TARGET=y
 # Filesystem
 BR2_TARGET_ROOTFS_EXT2=y
 BR2_TARGET_ROOTFS_EXT2_4=y
+BR2_TARGET_ROOTFS_GENIMAGE=y
+BR2_TARGET_ROOTFS_GENIMAGE_CFG="board/olimex/a20_olinuxino/genimage.cfg"
 # BR2_TARGET_ROOTFS_TAR is not set
 
 # Bootloaders
@@ -41,5 +42,4 @@ BR2_TARGET_UBOOT_SPL=y
 BR2_TARGET_UBOOT_SPL_NAME="u-boot-sunxi-with-spl.bin"
 
 # Additional tools
-BR2_PACKAGE_HOST_GENIMAGE=y
 BR2_PACKAGE_HOST_UBOOT_TOOLS=y
configs/olimex_a20_olinuxino_lime_mali_defconfig +2 -2
index 42c8a7c39daa..50d87ea583c2 100644
@@ -12,7 +12,6 @@ BR2_TARGET_GENERIC_ISSUE="Welcome to OLinuXino!"
 BR2_TARGET_GENERIC_GETTY=y
 BR2_TARGET_GENERIC_GETTY_PORT="ttyS0"
 BR2_ROOTFS_POST_BUILD_SCRIPT="board/olimex/a20_olinuxino/post-build.sh"
-BR2_ROOTFS_POST_IMAGE_SCRIPT="board/olimex/a20_olinuxino/post-image.sh"
 BR2_ROOTFS_POST_SCRIPT_ARGS="board/olimex/a20_olinuxino/boot-mali.cmd $(TARGET_DIR)/boot"
 
 # Kernel
@@ -33,6 +32,8 @@ BR2_PACKAGE_SUNXI_MALI_DBG=y
 # Filesystem
 BR2_TARGET_ROOTFS_EXT2=y
 BR2_TARGET_ROOTFS_EXT2_4=y
+BR2_TARGET_ROOTFS_GENIMAGE=y
+BR2_TARGET_ROOTFS_GENIMAGE_CFG="board/olimex/a20_olinuxino/genimage.cfg"
 # BR2_TARGET_ROOTFS_TAR is not set
 
 # Bootloaders
@@ -45,5 +46,4 @@ BR2_TARGET_UBOOT_SPL=y
 BR2_TARGET_UBOOT_SPL_NAME="u-boot-sunxi-with-spl.bin"
 
 # Additional tools
-BR2_PACKAGE_HOST_GENIMAGE=y
 BR2_PACKAGE_HOST_UBOOT_TOOLS=y
configs/olimex_a20_olinuxino_micro_defconfig +2 -2
index 17fe6cf38816..9074ecc03020 100644
@@ -12,7 +12,6 @@ BR2_TARGET_GENERIC_ISSUE="Welcome to OLinuXino!"
 BR2_TARGET_GENERIC_GETTY_PORT="ttyS0"
 BR2_SYSTEM_DHCP="eth0"
 BR2_ROOTFS_POST_BUILD_SCRIPT="board/olimex/a20_olinuxino/post-build.sh"
-BR2_ROOTFS_POST_IMAGE_SCRIPT="board/olimex/a20_olinuxino/post-image.sh"
 BR2_ROOTFS_POST_SCRIPT_ARGS="board/olimex/a20_olinuxino/boot.cmd $(TARGET_DIR)/boot"
 
 # Kernel
@@ -27,6 +26,8 @@ BR2_LINUX_KERNEL_INSTALL_TARGET=y
 # Filesystem
 BR2_TARGET_ROOTFS_EXT2=y
 BR2_TARGET_ROOTFS_EXT2_4=y
+BR2_TARGET_ROOTFS_GENIMAGE=y
+BR2_TARGET_ROOTFS_GENIMAGE_CFG="board/olimex/a20_olinuxino/genimage.cfg"
 # BR2_TARGET_ROOTFS_TAR is not set
 
 # Bootloaders
@@ -39,5 +40,4 @@ BR2_TARGET_UBOOT_SPL=y
 BR2_TARGET_UBOOT_SPL_NAME="u-boot-sunxi-with-spl.bin"
 
 # Additional tools
-BR2_PACKAGE_HOST_GENIMAGE=y
 BR2_PACKAGE_HOST_UBOOT_TOOLS=y
Signature · 1 line
2.7.0
#16 lore raw

PATCH 4/15 board/wandboard: Leverage the new genimage infra

In reply to Ezequiel Garcia

Let's rework the board and config files to use the recently added genimage infra, which generates the SD card image directly.

---
 board/wandboard/post-image.sh | 16 ----------------
 configs/wandboard_defconfig   |  5 +++--
 2 files changed, 3 insertions(+), 18 deletions(-)
 delete mode 100755 board/wandboard/post-image.sh
board/wandboard/post-image.sh deleted +0 -16
deleted file mode 100755
index 95cbfa489705..000000000000
@@ -1,16 +0,0 @@
-#!/usr/bin/env bash
-
-GENIMAGE_CFG="board/wandboard/genimage.cfg"
-GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
-
-rm -rf "${GENIMAGE_TMP}"
-
-genimage \
-  --rootpath "${TARGET_DIR}" \
-  --tmppath "${GENIMAGE_TMP}" \
-  --inputpath "${BINARIES_DIR}" \
-  --outputpath "${BINARIES_DIR}" \
-  --config "${GENIMAGE_CFG}"
-
-RET=${?}
-exit ${RET}
configs/wandboard_defconfig +3 -2
index cf71eb2d689b..c76bef0d41a4 100644
@@ -3,10 +3,11 @@ BR2_cortex_a9=y
 # Linux headers same as kernel, a 3.14 series
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_3_14=y
 BR2_TARGET_GENERIC_GETTY_PORT="ttymxc0"
-BR2_PACKAGE_HOST_GENIMAGE=y
-BR2_ROOTFS_POST_IMAGE_SCRIPT="board/wandboard/post-image.sh"
+BR2_ROOTFS_POST_IMAGE_SCRIPT=
 BR2_TARGET_ROOTFS_EXT2=y
 BR2_TARGET_ROOTFS_EXT2_4=y
+BR2_TARGET_ROOTFS_GENIMAGE=y
+BR2_TARGET_ROOTFS_GENIMAGE_CFG="board/wandboard/genimage.cfg"
 BR2_TARGET_UBOOT=y
 BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
 BR2_TARGET_UBOOT_USE_DEFCONFIG=y
Signature · 1 line
2.7.0
#17 lore raw

PATCH 4/15 board/wandboard: Leverage the new genimage infra

Hello,

configs/wandboard_defconfig BR2_cortex_a9=y · line 6

Quoted 2 lines · Ezequiel Garcia
configs/wandboard_defconfig +1 -1
-BR2_ROOTFS_POST_IMAGE_SCRIPT="board/wandboard/post-image.sh"
+BR2_ROOTFS_POST_IMAGE_SCRIPT=

Not good :)

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#18 lore raw

PATCH 4/15 board/wandboard: Leverage the new genimage infra

Quoted 9 lines · Thomas Petazzoni

Hello,

configs/wandboard_defconfig BR2_cortex_a9=y · line 6

Quoted 2 lines · Ezequiel Garcia
configs/wandboard_defconfig +1 -1
-BR2_ROOTFS_POST_IMAGE_SCRIPT="board/wandboard/post-image.sh"
+BR2_ROOTFS_POST_IMAGE_SCRIPT=

Not good :)

Ouch, bad commit fixup.

Signature · 2 lines
Ezequiel Garc?a, VanguardiaSur
www.vanguardiasur.com.ar
#19 lore raw

PATCH 5/15 board/firefly: Leverage the new genimage infra

In reply to Ezequiel Garcia

Let's rework the board and config files to use the recently added genimage infra, which generates the SD card image directly.

---
 board/firefly/firefly-rk3288/post-build.sh |  4 ++++
 board/firefly/firefly-rk3288/post-image.sh | 20 --------------------
 configs/firefly_rk3288_defconfig           |  4 ++--
 configs/firefly_rk3288_demo_defconfig      |  4 ++--
 4 files changed, 8 insertions(+), 24 deletions(-)
 delete mode 100755 board/firefly/firefly-rk3288/post-image.sh
board/firefly/firefly-rk3288/post-build.sh +4 -0
index 94e89ce6a4a2..57b2c4604392 100755
@@ -1,3 +1,7 @@
 BOARD_DIR="$(dirname $0)"
 
 install -m 0644 -D $BOARD_DIR/extlinux.conf $TARGET_DIR/boot/extlinux/extlinux.conf
+
+$HOST_DIR/usr/bin/mkimage -n rk3288 -T rksd	\
+	-d $BINARIES_DIR/u-boot-spl-dtb.bin	\
+	$BINARIES_DIR/u-boot-spl-dtb.img
board/firefly/firefly-rk3288/post-image.sh deleted +0 -20
deleted file mode 100755
index 1dd30a6e7e8e..000000000000
@@ -1,20 +0,0 @@
-#!/bin/sh
-
-MKIMAGE=$HOST_DIR/usr/bin/mkimage
-
-BOARD_DIR="$(dirname $0)"
-GENIMAGE_CFG="${BOARD_DIR}/sd-image.cfg"
-GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
-
-$MKIMAGE -n rk3288 -T rksd -d $BINARIES_DIR/u-boot-spl-dtb.bin $BINARIES_DIR/u-boot-spl-dtb.img
-
-rm -rf "${GENIMAGE_TMP}"
-
-genimage							\
-	--rootpath "${TARGET_DIR}"		\
-	--tmppath "${GENIMAGE_TMP}"		\
-	--inputpath "${BINARIES_DIR}"	\
-	--outputpath "${BINARIES_DIR}"	\
-	--config "${GENIMAGE_CFG}"
-
-exit $?
configs/firefly_rk3288_defconfig +2 -2
index 017a7ee6d748..5f33cceb0255 100644
@@ -5,7 +5,6 @@ BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_4=y
 BR2_TARGET_GENERIC_HOSTNAME="firefly-rk3288"
 BR2_TARGET_GENERIC_ISSUE="Welcome to FIREFLY RK3288!"
 BR2_ROOTFS_POST_BUILD_SCRIPT="board/firefly/firefly-rk3288/post-build.sh"
-BR2_ROOTFS_POST_IMAGE_SCRIPT="board/firefly/firefly-rk3288/post-image.sh"
 BR2_LINUX_KERNEL=y
 BR2_LINUX_KERNEL_CUSTOM_GIT=y
 BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/mmind/linux-rockchip.git"
@@ -18,6 +17,8 @@ BR2_LINUX_KERNEL_INTREE_DTS_NAME="rk3288-firefly"
 BR2_LINUX_KERNEL_INSTALL_TARGET=y
 BR2_TARGET_ROOTFS_EXT2=y
 BR2_TARGET_ROOTFS_EXT2_4=y
+BR2_TARGET_ROOTFS_GENIMAGE=y
+BR2_TARGET_ROOTFS_GENIMAGE_CFG="board/firefly/firefly-rk3288/sd-image.cfg"
 # BR2_TARGET_ROOTFS_TAR is not set
 BR2_TARGET_UBOOT=y
 BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
@@ -28,5 +29,4 @@ BR2_TARGET_UBOOT_NEEDS_DTC=y
 BR2_TARGET_UBOOT_FORMAT_DTB_IMG=y
 BR2_TARGET_UBOOT_SPL=y
 BR2_TARGET_UBOOT_SPL_NAME="spl/u-boot-spl-dtb.bin"
-BR2_PACKAGE_HOST_GENIMAGE=y
 BR2_PACKAGE_HOST_UBOOT_TOOLS=y
configs/firefly_rk3288_demo_defconfig +2 -2
index 7dadc6bc9aeb..692455d5378c 100644
@@ -7,7 +7,6 @@ BR2_TOOLCHAIN_BUILDROOT_CXX=y
 BR2_TARGET_GENERIC_HOSTNAME="firefly-rk3288"
 BR2_TARGET_GENERIC_ISSUE="Welcome to FIREFLY RK3288!"
 BR2_ROOTFS_POST_BUILD_SCRIPT="board/firefly/firefly-rk3288/post-build.sh"
-BR2_ROOTFS_POST_IMAGE_SCRIPT="board/firefly/firefly-rk3288/post-image.sh"
 BR2_LINUX_KERNEL=y
 BR2_LINUX_KERNEL_CUSTOM_GIT=y
 BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/mmind/linux-rockchip.git"
@@ -26,6 +25,8 @@ BR2_PACKAGE_QT5BASE_EGLFS=y
 BR2_PACKAGE_MALI_T76X=y
 BR2_TARGET_ROOTFS_EXT2=y
 BR2_TARGET_ROOTFS_EXT2_4=y
+BR2_TARGET_ROOTFS_GENIMAGE=y
+BR2_TARGET_ROOTFS_GENIMAGE_CFG="board/firefly/firefly-rk3288/sd-image.cfg"
 # BR2_TARGET_ROOTFS_TAR is not set
 BR2_TARGET_UBOOT=y
 BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
@@ -36,5 +37,4 @@ BR2_TARGET_UBOOT_NEEDS_DTC=y
 BR2_TARGET_UBOOT_FORMAT_DTB_IMG=y
 BR2_TARGET_UBOOT_SPL=y
 BR2_TARGET_UBOOT_SPL_NAME="spl/u-boot-spl-dtb.bin"
-BR2_PACKAGE_HOST_GENIMAGE=y
 BR2_PACKAGE_HOST_UBOOT_TOOLS=y
Signature · 1 line
2.7.0
#20 lore raw

PATCH 6/15 board/cubieboard2: Leverage the new genimage infra

In reply to Ezequiel Garcia

Let's rework the board and config files to use the recently added genimage infra, which generates the SD card image directly.

While here, let's remove the tar'ed rootfs, which
is not used.

---
 board/cubietech/cubieboard2/post-image.sh | 16 ----------------
 configs/cubieboard2_defconfig             |  5 +++--
 2 files changed, 3 insertions(+), 18 deletions(-)
 delete mode 100755 board/cubietech/cubieboard2/post-image.sh
board/cubietech/cubieboard2/post-image.sh deleted +0 -16
deleted file mode 100755
index 9cca1b1789ec..000000000000
@@ -1,16 +0,0 @@
-#!/bin/sh
-
-BOARD_DIR="$(dirname $0)"
-GENIMAGE_CFG="${BOARD_DIR}/genimage.cfg"
-GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
-
-rm -rf "${GENIMAGE_TMP}"
-
-genimage                           \
-	--rootpath "${TARGET_DIR}"     \
-	--tmppath "${GENIMAGE_TMP}"    \
-	--inputpath "${BINARIES_DIR}"  \
-	--outputpath "${BINARIES_DIR}" \
-	--config "${GENIMAGE_CFG}"
-
-exit $?
configs/cubieboard2_defconfig +3 -2
index a3b1b857ee6a..f98e7f3001ae 100644
@@ -7,7 +7,6 @@ BR2_TARGET_GENERIC_HOSTNAME="Cubieboard2"
 BR2_TARGET_GENERIC_ISSUE="Welcome to Cubieboard2!"
 BR2_TARGET_GENERIC_GETTY_PORT="ttyS0"
 BR2_ROOTFS_POST_BUILD_SCRIPT="board/cubietech/cubieboard2/post-build.sh"
-BR2_ROOTFS_POST_IMAGE_SCRIPT="board/cubietech/cubieboard2/post-image.sh"
 BR2_LINUX_KERNEL=y
 BR2_LINUX_KERNEL_CUSTOM_VERSION=y
 BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.3.3"
@@ -16,6 +15,9 @@ BR2_LINUX_KERNEL_DTS_SUPPORT=y
 BR2_LINUX_KERNEL_INTREE_DTS_NAME="sun7i-a20-cubieboard2"
 BR2_TARGET_ROOTFS_EXT2=y
 BR2_TARGET_ROOTFS_EXT2_4=y
+BR2_TARGET_ROOTFS_GENIMAGE=y
+BR2_TARGET_ROOTFS_GENIMAGE_CFG="board/cubietech/cubieboard2/genimage.cfg"
+# BR2_TARGET_ROOTFS_TAR is not set
 BR2_TARGET_UBOOT=y
 BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
 BR2_TARGET_UBOOT_CUSTOM_VERSION=y
@@ -25,6 +27,5 @@ BR2_TARGET_UBOOT_NEEDS_DTC=y
 BR2_TARGET_UBOOT_SPL=y
 BR2_TARGET_UBOOT_SPL_NAME="u-boot-sunxi-with-spl.bin"
 BR2_PACKAGE_HOST_DOSFSTOOLS=y
-BR2_PACKAGE_HOST_GENIMAGE=y
 BR2_PACKAGE_HOST_MTOOLS=y
 BR2_PACKAGE_HOST_UBOOT_TOOLS=y
Signature · 1 line
2.7.0
#21 lore raw

PATCH 7/15 board/arietta-g25: Leverage the new genimage infra

In reply to Ezequiel Garcia

Let's rework the board and config files to use the recently added genimage infra, which generates the SD card image directly.

---
 board/acmesystems/arietta-g25/post-image.sh     | 16 ----------------
 configs/acmesystems_arietta_g25_128mb_defconfig |  4 ++--
 configs/acmesystems_arietta_g25_256mb_defconfig |  4 ++--
 3 files changed, 4 insertions(+), 20 deletions(-)
 delete mode 100755 board/acmesystems/arietta-g25/post-image.sh
board/acmesystems/arietta-g25/post-image.sh deleted +0 -16
deleted file mode 100755
index c82b189f9c89..000000000000
@@ -1,16 +0,0 @@
-#!/bin/sh
-
-BOARD_DIR="$(dirname $0)"
-GENIMAGE_CFG="${BOARD_DIR}/genimage.cfg"
-GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
-
-rm -rf "${GENIMAGE_TMP}"
-
-genimage                               \
-	--rootpath "${TARGET_DIR}"     \
-	--tmppath "${GENIMAGE_TMP}"    \
-	--inputpath "${BINARIES_DIR}"  \
-	--outputpath "${BINARIES_DIR}" \
-	--config "${GENIMAGE_CFG}"
-
-exit $?
configs/acmesystems_arietta_g25_128mb_defconfig +2 -2
index 061cb8bd99d5..1b5618373484 100644
@@ -21,10 +21,10 @@ BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_REPO_VERSION="cedbde4b36695b715f469f4872f47e5cc
 BR2_TARGET_AT91BOOTSTRAP3_DEFCONFIG="arietta-128m"
 
 # Image
-BR2_ROOTFS_POST_IMAGE_SCRIPT="board/acmesystems/arietta-g25/post-image.sh"
 BR2_TARGET_ROOTFS_EXT2=y
 BR2_TARGET_ROOTFS_EXT2_4=y
+BR2_TARGET_ROOTFS_GENIMAGE=y
+BR2_TARGET_ROOTFS_GENIMAGE_CFG="board/acmesystems/arietta-g25/genimage.cfg"
 # BR2_TARGET_ROOTFS_TAR is not set
-BR2_PACKAGE_HOST_GENIMAGE=y
 BR2_PACKAGE_HOST_DOSFSTOOLS=y
 BR2_PACKAGE_HOST_MTOOLS=y
configs/acmesystems_arietta_g25_256mb_defconfig +2 -2
index 2d62837c2c32..954376c14757 100644
@@ -21,10 +21,10 @@ BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_REPO_VERSION="cedbde4b36695b715f469f4872f47e5cc
 BR2_TARGET_AT91BOOTSTRAP3_DEFCONFIG="arietta-256m"
 
 # Image
-BR2_ROOTFS_POST_IMAGE_SCRIPT="board/acmesystems/arietta-g25/post-image.sh"
 BR2_TARGET_ROOTFS_EXT2=y
 BR2_TARGET_ROOTFS_EXT2_4=y
+BR2_TARGET_ROOTFS_GENIMAGE=y
+BR2_TARGET_ROOTFS_GENIMAGE_CFG="board/acmesystems/arietta-g25/genimage.cfg"
 # BR2_TARGET_ROOTFS_TAR is not set
-BR2_PACKAGE_HOST_GENIMAGE=y
 BR2_PACKAGE_HOST_DOSFSTOOLS=y
 BR2_PACKAGE_HOST_MTOOLS=y
Signature · 1 line
2.7.0
#22 lore raw

PATCH 8/15 board/imx6ulevk: Leverage the new genimage infra

In reply to Ezequiel Garcia

Let's rework the board and config files to use the recently added genimage infra, which generates the SD card image directly.

---
 board/freescale/imx6ulevk/post-image.sh | 15 ---------------
 configs/freescale_imx6ulevk_defconfig   |  4 ++--
 2 files changed, 2 insertions(+), 17 deletions(-)
 delete mode 100755 board/freescale/imx6ulevk/post-image.sh
board/freescale/imx6ulevk/post-image.sh deleted +0 -15
deleted file mode 100755
index cb75a47de64d..000000000000
@@ -1,15 +0,0 @@
-#!/usr/bin/env bash
-
-GENIMAGE_CFG="board/freescale/imx6ulevk/genimage.cfg"
-GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
-
-rm -rf "${GENIMAGE_TMP}"
-
-genimage \
-  --rootpath "${TARGET_DIR}" \
-  --tmppath "${GENIMAGE_TMP}" \
-  --inputpath "${BINARIES_DIR}" \
-  --outputpath "${BINARIES_DIR}" \
-  --config "${GENIMAGE_CFG}"
-
-exit $?
configs/freescale_imx6ulevk_defconfig +2 -2
index b8a1f867b48b..55b3fa5e085d 100644
@@ -27,9 +27,9 @@ BR2_TARGET_UBOOT_FORMAT_IMX=y
 
 # required tools to create the microSD image
 BR2_PACKAGE_HOST_DOSFSTOOLS=y
-BR2_PACKAGE_HOST_GENIMAGE=y
 BR2_PACKAGE_HOST_MTOOLS=y
 
 # filesystem / image
-BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/imx6ulevk/post-image.sh"
 BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_ROOTFS_GENIMAGE=y
+BR2_TARGET_ROOTFS_GENIMAGE_CFG="board/freescale/imx6ulevk/genimage.cfg"
Signature · 1 line
2.7.0
#23 lore raw

PATCH 9/15 board/galileo: Leverage the new genimage infra

In reply to Ezequiel Garcia

Let's rework the board and config files to use the recently added genimage infra, which generates the SD card image directly.

---
 board/intel/galileo/post-image.sh | 13 -------------
 configs/galileo_defconfig         |  4 ++--
 2 files changed, 2 insertions(+), 15 deletions(-)
 delete mode 100755 board/intel/galileo/post-image.sh
board/intel/galileo/post-image.sh deleted +0 -13
deleted file mode 100755
index f9aef0b1ba6c..000000000000
@@ -1,13 +0,0 @@
-#!/bin/sh -e
-
-GENIMAGE_CFG="board/intel/galileo/genimage.cfg"
-GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
-
-rm -rf "${GENIMAGE_TMP}"
-
-genimage \
-    --rootpath "${TARGET_DIR}" \
-    --tmppath "${GENIMAGE_TMP}" \
-    --inputpath "${BINARIES_DIR}" \
-    --outputpath "${BINARIES_DIR}" \
-    --config "${GENIMAGE_CFG}"
configs/galileo_defconfig +2 -2
index 9334266b1e96..dde324cccd80 100644
@@ -8,7 +8,6 @@ BR2_TARGET_GENERIC_GETTY_PORT="ttyS1"
 BR2_TARGET_GENERIC_GETTY_BAUDRATE_115200=y
 BR2_ROOTFS_OVERLAY="board/intel/galileo/rootfs_overlay"
 BR2_ROOTFS_POST_BUILD_SCRIPT="board/intel/galileo/post-build.sh"
-BR2_ROOTFS_POST_IMAGE_SCRIPT="board/intel/galileo/post-image.sh"
 BR2_LINUX_KERNEL=y
 BR2_LINUX_KERNEL_CUSTOM_GIT=y
 BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/mdr78/Linux-x1000.git"
@@ -18,8 +17,9 @@ BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/intel/galileo/linux-3.8.config"
 BR2_LINUX_KERNEL_INSTALL_TARGET=y
 BR2_TARGET_ROOTFS_EXT2=y
 BR2_TARGET_ROOTFS_EXT2_4=y
+BR2_TARGET_ROOTFS_GENIMAGE=y
+BR2_TARGET_ROOTFS_GENIMAGE_CFG="board/intel/galileo/genimage.cfg"
 BR2_TARGET_GRUB2=y
 BR2_TARGET_GRUB2_I386_EFI=y
 BR2_PACKAGE_HOST_DOSFSTOOLS=y
-BR2_PACKAGE_HOST_GENIMAGE=y
 BR2_PACKAGE_HOST_MTOOLS=y
Signature · 1 line
2.7.0
#24 lore raw

PATCH 10/15 board/pandaboard: Leverage the new genimage infra

In reply to Ezequiel Garcia

Let's rework the board and config files to use the recently added genimage infra, which generates the SD card image directly.

---
 board/pandaboard/post-image.sh | 16 ----------------
 configs/pandaboard_defconfig   |  4 ++--
 2 files changed, 2 insertions(+), 18 deletions(-)
 delete mode 100755 board/pandaboard/post-image.sh
board/pandaboard/post-image.sh deleted +0 -16
deleted file mode 100755
index 9cca1b1789ec..000000000000
@@ -1,16 +0,0 @@
-#!/bin/sh
-
-BOARD_DIR="$(dirname $0)"
-GENIMAGE_CFG="${BOARD_DIR}/genimage.cfg"
-GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
-
-rm -rf "${GENIMAGE_TMP}"
-
-genimage                           \
-	--rootpath "${TARGET_DIR}"     \
-	--tmppath "${GENIMAGE_TMP}"    \
-	--inputpath "${BINARIES_DIR}"  \
-	--outputpath "${BINARIES_DIR}" \
-	--config "${GENIMAGE_CFG}"
-
-exit $?
configs/pandaboard_defconfig +2 -2
index 49747e070f71..50496d7da320 100644
@@ -6,7 +6,6 @@ BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_5=y
 BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV=y
 BR2_TARGET_GENERIC_GETTY_PORT="ttyO2"
 BR2_SYSTEM_DHCP="eth0"
-BR2_ROOTFS_POST_IMAGE_SCRIPT="board/pandaboard/post-image.sh"
 BR2_LINUX_KERNEL=y
 BR2_LINUX_KERNEL_CUSTOM_VERSION=y
 BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.5"
@@ -16,6 +15,8 @@ BR2_LINUX_KERNEL_INTREE_DTS_NAME="omap4-panda-es omap4-panda omap4-panda-a4"
 BR2_LINUX_KERNEL_INSTALL_TARGET=y
 BR2_TARGET_ROOTFS_EXT2=y
 BR2_TARGET_ROOTFS_EXT2_4=y
+BR2_TARGET_ROOTFS_GENIMAGE=y
+BR2_TARGET_ROOTFS_GENIMAGE_CFG="board/pandaboard/genimage.cfg"
 # BR2_TARGET_ROOTFS_TAR is not set
 BR2_TARGET_UBOOT=y
 BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
@@ -26,5 +27,4 @@ BR2_TARGET_UBOOT_FORMAT_IMG=y
 BR2_TARGET_UBOOT_SPL=y
 BR2_TARGET_UBOOT_SPL_NAME="MLO"
 BR2_PACKAGE_HOST_DOSFSTOOLS=y
-BR2_PACKAGE_HOST_GENIMAGE=y
 BR2_PACKAGE_HOST_MTOOLS=y
Signature · 1 line
2.7.0
#25 lore raw

PATCH 11/15 board/boundarydevices: Leverage the new genimage infra

In reply to Ezequiel Garcia

Let's rework the board and config files to use the recently added genimage infra, which generates the SD card image directly.

---
 board/boundarydevices/common/post-image.sh | 16 ----------------
 configs/nitrogen6sx_defconfig              |  4 ++--
 configs/nitrogen6x_defconfig               |  4 ++--
 configs/nitrogen7_defconfig                |  4 ++--
 4 files changed, 6 insertions(+), 22 deletions(-)
 delete mode 100755 board/boundarydevices/common/post-image.sh
board/boundarydevices/common/post-image.sh deleted +0 -16
deleted file mode 100755
index 9cca1b1789ec..000000000000
@@ -1,16 +0,0 @@
-#!/bin/sh
-
-BOARD_DIR="$(dirname $0)"
-GENIMAGE_CFG="${BOARD_DIR}/genimage.cfg"
-GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
-
-rm -rf "${GENIMAGE_TMP}"
-
-genimage                           \
-	--rootpath "${TARGET_DIR}"     \
-	--tmppath "${GENIMAGE_TMP}"    \
-	--inputpath "${BINARIES_DIR}"  \
-	--outputpath "${BINARIES_DIR}" \
-	--config "${GENIMAGE_CFG}"
-
-exit $?
configs/nitrogen6sx_defconfig +2 -2
index 9d2531769050..29a4ffdc27c6 100644
@@ -6,13 +6,13 @@ BR2_cortex_a9=y
 BR2_TARGET_GENERIC_GETTY=y
 BR2_TARGET_GENERIC_GETTY_PORT="ttymxc0"
 BR2_ROOTFS_POST_BUILD_SCRIPT="board/boundarydevices/common/post-build.sh"
-BR2_ROOTFS_POST_IMAGE_SCRIPT="board/boundarydevices/common/post-image.sh"
-BR2_PACKAGE_HOST_GENIMAGE=y
 BR2_PACKAGE_HOST_UBOOT_TOOLS=y
 
 # filesystem
 BR2_TARGET_ROOTFS_EXT2=y
 BR2_TARGET_ROOTFS_EXT2_4=y
+BR2_TARGET_ROOTFS_GENIMAGE=y
+BR2_TARGET_ROOTFS_GENIMAGE_CFG="board/boundarydevices/common/genimage.cfg"
 
 # Linux headers same as kernel, a 3.14 series
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_3_14=y
configs/nitrogen6x_defconfig +2 -2
index 866b1f8ffc3a..1307d713bb68 100644
@@ -6,13 +6,13 @@ BR2_cortex_a9=y
 BR2_TARGET_GENERIC_GETTY=y
 BR2_TARGET_GENERIC_GETTY_PORT="ttymxc1"
 BR2_ROOTFS_POST_BUILD_SCRIPT="board/boundarydevices/common/post-build.sh"
-BR2_ROOTFS_POST_IMAGE_SCRIPT="board/boundarydevices/common/post-image.sh"
-BR2_PACKAGE_HOST_GENIMAGE=y
 BR2_PACKAGE_HOST_UBOOT_TOOLS=y
 
 # filesystem
 BR2_TARGET_ROOTFS_EXT2=y
 BR2_TARGET_ROOTFS_EXT2_4=y
+BR2_TARGET_ROOTFS_GENIMAGE=y
+BR2_TARGET_ROOTFS_GENIMAGE_CFG="board/boundarydevices/common/genimage.cfg"
 
 # Linux headers same as kernel, a 3.14 series
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_3_14=y
configs/nitrogen7_defconfig +2 -2
index 9d54d789fa11..0b1cd558ba48 100644
@@ -6,14 +6,14 @@ BR2_cortex_a7=y
 BR2_TARGET_GENERIC_GETTY=y
 BR2_TARGET_GENERIC_GETTY_PORT="ttymxc0"
 BR2_ROOTFS_POST_BUILD_SCRIPT="board/boundarydevices/common/post-build.sh"
-BR2_ROOTFS_POST_IMAGE_SCRIPT="board/boundarydevices/common/post-image.sh"
-BR2_PACKAGE_HOST_GENIMAGE=y
 BR2_PACKAGE_HOST_UBOOT_TOOLS=y
 
 # filesystem
 # BR2_TARGET_ROOTFS_TAR is not set
 BR2_TARGET_ROOTFS_EXT2=y
 BR2_TARGET_ROOTFS_EXT2_4=y
+BR2_TARGET_ROOTFS_GENIMAGE=y
+BR2_TARGET_ROOTFS_GENIMAGE_CFG="board/boundarydevices/common/genimage.cfg"
 
 # Linux headers same as kernel, a 3.14 series
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_3_14=y
Signature · 1 line
2.7.0
#26 lore raw

PATCH 12/15 board/imx233_olinuxino: Leverage the new genimage infra

In reply to Ezequiel Garcia

Let's rework the board and config files to use the recently added genimage infra, which generates the SD card image directly.

---
 board/olimex/imx233_olinuxino/post-image.sh | 14 --------------
 configs/olimex_imx233_olinuxino_defconfig   |  3 ++-
 2 files changed, 2 insertions(+), 15 deletions(-)
board/olimex/imx233_olinuxino/post-image.sh +0 -14
index 703cbe7ee2f7..d12854938f65 100755
@@ -1,20 +1,6 @@
 #!/bin/sh
 
-BOARD_DIR="$(dirname $0)"
-BOARD_NAME="$(basename ${BOARD_DIR})"
-GENIMAGE_CFG="${BOARD_DIR}/genimage-${BOARD_NAME}.cfg"
-GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
-
 # Create symlink to "rename" kernel image
 ln -sf uImage.imx23-olinuxino ${BINARIES_DIR}/uImage
 
-rm -rf "${GENIMAGE_TMP}"
-
-genimage                           \
-	--rootpath "${TARGET_DIR}"     \
-	--tmppath "${GENIMAGE_TMP}"    \
-	--inputpath "${BINARIES_DIR}"  \
-	--outputpath "${BINARIES_DIR}" \
-	--config "${GENIMAGE_CFG}"
-
 exit $?
configs/olimex_imx233_olinuxino_defconfig +2 -1
index f74f42222ac5..aa81fa995f55 100644
@@ -30,6 +30,8 @@ BR2_PACKAGE_ZD1211_FIRMWARE=y
 
 # Filesystem
 BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_ROOTFS_GENIMAGE=y
+BR2_TARGET_ROOTFS_GENIMAGE_CFG="board/olimex/imx233_olinuxino/post-image.sh"
 # BR2_TARGET_ROOTFS_TAR is not set
 
 # U-Boot
@@ -42,7 +44,6 @@ BR2_TARGET_UBOOT_FORMAT_SD=y
  
 # To generate SD Image
 BR2_PACKAGE_HOST_DOSFSTOOLS=y
-BR2_PACKAGE_HOST_GENIMAGE=y
 BR2_PACKAGE_HOST_MTOOLS=y
 BR2_ROOTFS_POST_IMAGE_SCRIPT="board/olimex/imx233_olinuxino/post-image.sh"
 
Signature · 1 line
2.7.0
#27 lore raw

PATCH 13/15 board/orangepipc: Leverage the new genimage infra

In reply to Ezequiel Garcia

Let's rework the board and config files to use the recently added genimage infra, which generates the SD card image directly.

---
 board/orangepi/orangepipc/post-build.sh |  5 +++++
 board/orangepi/orangepipc/post-image.sh | 22 ----------------------
 configs/orangepipc_defconfig            |  4 ++--
 3 files changed, 7 insertions(+), 24 deletions(-)
 delete mode 100755 board/orangepi/orangepipc/post-image.sh
board/orangepi/orangepipc/post-build.sh +5 -0
index ca7a99f220cc..3482d5796e5a 100755
@@ -9,3 +9,8 @@ BOOT_CMD_H=$BINARIES_DIR/boot.scr
 
 # U-Boot script
 $MKIMAGE -C none -A arm -T script -d $BOOT_CMD $BOOT_CMD_H
+
+# As we now use the Linux v4.5-RC1 kernel no orangepi-pc dtb exists yet.
+# However the orangepi-plus dtb has not much content, only mmc0 and uart
+# which are equal to the pc version of the board, so we use it here.
+mv ${BINARIES_DIR}/sun8i-h3-orangepi-plus.dtb ${BINARIES_DIR}/sun8i-h3-orangepi-pc.dtb
board/orangepi/orangepipc/post-image.sh deleted +0 -22
deleted file mode 100755
index dbe1516696bd..000000000000
@@ -1,22 +0,0 @@
-#!/bin/sh
-
-BOARD_DIR="$(dirname $0)"
-GENIMAGE_CFG="${BOARD_DIR}/genimage.cfg"
-GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
-
-rm -rf "${GENIMAGE_TMP}"
-
-# As we now use the Linux v4.5-RC1 kernel no orangepi-pc dtb exists yet.
-# However the orangepi-plus dtb has not much content, only mmc0 and uart
-# which are equal to the pc version of the board, so we use it here.
-mv ${BINARIES_DIR}/sun8i-h3-orangepi-plus.dtb ${BINARIES_DIR}/sun8i-h3-orangepi-pc.dtb
-
-
-genimage                               \
-	--rootpath "${TARGET_DIR}"     \
-	--tmppath "${GENIMAGE_TMP}"    \
-	--inputpath "${BINARIES_DIR}"  \
-	--outputpath "${BINARIES_DIR}" \
-	--config "${GENIMAGE_CFG}"
-
-exit $?
configs/orangepipc_defconfig +2 -2
index cb04d744892c..42485c6431ec 100644
@@ -5,7 +5,6 @@ BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_5=y
 BR2_TARGET_GENERIC_HOSTNAME="OrangePi_PC"
 BR2_TARGET_GENERIC_ISSUE="Welcome to Buildroot for the Orange Pi PC"
 BR2_ROOTFS_POST_BUILD_SCRIPT="board/orangepi/orangepipc/post-build.sh"
-BR2_ROOTFS_POST_IMAGE_SCRIPT="board/orangepi/orangepipc/post-image.sh"
 BR2_LINUX_KERNEL=y
 BR2_LINUX_KERNEL_CUSTOM_VERSION=y
 BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.5"
@@ -14,6 +13,8 @@ BR2_LINUX_KERNEL_DTS_SUPPORT=y
 BR2_LINUX_KERNEL_INTREE_DTS_NAME="sun8i-h3-orangepi-plus"
 BR2_TARGET_ROOTFS_EXT2=y
 BR2_TARGET_ROOTFS_EXT2_4=y
+BR2_TARGET_ROOTFS_GENIMAGE=y
+BR2_TARGET_ROOTFS_GENIMAGE_CFG="board/orangepi/orangepipc/genimage.cfg"
 # BR2_TARGET_ROOTFS_TAR is not set
 BR2_TARGET_UBOOT=y
 BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
@@ -24,6 +25,5 @@ BR2_TARGET_UBOOT_NEEDS_DTC=y
 BR2_TARGET_UBOOT_FORMAT_CUSTOM=y
 BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME="u-boot-sunxi-with-spl.bin"
 BR2_PACKAGE_HOST_DOSFSTOOLS=y
-BR2_PACKAGE_HOST_GENIMAGE=y
 BR2_PACKAGE_HOST_MTOOLS=y
 BR2_PACKAGE_HOST_UBOOT_TOOLS=y
Signature · 1 line
2.7.0
#28 lore raw

PATCH 14/15 board/raspberry*: Leverage the new genimage infra

In reply to Ezequiel Garcia

Let's rework the board and config files to use the recently added genimage infra, which generates the SD card image directly.

---
 board/raspberrypi/post-build.sh |  8 ++++++++
 board/raspberrypi/post-image.sh | 22 ----------------------
 configs/raspberrypi2_defconfig  |  5 +++--
 configs/raspberrypi_defconfig   |  5 +++--
 4 files changed, 14 insertions(+), 26 deletions(-)
 create mode 100755 board/raspberrypi/post-build.sh
 delete mode 100755 board/raspberrypi/post-image.sh
board/raspberrypi/post-build.sh new file +8 -0
new file mode 100755
index 000000000000..8b66536d84c6
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+# Mark the kernel as DT-enabled
+mkdir -p "${BINARIES_DIR}/kernel-marked"
+${HOST_DIR}/usr/bin/mkknlimg "${BINARIES_DIR}/zImage" \
+	"${BINARIES_DIR}/kernel-marked/zImage"
+
+exit $?
board/raspberrypi/post-image.sh deleted +0 -22
deleted file mode 100755
index 73ffd658e7ca..000000000000
@@ -1,22 +0,0 @@
-#!/bin/sh
-
-BOARD_DIR="$(dirname $0)"
-BOARD_NAME="$(basename ${BOARD_DIR})"
-GENIMAGE_CFG="${BOARD_DIR}/genimage-${BOARD_NAME}.cfg"
-GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
-
-# Mark the kernel as DT-enabled
-mkdir -p "${BINARIES_DIR}/kernel-marked"
-${HOST_DIR}/usr/bin/mkknlimg "${BINARIES_DIR}/zImage" \
-	"${BINARIES_DIR}/kernel-marked/zImage"
-
-rm -rf "${GENIMAGE_TMP}"
-
-genimage                           \
-	--rootpath "${TARGET_DIR}"     \
-	--tmppath "${GENIMAGE_TMP}"    \
-	--inputpath "${BINARIES_DIR}"  \
-	--outputpath "${BINARIES_DIR}" \
-	--config "${GENIMAGE_CFG}"
-
-exit $?
configs/raspberrypi2_defconfig +3 -2
index 1d82f6041742..fed926869cc9 100644
@@ -25,11 +25,12 @@ BR2_PACKAGE_RPI_FIRMWARE=y
 
 # Required tools to create the SD image
 BR2_PACKAGE_HOST_DOSFSTOOLS=y
-BR2_PACKAGE_HOST_GENIMAGE=y
 BR2_PACKAGE_HOST_MTOOLS=y
 
 # Filesystem / image
 BR2_TARGET_ROOTFS_EXT2=y
 BR2_TARGET_ROOTFS_EXT2_4=y
+BR2_TARGET_ROOTFS_GENIMAGE=y
+BR2_TARGET_ROOTFS_GENIMAGE_CFG="board/raspberrypi2/genimage-raspberrypi2.cfg"
 # BR2_TARGET_ROOTFS_TAR is not set
-BR2_ROOTFS_POST_IMAGE_SCRIPT="board/raspberrypi2/post-image.sh"
+BR2_ROOTFS_POST_BUILD_SCRIPT="board/raspberrypi2/post-build.sh"
configs/raspberrypi_defconfig +3 -2
index 615c052bdd26..10cb812a3371 100644
@@ -24,11 +24,12 @@ BR2_PACKAGE_RPI_FIRMWARE=y
 
 # Required tools to create the SD image
 BR2_PACKAGE_HOST_DOSFSTOOLS=y
-BR2_PACKAGE_HOST_GENIMAGE=y
 BR2_PACKAGE_HOST_MTOOLS=y
 
 # Filesystem / image
 BR2_TARGET_ROOTFS_EXT2=y
 BR2_TARGET_ROOTFS_EXT2_4=y
+BR2_TARGET_ROOTFS_GENIMAGE=y
+BR2_TARGET_ROOTFS_GENIMAGE_CFG="board/raspberrypi/genimage-raspberrypi.cfg"
 # BR2_TARGET_ROOTFS_TAR is not set
-BR2_ROOTFS_POST_IMAGE_SCRIPT="board/raspberrypi/post-image.sh"
+BR2_ROOTFS_POST_BUILD_SCRIPT="board/raspberrypi/post-build.sh"
Signature · 1 line
2.7.0
#29 lore raw

PATCH 15/15 board/via_imx6_vab820: Leverage the new genimage infra

In reply to Ezequiel Garcia

Let's rework the board and config files to use the recently added genimage infra, which generates the SD card image directly.

---
 configs/via_imx6_vab820_defconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
configs/via_imx6_vab820_defconfig +2 -2
index a86c5139db04..d66ef6e8600f 100644
@@ -28,7 +28,7 @@ BR2_TARGET_UBOOT_FORMAT_IMX=y
 # Filesystem
 BR2_TARGET_ROOTFS_EXT2=y
 BR2_TARGET_ROOTFS_EXT2_4=y
+BR2_TARGET_ROOTFS_GENIMAGE=y
+BR2_TARGET_ROOTFS_GENIMAGE_CFG="board/via/imx6_vab820/genimage.cfg"
 BR2_PACKAGE_HOST_DOSFSTOOLS=y
-BR2_PACKAGE_HOST_GENIMAGE=y
 BR2_PACKAGE_HOST_MTOOLS=y
-BR2_ROOTFS_POST_IMAGE_SCRIPT="board/via/imx6_vab820/post-image.sh"
Signature · 1 line
2.7.0