diff mbox

olimex_imx233: refactor with genimage.sh

Message ID 20170701153433.11906-1-francois.perrad@gadz.org
State Changes Requested
Headers show

Commit Message

Francois Perrad July 1, 2017, 3:34 p.m. UTC
instead of use a freescale script

Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
---
 board/olimex/imx233_olinuxino/genimage.cfg | 37 ++++++++++++++++++++++++++++++
 configs/olimex_imx233_olinuxino_defconfig  |  3 ++-
 2 files changed, 39 insertions(+), 1 deletion(-)
 create mode 100644 board/olimex/imx233_olinuxino/genimage.cfg

Comments

Thomas Petazzoni July 1, 2017, 3:45 p.m. UTC | #1
Hello,

On Sat,  1 Jul 2017 17:34:33 +0200, Francois Perrad wrote:
> instead of use a freescale script
> 
> Signed-off-by: Francois Perrad <francois.perrad@gadz.org>

Could you explain why this is an improvement? The whole idea of
board/freescale/common/mxs/post-image.sh is to have a single
genimage.cfg.template file that covers all MXS boards. So your change
doesn't seem to go in the right direction.

Thanks,

Thomas
Francois Perrad July 10, 2017, 6:25 p.m. UTC | #2
2017-07-01 17:45 GMT+02:00 Thomas Petazzoni <
thomas.petazzoni@free-electrons.com>:

> Hello,
>
> On Sat,  1 Jul 2017 17:34:33 +0200, Francois Perrad wrote:
> > instead of use a freescale script
> >
> > Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
>
> Could you explain why this is an improvement? The whole idea of
> board/freescale/common/mxs/post-image.sh is to have a single
> genimage.cfg.template file that covers all MXS boards. So your change
> doesn't seem to go in the right direction.
>
>
First, I like common tools which avoid duplication of effort.

I introduced the use of the common mxs script on November 2016, soon after
its creation by Fabio.

But, I dislike the level indirection given by the template of image
description (the use of this template is good inside board/freescale, but
not outside).

So now, I prefer use the new global common script
support/scripts/genimage.sh.

François


> Thanks,
>
> Thomas
> --
> Thomas Petazzoni, CTO, Free Electrons
> Embedded Linux and Kernel engineering
> http://free-electrons.com
> _______________________________________________
> buildroot mailing list
> buildroot@busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
>
Fabio Estevam July 11, 2017, 7:47 p.m. UTC | #3
On Mon, Jul 10, 2017 at 3:25 PM, François Perrad
<francois.perrad@gadz.org> wrote:
>
>
> First, I like common tools which avoid duplication of effort.
>
> I introduced the use of the common mxs script on November 2016, soon after
> its creation by Fabio.
>
> But, I dislike the level indirection given by the template of image
> description (the use of this template is good inside board/freescale, but
> not outside).

Not sure if this is a good argument for such change.
diff mbox

Patch

diff --git a/board/olimex/imx233_olinuxino/genimage.cfg b/board/olimex/imx233_olinuxino/genimage.cfg
new file mode 100644
index 0000000000..3f4128960f
--- /dev/null
+++ b/board/olimex/imx233_olinuxino/genimage.cfg
@@ -0,0 +1,37 @@ 
+# We mimic the .sdcard Freescale's MX23/MX28 image format:
+# * u-boot.sb is placed at offset 1M,
+# * a FAT partition at offset 16 MB is containing zImage/uImage and DTB files
+# * a single root filesystem partition is required (ext2, ext3 or ext4)
+#
+
+image boot.vfat {
+	vfat {
+		files = {
+			imx23-olinuxino.dtb, uImage
+		}
+	}
+	size = 16M
+}
+
+image sdcard.img {
+	hdimage {
+	}
+
+	partition u-boot {
+		partition-type = 0x53
+		image = "u-boot.sd"
+		offset = 1M
+		size = 16M
+	}
+
+	partition kernel {
+		partition-type = 0xC
+		bootable = "true"
+		image = "boot.vfat"
+	}
+
+	partition rootfs {
+		partition-type = 0x83
+		image = "rootfs.ext2"
+	}
+}
diff --git a/configs/olimex_imx233_olinuxino_defconfig b/configs/olimex_imx233_olinuxino_defconfig
index 1b35b7448c..e5ce15dea3 100644
--- a/configs/olimex_imx233_olinuxino_defconfig
+++ b/configs/olimex_imx233_olinuxino_defconfig
@@ -48,5 +48,6 @@  BR2_TARGET_UBOOT_FORMAT_SD=y
 BR2_PACKAGE_HOST_DOSFSTOOLS=y
 BR2_PACKAGE_HOST_GENIMAGE=y
 BR2_PACKAGE_HOST_MTOOLS=y
-BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/mxs/post-image.sh"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/olimex/imx233_olinuxino/genimage.cfg"