* [Buildroot] [PATCH] warpboard: Generate an sdcard image
@ 2016-07-25 21:13 Fabio Estevam
2016-07-25 21:30 ` Thomas Petazzoni
0 siblings, 1 reply; 2+ messages in thread
From: Fabio Estevam @ 2016-07-25 21:13 UTC (permalink / raw)
To: buildroot
From: Fabio Estevam <fabio.estevam@nxp.com>
Generate an sdcard.img image to make it easier the deployment of a
Buildroot image.
Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
---
Hi Thomas,
This patch could be simplified if we could use the patch series from Georges:
http://comments.gmane.org/gmane.comp.lib.uclibc.buildroot/154669
board/freescale/warpboard/genimage.cfg | 41 +++++++++++++++++++++++++++++++++
board/freescale/warpboard/post-image.sh | 16 +++++++++++++
configs/warpboard_defconfig | 10 ++++++++
3 files changed, 67 insertions(+)
create mode 100644 board/freescale/warpboard/genimage.cfg
create mode 100755 board/freescale/warpboard/post-image.sh
diff --git a/board/freescale/warpboard/genimage.cfg b/board/freescale/warpboard/genimage.cfg
new file mode 100644
index 0000000..a22aa2a
--- /dev/null
+++ b/board/freescale/warpboard/genimage.cfg
@@ -0,0 +1,41 @@
+# Minimal SD card image for the Warp board
+#
+# We mimic the .sdcard Freescale's image format for i.MX6SL:
+# * the microSD card must have 1 kB free space at the beginning,
+# * U-Boot is dumped as is,
+# * a FAT partition at offset 8 MB is containing zImage and dtbs,
+# * a single root filesystem partition is required (Ext4 in this case).
+#
+
+image boot.vfat {
+ vfat {
+ files = {
+ "imx6sl-warp.dtb",
+ "zImage"
+ }
+ }
+ size = 16M
+}
+
+image sdcard.img {
+ hdimage {
+ }
+
+ partition u-boot {
+ in-partition-table = "no"
+ image = "u-boot.imx"
+ offset = 1024
+ }
+
+ partition boot {
+ partition-type = 0xC
+ bootable = "true"
+ image = "boot.vfat"
+ offset = 8M
+ }
+
+ partition rootfs {
+ partition-type = 0x83
+ image = "rootfs.ext4"
+ }
+}
diff --git a/board/freescale/warpboard/post-image.sh b/board/freescale/warpboard/post-image.sh
new file mode 100755
index 0000000..8757355
--- /dev/null
+++ b/board/freescale/warpboard/post-image.sh
@@ -0,0 +1,16 @@
+#!/usr/bin/env bash
+
+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 $?
diff --git a/configs/warpboard_defconfig b/configs/warpboard_defconfig
index 8dfe52e..562dc33 100644
--- a/configs/warpboard_defconfig
+++ b/configs/warpboard_defconfig
@@ -37,3 +37,13 @@ BR2_TARGET_UBOOT_FORMAT_IMX=y
# host utility
BR2_PACKAGE_HOST_DFU_UTIL=y
BR2_PACKAGE_HOST_IMX_USB_LOADER=y
+
+# Filesystem
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/warpboard/post-image.sh"
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_ROOTFS_EXT2_4=y
+
+# required tools to create the eMMC image
+BR2_PACKAGE_HOST_DOSFSTOOLS=y
+BR2_PACKAGE_HOST_GENIMAGE=y
+BR2_PACKAGE_HOST_MTOOLS=y
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [Buildroot] [PATCH] warpboard: Generate an sdcard image
2016-07-25 21:13 [Buildroot] [PATCH] warpboard: Generate an sdcard image Fabio Estevam
@ 2016-07-25 21:30 ` Thomas Petazzoni
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni @ 2016-07-25 21:30 UTC (permalink / raw)
To: buildroot
Hello,
On Mon, 25 Jul 2016 18:13:13 -0300, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@nxp.com>
>
> Generate an sdcard.img image to make it easier the deployment of a
> Buildroot image.
>
> Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
"configs/warpboard:" for the commit prefix.
> board/freescale/warpboard/genimage.cfg | 41 +++++++++++++++++++++++++++++++++
> board/freescale/warpboard/post-image.sh | 16 +++++++++++++
> configs/warpboard_defconfig | 10 ++++++++
An update to board/freescale/warpboard/README would be relevant as part
of this commit.
> This patch could be simplified if we could use the patch series from Georges:
> http://comments.gmane.org/gmane.comp.lib.uclibc.buildroot/154669
Yes, noted. I still have this series on my list.
Thanks,
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-07-25 21:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-25 21:13 [Buildroot] [PATCH] warpboard: Generate an sdcard image Fabio Estevam
2016-07-25 21:30 ` Thomas Petazzoni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox