All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 0/5] freescale: Factorize SD card generation scripts
@ 2016-07-09  6:39 Georges Savoundararadj
  2016-07-09  6:40 ` [Buildroot] [PATCH 1/5] freescale: genimage: Factorize scripts Georges Savoundararadj
                   ` (5 more replies)
  0 siblings, 6 replies; 19+ messages in thread
From: Georges Savoundararadj @ 2016-07-09  6:39 UTC (permalink / raw)
  To: buildroot

Hello,

At the beginning, I wanted to use the script board/freescale/create-boot-sd.sh
to create an SD card for the imx6sololitevk board. I noticed that script was
not working with sfdisk (>=2.26). I sent a patch to fix it but Thomas Petazzoni
suggested me to use genimage.

I noticed the boards imx6ulevk, imx6sabresd, mx25pdk, mx51evk, mx53loco were
using the same genimage.cfg except for the name of the .dtb blobs.  Therefore,
I created a common genimage template configuration genimage.cfg.template that
is used to create "on-the-fly" a genimage.cfg with the right .dtb file names.
Indeed, I added a common post-image.sh script that is able to guess from
${BR_CONFIG} what files should be copied.

Then, I noticed the boards imx6dlsabreauto, imx6dlsabresd, imx6qsabreauto,
imx6qsabresd, imx6sxsabresd were all using the script
board/freescale/create-boot-sd.sh which does not work with sfdisk (>=2.26). I
removed this script and changed the configuration of these boards in order to
make use of the common genimage template. The layout is actually slightly
different: in the script the offset of the first partition (boot) was +1MB and
is +8MB in the template. I do not think the offset of the first partition  has
an impact on the freescale boards.

I changed the configuration of the imx6sololiteevk in order to use the common
genimage template. That was the reason of these patches.

Also, I tested this serie of patches with the imx6dlsabresd and the
imx6sololiteevk and I saw that U-Boot, in its default environment, was looking
for a zImage. As the zImage is the default kernel image format, I fixed the
configurations in order to eventually get a fully bootable SD card.

These patches may require some tests as I have tested them only for two boards.

Regards,

Georges

Georges Savoundararadj (5):
  freescale: genimage: Factorize scripts
  freescale: genimage: Use the common genimage template
  imx6sololiteevk: use the common genimage template
  imx6sololiteevk: use zImage
  imx6dlsabresd: use zImage

 .../genimage.cfg => common/genimage.cfg.template}  | 13 ++-
 board/freescale/common/post-image.sh               | 71 +++++++++++++++++
 board/freescale/create-boot-sd.sh                  | 93 ----------------------
 board/freescale/imx25pdk/post-image.sh             | 16 ----
 board/freescale/imx25pdk/readme.txt                |  2 +-
 board/freescale/imx51evk/genimage.cfg              | 41 ----------
 board/freescale/imx51evk/post-image.sh             | 16 ----
 board/freescale/imx51evk/readme.txt                |  2 +-
 board/freescale/imx53loco/genimage.cfg             | 42 ----------
 board/freescale/imx53loco/post-image.sh            | 16 ----
 board/freescale/imx6sabre/readme.txt               | 10 ++-
 board/freescale/imx6ulevk/genimage.cfg             | 41 ----------
 board/freescale/imx6ulevk/post-image.sh            | 16 ----
 board/freescale/imx6ulevk/readme.txt               |  2 +-
 board/freescale/imx7dsdb/genimage.cfg              | 41 ----------
 board/freescale/imx7dsdb/post-image.sh             | 16 ----
 board/freescale/imx7dsdb/readme.txt                |  2 +-
 configs/freescale_imx6dlsabreauto_defconfig        |  6 ++
 configs/freescale_imx6dlsabresd_defconfig          |  8 +-
 configs/freescale_imx6qsabreauto_defconfig         |  6 ++
 configs/freescale_imx6qsabresd_defconfig           |  6 ++
 configs/freescale_imx6sololiteevk_defconfig        |  8 +-
 configs/freescale_imx6sxsabresd_defconfig          |  6 ++
 configs/freescale_imx6ulevk_defconfig              |  2 +-
 configs/freescale_imx7dsabresd_defconfig           |  2 +-
 configs/mx25pdk_defconfig                          |  2 +-
 configs/mx51evk_defconfig                          |  2 +-
 configs/mx53loco_defconfig                         |  2 +-
 28 files changed, 129 insertions(+), 361 deletions(-)
 rename board/freescale/{imx25pdk/genimage.cfg => common/genimage.cfg.template} (58%)
 create mode 100755 board/freescale/common/post-image.sh
 delete mode 100755 board/freescale/create-boot-sd.sh
 delete mode 100755 board/freescale/imx25pdk/post-image.sh
 delete mode 100644 board/freescale/imx51evk/genimage.cfg
 delete mode 100755 board/freescale/imx51evk/post-image.sh
 delete mode 100644 board/freescale/imx53loco/genimage.cfg
 delete mode 100755 board/freescale/imx53loco/post-image.sh
 delete mode 100644 board/freescale/imx6ulevk/genimage.cfg
 delete mode 100755 board/freescale/imx6ulevk/post-image.sh
 delete mode 100644 board/freescale/imx7dsdb/genimage.cfg
 delete mode 100755 board/freescale/imx7dsdb/post-image.sh

-- 
2.9.0

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Buildroot] [PATCH 1/5] freescale: genimage: Factorize scripts
  2016-07-09  6:39 [Buildroot] [PATCH 0/5] freescale: Factorize SD card generation scripts Georges Savoundararadj
@ 2016-07-09  6:40 ` Georges Savoundararadj
  2016-07-16 10:41   ` Thomas Petazzoni
  2016-07-09  6:40 ` [Buildroot] [PATCH 2/5] freescale: genimage: Use the common genimage template Georges Savoundararadj
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 19+ messages in thread
From: Georges Savoundararadj @ 2016-07-09  6:40 UTC (permalink / raw)
  To: buildroot

For the boards imx6ulevk, imx6sabresd, mx25pdk, mx51evk, mx53loco:
* Replace genimage.cfg with a common Freescale genimage template named
  genimage.cfg.template because they all use the same layout.  The only
  difference comes from the device tree blobs.
* Replace each post-image.sh script with a generic post-image.sh script
  which is able to generate the right genimage.cfg depending on:
** the image type (zImage or uImage) from BR2_LINUX_KERNEL_UIMAGE
** the device tree blobs from BR2_LINUX_KERNEL_INTREE_DTS_NAME
** the rootfs type (ext2, ext3 or ext4) from BR2_TARGET_ROOTFS_EXT2
* Fix the readme.txt files accordingly

Signed-off-by: Georges Savoundararadj <savoundg@gmail.com>
---
 .../genimage.cfg => common/genimage.cfg.template}  | 13 ++--
 board/freescale/common/post-image.sh               | 71 ++++++++++++++++++++++
 board/freescale/imx25pdk/post-image.sh             | 16 -----
 board/freescale/imx25pdk/readme.txt                |  2 +-
 board/freescale/imx51evk/genimage.cfg              | 41 -------------
 board/freescale/imx51evk/post-image.sh             | 16 -----
 board/freescale/imx51evk/readme.txt                |  2 +-
 board/freescale/imx53loco/genimage.cfg             | 42 -------------
 board/freescale/imx53loco/post-image.sh            | 16 -----
 board/freescale/imx6ulevk/genimage.cfg             | 41 -------------
 board/freescale/imx6ulevk/post-image.sh            | 16 -----
 board/freescale/imx6ulevk/readme.txt               |  2 +-
 board/freescale/imx7dsdb/genimage.cfg              | 41 -------------
 board/freescale/imx7dsdb/post-image.sh             | 16 -----
 board/freescale/imx7dsdb/readme.txt                |  2 +-
 configs/freescale_imx6ulevk_defconfig              |  2 +-
 configs/freescale_imx7dsabresd_defconfig           |  2 +-
 configs/mx25pdk_defconfig                          |  2 +-
 configs/mx51evk_defconfig                          |  2 +-
 configs/mx53loco_defconfig                         |  2 +-
 20 files changed, 86 insertions(+), 261 deletions(-)
 rename board/freescale/{imx25pdk/genimage.cfg => common/genimage.cfg.template} (58%)
 create mode 100755 board/freescale/common/post-image.sh
 delete mode 100755 board/freescale/imx25pdk/post-image.sh
 delete mode 100644 board/freescale/imx51evk/genimage.cfg
 delete mode 100755 board/freescale/imx51evk/post-image.sh
 delete mode 100644 board/freescale/imx53loco/genimage.cfg
 delete mode 100755 board/freescale/imx53loco/post-image.sh
 delete mode 100644 board/freescale/imx6ulevk/genimage.cfg
 delete mode 100755 board/freescale/imx6ulevk/post-image.sh
 delete mode 100644 board/freescale/imx7dsdb/genimage.cfg
 delete mode 100755 board/freescale/imx7dsdb/post-image.sh

diff --git a/board/freescale/imx25pdk/genimage.cfg b/board/freescale/common/genimage.cfg.template
similarity index 58%
rename from board/freescale/imx25pdk/genimage.cfg
rename to board/freescale/common/genimage.cfg.template
index 9386e32..3adb12a 100644
--- a/board/freescale/imx25pdk/genimage.cfg
+++ b/board/freescale/common/genimage.cfg.template
@@ -1,17 +1,16 @@
-# Minimal SD card image for the Freescale's i.MX25 PDK board
+# Minimal SD card image for the Freescale boards Template
 #
-# We mimic the .sdcard Freescale's image format for i.MX25:
+# We mimic the .sdcard Freescale's image format:
 # * the SD 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).
+# * a FAT partition at offset 8 MB is containing zImage/uImage and DTB files
+# * a single root filesystem partition is required (ext2, ext3 or ext4)
 #
 
 image boot.vfat {
   vfat {
     files = {
-      "imx25-pdk.dtb",
-      "zImage"
+      %FILES%
     }
   }
   size = 16M
@@ -36,6 +35,6 @@ image sdcard.img {
 
   partition rootfs {
     partition-type = 0x83
-    image = "rootfs.ext4"
+    image = %ROOTFS%
   }
 }
diff --git a/board/freescale/common/post-image.sh b/board/freescale/common/post-image.sh
new file mode 100755
index 0000000..6b22cf2
--- /dev/null
+++ b/board/freescale/common/post-image.sh
@@ -0,0 +1,71 @@
+#!/usr/bin/env bash
+
+#
+# dtb_list extracts the list of DTB files from BR2_LINUX_KERNEL_INTREE_DTS_NAME
+# in ${BR_CONFIG}, then prints the corresponding list of file names for the
+# genimage configuration file
+#
+dtb_list()
+{
+	local DTB_LIST="$(sed -n 's/^BR2_LINUX_KERNEL_INTREE_DTS_NAME="\([a-z0-9 \-]*\)"$/\1/p' ${BR2_CONFIG})"
+
+	for dt in $DTB_LIST; do
+		echo -n "\"$dt.dtb\", "
+	done
+}
+
+#
+# linux_image extracts the Linux image format from BR2_LINUX_KERNEL_UIMAGE in
+# ${BR_CONFIG}, then prints the corresponding file name for the genimage
+# configuration file
+#
+linux_image()
+{
+	if grep -Eq "^BR2_LINUX_KERNEL_UIMAGE=y$" ${BR2_CONFIG}; then
+		echo "\"uImage\""
+	else
+		echo "\"zImage\""
+	fi
+}
+
+#
+# fstype extracts the type of the filesystem generated from BR_TARGET_ROOTFS_EXT2_*
+# in ${BR_CONFIG}, then prints the extension
+#
+fstype()
+{
+	if grep -Eq "^BR2_TARGET_ROOTFS_EXT2_4=y$" ${BR2_CONFIG}; then
+		echo "ext4"
+	elif grep -Eq "^BR2_TARGET_ROOTFS_EXT2_3=y$" ${BR2_CONFIG}; then
+		echo "ext3"
+	else
+		echo "ext2"
+	fi
+}
+
+main()
+{
+	local FILES="$(dtb_list) $(linux_image)"
+	local ROOTFS="\"rootfs.$(fstype)\""
+	local GENIMAGE_CFG="$(mktemp --suffix genimage.cfg)"
+	local GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
+
+	sed -e "s/%FILES%/${FILES}/" \
+	    -e "s/%ROOTFS%/${ROOTFS}/" \
+		board/freescale/common/genimage.cfg.template > ${GENIMAGE_CFG}
+
+	rm -rf "${GENIMAGE_TMP}"
+
+	genimage \
+		--rootpath "${TARGET_DIR}" \
+		--tmppath "${GENIMAGE_TMP}" \
+		--inputpath "${BINARIES_DIR}" \
+		--outputpath "${BINARIES_DIR}" \
+		--config "${GENIMAGE_CFG}"
+
+	rm -f ${GENIMAGE_CFG}
+
+	exit $?
+}
+
+main $@
diff --git a/board/freescale/imx25pdk/post-image.sh b/board/freescale/imx25pdk/post-image.sh
deleted file mode 100755
index 8757355..0000000
--- a/board/freescale/imx25pdk/post-image.sh
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/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/board/freescale/imx25pdk/readme.txt b/board/freescale/imx25pdk/readme.txt
index a154b99..df7c617 100644
--- a/board/freescale/imx25pdk/readme.txt
+++ b/board/freescale/imx25pdk/readme.txt
@@ -40,7 +40,7 @@ command as root:
 *** WARNING! This will destroy all the card content. Use with care! ***
 
 For details about the medium image layout, see the definition in
-board/freescale/imx25pdk/genimage.cfg.
+board/freescale/common/genimage.cfg.template.
 
 Boot the i.MX25 PDK board
 =========================
diff --git a/board/freescale/imx51evk/genimage.cfg b/board/freescale/imx51evk/genimage.cfg
deleted file mode 100644
index a44ed30..0000000
--- a/board/freescale/imx51evk/genimage.cfg
+++ /dev/null
@@ -1,41 +0,0 @@
-# Minimal SD card image for the Freescale's i.MX51 EVK board
-#
-# We mimic the .sdcard Freescale's image format for i.MX51:
-# * 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 = {
-      "imx51-babbage.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/imx51evk/post-image.sh b/board/freescale/imx51evk/post-image.sh
deleted file mode 100755
index 8757355..0000000
--- a/board/freescale/imx51evk/post-image.sh
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/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/board/freescale/imx51evk/readme.txt b/board/freescale/imx51evk/readme.txt
index 6639a92..bf739fd 100644
--- a/board/freescale/imx51evk/readme.txt
+++ b/board/freescale/imx51evk/readme.txt
@@ -40,7 +40,7 @@ command as root:
 *** WARNING! This will destroy all the card content. Use with care! ***
 
 For details about the medium image layout, see the definition in
-board/freescale/imx51evk/genimage.cfg.
+board/freescale/common/genimage.cfg.template.
 
 Boot the i.MX51 EVK board
 =========================
diff --git a/board/freescale/imx53loco/genimage.cfg b/board/freescale/imx53loco/genimage.cfg
deleted file mode 100644
index b56c168..0000000
--- a/board/freescale/imx53loco/genimage.cfg
+++ /dev/null
@@ -1,42 +0,0 @@
-# Minimal microSD card image for the Freescale's i.MX53 QSB board
-#
-# We mimic the .sdcard Freescale's image format for i.MX53:
-# * 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 = {
-      "imx53-qsb.dtb",
-      "imx53-qsrb.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/imx53loco/post-image.sh b/board/freescale/imx53loco/post-image.sh
deleted file mode 100755
index 8757355..0000000
--- a/board/freescale/imx53loco/post-image.sh
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/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/board/freescale/imx6ulevk/genimage.cfg b/board/freescale/imx6ulevk/genimage.cfg
deleted file mode 100644
index b58193a..0000000
--- a/board/freescale/imx6ulevk/genimage.cfg
+++ /dev/null
@@ -1,41 +0,0 @@
-# Minimal microSD card image for the Freescale's i.MX6UL EVK board
-#
-# We mimic the .sdcard Freescale's image format for i.MX6UL:
-# * 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 = {
-      "imx6ul-14x14-evk.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/imx6ulevk/post-image.sh b/board/freescale/imx6ulevk/post-image.sh
deleted file mode 100755
index 8757355..0000000
--- a/board/freescale/imx6ulevk/post-image.sh
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/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/board/freescale/imx6ulevk/readme.txt b/board/freescale/imx6ulevk/readme.txt
index 462715c..98de277 100644
--- a/board/freescale/imx6ulevk/readme.txt
+++ b/board/freescale/imx6ulevk/readme.txt
@@ -43,7 +43,7 @@ command as root:
 *** WARNING! This will destroy all the card content. Use with care! ***
 
 For details about the medium image layout, see the definition in
-board/freescale/imx6ulevk/genimage.cfg.
+board/freescale/common/genimage.cfg.template.
 
 Boot the i.MX6UL EVK board
 =========================
diff --git a/board/freescale/imx7dsdb/genimage.cfg b/board/freescale/imx7dsdb/genimage.cfg
deleted file mode 100644
index aa6ae9e..0000000
--- a/board/freescale/imx7dsdb/genimage.cfg
+++ /dev/null
@@ -1,41 +0,0 @@
-# Minimal microSD card image for the Freescale's i.MX7D SDB board
-#
-# We mimic the .sdcard Freescale's image format for i.MX7D:
-# * 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 = {
-      "imx7d-sdb.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/imx7dsdb/post-image.sh b/board/freescale/imx7dsdb/post-image.sh
deleted file mode 100755
index 8757355..0000000
--- a/board/freescale/imx7dsdb/post-image.sh
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/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/board/freescale/imx7dsdb/readme.txt b/board/freescale/imx7dsdb/readme.txt
index c72e9a9..9aeeb16 100644
--- a/board/freescale/imx7dsdb/readme.txt
+++ b/board/freescale/imx7dsdb/readme.txt
@@ -40,7 +40,7 @@ command as root:
 *** WARNING! This will destroy all the card content. Use with care! ***
 
 For details about the medium image layout, see the definition in
-board/freescale/imx7dsdb/genimage.cfg.
+board/freescale/common/genimage.cfg.template.
 
 Boot the i.MX7D SDB board
 =========================
diff --git a/configs/freescale_imx6ulevk_defconfig b/configs/freescale_imx6ulevk_defconfig
index 5a18c1d..fb860b5 100644
--- a/configs/freescale_imx6ulevk_defconfig
+++ b/configs/freescale_imx6ulevk_defconfig
@@ -31,6 +31,6 @@ BR2_PACKAGE_HOST_GENIMAGE=y
 BR2_PACKAGE_HOST_MTOOLS=y
 
 # filesystem / image
-BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/imx6ulevk/post-image.sh"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/post-image.sh"
 BR2_TARGET_ROOTFS_EXT2=y
 BR2_TARGET_ROOTFS_EXT2_4=y
diff --git a/configs/freescale_imx7dsabresd_defconfig b/configs/freescale_imx7dsabresd_defconfig
index 6768041..311f8ac 100644
--- a/configs/freescale_imx7dsabresd_defconfig
+++ b/configs/freescale_imx7dsabresd_defconfig
@@ -33,4 +33,4 @@ BR2_TARGET_UBOOT_FORMAT_IMX=y
 BR2_PACKAGE_HOST_DOSFSTOOLS=y
 BR2_PACKAGE_HOST_GENIMAGE=y
 BR2_PACKAGE_HOST_MTOOLS=y
-BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/imx7dsdb/post-image.sh"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/post-image.sh"
diff --git a/configs/mx25pdk_defconfig b/configs/mx25pdk_defconfig
index d682f0f..645fe8a 100644
--- a/configs/mx25pdk_defconfig
+++ b/configs/mx25pdk_defconfig
@@ -14,7 +14,7 @@ BR2_PACKAGE_HOST_GENIMAGE=y
 BR2_PACKAGE_HOST_MTOOLS=y
 
 # Filesystem
-BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/imx25pdk/post-image.sh"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/post-image.sh"
 BR2_TARGET_ROOTFS_EXT2=y
 BR2_TARGET_ROOTFS_EXT2_4=y
 
diff --git a/configs/mx51evk_defconfig b/configs/mx51evk_defconfig
index 0e2682a..aee4d6b 100644
--- a/configs/mx51evk_defconfig
+++ b/configs/mx51evk_defconfig
@@ -17,7 +17,7 @@ BR2_PACKAGE_HOST_GENIMAGE=y
 BR2_PACKAGE_HOST_MTOOLS=y
 
 # Filesystem
-BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/imx51evk/post-image.sh"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/post-image.sh"
 BR2_TARGET_ROOTFS_EXT2=y
 BR2_TARGET_ROOTFS_EXT2_4=y
 
diff --git a/configs/mx53loco_defconfig b/configs/mx53loco_defconfig
index 72389e4..b549bd2 100644
--- a/configs/mx53loco_defconfig
+++ b/configs/mx53loco_defconfig
@@ -17,7 +17,7 @@ BR2_PACKAGE_HOST_GENIMAGE=y
 BR2_PACKAGE_HOST_MTOOLS=y
 
 # Filesystem
-BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/imx53loco/post-image.sh"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/post-image.sh"
 BR2_TARGET_ROOTFS_EXT2=y
 BR2_TARGET_ROOTFS_EXT2_4=y
 
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [Buildroot] [PATCH 2/5] freescale: genimage: Use the common genimage template
  2016-07-09  6:39 [Buildroot] [PATCH 0/5] freescale: Factorize SD card generation scripts Georges Savoundararadj
  2016-07-09  6:40 ` [Buildroot] [PATCH 1/5] freescale: genimage: Factorize scripts Georges Savoundararadj
@ 2016-07-09  6:40 ` Georges Savoundararadj
  2016-07-09  6:40 ` [Buildroot] [PATCH 3/5] imx6sololiteevk: use " Georges Savoundararadj
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 19+ messages in thread
From: Georges Savoundararadj @ 2016-07-09  6:40 UTC (permalink / raw)
  To: buildroot

The boards imx6dlsabreauto, imx6dlsabresd, imx6qsabreauto, imx6qsabresd,
imx6sxsabresd were referring to board/freescale/create-boot-sd.sh for
the sdcard image generation:
* Remove board/freescale/create-boot-sd.sh
* Use the common Freescale genimage template instead.
  The offset of the first partition was 1MB in the script and is
  modified to 8MB in the template.
* Fix the readme.txt file accordingly

Signed-off-by: Georges Savoundararadj <savoundg@gmail.com>
---
 board/freescale/create-boot-sd.sh           | 93 -----------------------------
 board/freescale/imx6sabre/readme.txt        | 10 +++-
 configs/freescale_imx6dlsabreauto_defconfig |  6 ++
 configs/freescale_imx6dlsabresd_defconfig   |  6 ++
 configs/freescale_imx6qsabreauto_defconfig  |  6 ++
 configs/freescale_imx6qsabresd_defconfig    |  6 ++
 configs/freescale_imx6sxsabresd_defconfig   |  6 ++
 7 files changed, 37 insertions(+), 96 deletions(-)
 delete mode 100755 board/freescale/create-boot-sd.sh

diff --git a/board/freescale/create-boot-sd.sh b/board/freescale/create-boot-sd.sh
deleted file mode 100755
index af45115..0000000
--- a/board/freescale/create-boot-sd.sh
+++ /dev/null
@@ -1,93 +0,0 @@
-#!/bin/sh
-
-set -u
-set -e
-
-PROGNAME=$(basename $0)
-
-usage()
-{
-    echo "Create an SD card that boots on an i.MX53/6 board."
-    echo
-    echo "Note: all data on the the card will be completely deleted!"
-    echo "Use with care!"
-    echo "Superuser permissions may be required to write to the device."
-    echo
-    echo "Usage: ${PROGNAME} <sd_block_device>"
-    echo "Arguments:"
-    echo "  <sd_block_device>     The device to be written to"
-    echo
-    echo "Example: ${PROGNAME} /dev/mmcblk0"
-    echo
-}
-
-if [ $# -ne 1 ]; then
-    usage
-    exit 1
-fi
-
-if [ $(id -u) -ne 0 ]; then
-    echo "${PROGNAME} must be run as root"
-    exit 1
-fi
-
-DEV=${1}
-
-# The partition name prefix depends on the device name:
-# - /dev/sde -> /dev/sde1
-# - /dev/mmcblk0 -> /dev/mmcblk0p1
-if echo ${DEV}|grep -q mmcblk ; then
-    PART="p"
-else
-    PART=""
-fi
-
-PART1=${DEV}${PART}1
-PART2=${DEV}${PART}2
-
-# Unmount the partitions if mounted
-umount ${PART1} || true
-umount ${PART2} || true
-
-# First, clear the card
-dd if=/dev/zero of=${DEV} bs=1M count=20
-
-sync
-
-# Partition the card.
-# SD layout for i.MX6 boot:
-# - Bootloader at offset 1024
-# - FAT partition starting at 1MB offset, containing uImage and *.dtb
-# - ext2/3 partition formatted as ext2 or ext3, containing the root filesystem.
-sfdisk ${DEV} <<EOF
-32,480,b
-512,,L
-EOF
-
-sync
-
-# Copy the bootloader@offset 1024
-dd if=output/images/u-boot.imx of=${DEV} obs=512 seek=2
-
-# Prepare a temp dir for mounting partitions
-TMPDIR=$(mktemp -d)
-
-# FAT partition: kernel and DTBs
-mkfs.vfat ${PART1}
-mount ${PART1} ${TMPDIR}
-cp output/images/*Image ${TMPDIR}/
-cp output/images/*.dtb  ${TMPDIR}/ || true
-sync
-umount ${TMPDIR}
-
-# ext2 partition: root filesystem
-mkfs.ext2 ${PART2}
-mount ${PART2} ${TMPDIR}
-tar -C ${TMPDIR}/ -xf output/images/rootfs.tar
-sync
-umount ${TMPDIR}
-
-# Cleanup
-rmdir ${TMPDIR}
-sync
-echo Done
diff --git a/board/freescale/imx6sabre/readme.txt b/board/freescale/imx6sabre/readme.txt
index 6c44e22..e409d8f 100644
--- a/board/freescale/imx6sabre/readme.txt
+++ b/board/freescale/imx6sabre/readme.txt
@@ -62,12 +62,16 @@ To determine the device associated to the SD card have a look in the
 
   cat /proc/partitions
 
-Run the following script as root on your SD card. This will partition the card
-and copy the bootloader, kernel, DTBs and root filesystem as needed.
+Buildroot prepares a bootable "sdcard.img" image in the output/images/
+directory, ready to be dumped on a microSD card. Launch the following
+command as root:
+
+  dd if=./output/images/sdcard.img of=/dev/<your-microsd-device>
 
 *** WARNING! The script will destroy all the card content. Use with care! ***
 
-  ./board/freescale/create-boot-sd.sh <your-sd-device>
+For details about the medium image layout, see the definition in
+board/freescale/common/genimage.cfg.template.
 
 Boot the SABRE board
 ====================
diff --git a/configs/freescale_imx6dlsabreauto_defconfig b/configs/freescale_imx6dlsabreauto_defconfig
index a58ab5d..5a8d4ce 100644
--- a/configs/freescale_imx6dlsabreauto_defconfig
+++ b/configs/freescale_imx6dlsabreauto_defconfig
@@ -23,8 +23,14 @@ BR2_LINUX_KERNEL_DTS_SUPPORT=y
 BR2_LINUX_KERNEL_INTREE_DTS_NAME="imx6dl-sabreauto"
 
 # filesystem
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/post-image.sh"
 BR2_TARGET_ROOTFS_EXT2=y
 
+# required tools to create the microSD image
+BR2_PACKAGE_HOST_DOSFSTOOLS=y
+BR2_PACKAGE_HOST_GENIMAGE=y
+BR2_PACKAGE_HOST_MTOOLS=y
+
 # bootloader
 BR2_TARGET_UBOOT=y
 BR2_TARGET_UBOOT_BOARDNAME="mx6dlsabreauto"
diff --git a/configs/freescale_imx6dlsabresd_defconfig b/configs/freescale_imx6dlsabresd_defconfig
index ecb5f8b..c01bf7a 100644
--- a/configs/freescale_imx6dlsabresd_defconfig
+++ b/configs/freescale_imx6dlsabresd_defconfig
@@ -23,8 +23,14 @@ BR2_LINUX_KERNEL_DTS_SUPPORT=y
 BR2_LINUX_KERNEL_INTREE_DTS_NAME="imx6dl-sabresd"
 
 # filesystem
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/post-image.sh"
 BR2_TARGET_ROOTFS_EXT2=y
 
+# required tools to create the microSD image
+BR2_PACKAGE_HOST_DOSFSTOOLS=y
+BR2_PACKAGE_HOST_GENIMAGE=y
+BR2_PACKAGE_HOST_MTOOLS=y
+
 # bootloader
 BR2_TARGET_UBOOT=y
 BR2_TARGET_UBOOT_BOARDNAME="mx6dlsabresd"
diff --git a/configs/freescale_imx6qsabreauto_defconfig b/configs/freescale_imx6qsabreauto_defconfig
index 6ed33ee..b9a9446 100644
--- a/configs/freescale_imx6qsabreauto_defconfig
+++ b/configs/freescale_imx6qsabreauto_defconfig
@@ -23,8 +23,14 @@ BR2_LINUX_KERNEL_DTS_SUPPORT=y
 BR2_LINUX_KERNEL_INTREE_DTS_NAME="imx6q-sabreauto"
 
 # filesystem
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/post-image.sh"
 BR2_TARGET_ROOTFS_EXT2=y
 
+# required tools to create the microSD image
+BR2_PACKAGE_HOST_DOSFSTOOLS=y
+BR2_PACKAGE_HOST_GENIMAGE=y
+BR2_PACKAGE_HOST_MTOOLS=y
+
 # bootloader
 BR2_TARGET_UBOOT=y
 BR2_TARGET_UBOOT_BOARDNAME="mx6qsabreauto"
diff --git a/configs/freescale_imx6qsabresd_defconfig b/configs/freescale_imx6qsabresd_defconfig
index bd01f05..b7419b0 100644
--- a/configs/freescale_imx6qsabresd_defconfig
+++ b/configs/freescale_imx6qsabresd_defconfig
@@ -23,8 +23,14 @@ BR2_LINUX_KERNEL_DTS_SUPPORT=y
 BR2_LINUX_KERNEL_INTREE_DTS_NAME="imx6q-sabresd"
 
 # filesystem
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/post-image.sh"
 BR2_TARGET_ROOTFS_EXT2=y
 
+# required tools to create the microSD image
+BR2_PACKAGE_HOST_DOSFSTOOLS=y
+BR2_PACKAGE_HOST_GENIMAGE=y
+BR2_PACKAGE_HOST_MTOOLS=y
+
 # bootloader
 BR2_TARGET_UBOOT=y
 BR2_TARGET_UBOOT_BOARDNAME="mx6qsabresd"
diff --git a/configs/freescale_imx6sxsabresd_defconfig b/configs/freescale_imx6sxsabresd_defconfig
index 2519f49..9f8df63 100644
--- a/configs/freescale_imx6sxsabresd_defconfig
+++ b/configs/freescale_imx6sxsabresd_defconfig
@@ -21,8 +21,14 @@ BR2_LINUX_KERNEL_DTS_SUPPORT=y
 BR2_LINUX_KERNEL_INTREE_DTS_NAME="imx6sx-sdb"
 
 # filesystem
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/post-image.sh"
 BR2_TARGET_ROOTFS_EXT2=y
 
+# required tools to create the microSD image
+BR2_PACKAGE_HOST_DOSFSTOOLS=y
+BR2_PACKAGE_HOST_GENIMAGE=y
+BR2_PACKAGE_HOST_MTOOLS=y
+
 # bootloader
 BR2_TARGET_UBOOT=y
 BR2_TARGET_UBOOT_BOARDNAME="mx6sxsabresd"
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [Buildroot] [PATCH 3/5] imx6sololiteevk: use the common genimage template
  2016-07-09  6:39 [Buildroot] [PATCH 0/5] freescale: Factorize SD card generation scripts Georges Savoundararadj
  2016-07-09  6:40 ` [Buildroot] [PATCH 1/5] freescale: genimage: Factorize scripts Georges Savoundararadj
  2016-07-09  6:40 ` [Buildroot] [PATCH 2/5] freescale: genimage: Use the common genimage template Georges Savoundararadj
@ 2016-07-09  6:40 ` Georges Savoundararadj
  2016-07-09  6:40 ` [Buildroot] [PATCH 4/5] imx6sololiteevk: use zImage Georges Savoundararadj
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 19+ messages in thread
From: Georges Savoundararadj @ 2016-07-09  6:40 UTC (permalink / raw)
  To: buildroot

* Generate an sdcard image based on the common Freescale genimage
  template.

Signed-off-by: Georges Savoundararadj <savoundg@gmail.com>
---
 configs/freescale_imx6sololiteevk_defconfig | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/configs/freescale_imx6sololiteevk_defconfig b/configs/freescale_imx6sololiteevk_defconfig
index 18043e8..3827751 100644
--- a/configs/freescale_imx6sololiteevk_defconfig
+++ b/configs/freescale_imx6sololiteevk_defconfig
@@ -20,8 +20,14 @@ BR2_LINUX_KERNEL_DTS_SUPPORT=y
 BR2_LINUX_KERNEL_INTREE_DTS_NAME="imx6sl-evk"
 
 # filesystem
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/post-image.sh"
 BR2_TARGET_ROOTFS_EXT2=y
 
+# required tools to create the microSD image
+BR2_PACKAGE_HOST_DOSFSTOOLS=y
+BR2_PACKAGE_HOST_GENIMAGE=y
+BR2_PACKAGE_HOST_MTOOLS=y
+
 # bootloader
 BR2_TARGET_UBOOT=y
 BR2_TARGET_UBOOT_BOARDNAME="mx6slevk"
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [Buildroot] [PATCH 4/5] imx6sololiteevk: use zImage
  2016-07-09  6:39 [Buildroot] [PATCH 0/5] freescale: Factorize SD card generation scripts Georges Savoundararadj
                   ` (2 preceding siblings ...)
  2016-07-09  6:40 ` [Buildroot] [PATCH 3/5] imx6sololiteevk: use " Georges Savoundararadj
@ 2016-07-09  6:40 ` Georges Savoundararadj
  2016-07-09  6:40 ` [Buildroot] [PATCH 5/5] imx6dlsabresd: " Georges Savoundararadj
  2016-09-07 22:29 ` [Buildroot] [PATCH v2 1/5] freescale: genimage: Factorize scripts Georges Savoundararadj
  5 siblings, 0 replies; 19+ messages in thread
From: Georges Savoundararadj @ 2016-07-09  6:40 UTC (permalink / raw)
  To: buildroot

U-Boot, with the default environment, is looking for a zImage.

Signed-off-by: Georges Savoundararadj <savoundg@gmail.com>
---
 configs/freescale_imx6sololiteevk_defconfig | 2 --
 1 file changed, 2 deletions(-)

diff --git a/configs/freescale_imx6sololiteevk_defconfig b/configs/freescale_imx6sololiteevk_defconfig
index 3827751..fa83f0c 100644
--- a/configs/freescale_imx6sololiteevk_defconfig
+++ b/configs/freescale_imx6sololiteevk_defconfig
@@ -14,8 +14,6 @@ BR2_LINUX_KERNEL_CUSTOM_GIT=y
 BR2_LINUX_KERNEL_CUSTOM_REPO_URL="git://git.freescale.com/imx/linux-2.6-imx.git"
 BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="rel_imx_4.1.15_1.1.0_ga"
 BR2_LINUX_KERNEL_DEFCONFIG="imx_v7"
-BR2_LINUX_KERNEL_UIMAGE=y
-BR2_LINUX_KERNEL_UIMAGE_LOADADDR="0x80008000"
 BR2_LINUX_KERNEL_DTS_SUPPORT=y
 BR2_LINUX_KERNEL_INTREE_DTS_NAME="imx6sl-evk"
 
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [Buildroot] [PATCH 5/5] imx6dlsabresd: use zImage
  2016-07-09  6:39 [Buildroot] [PATCH 0/5] freescale: Factorize SD card generation scripts Georges Savoundararadj
                   ` (3 preceding siblings ...)
  2016-07-09  6:40 ` [Buildroot] [PATCH 4/5] imx6sololiteevk: use zImage Georges Savoundararadj
@ 2016-07-09  6:40 ` Georges Savoundararadj
  2016-09-07 22:29 ` [Buildroot] [PATCH v2 1/5] freescale: genimage: Factorize scripts Georges Savoundararadj
  5 siblings, 0 replies; 19+ messages in thread
From: Georges Savoundararadj @ 2016-07-09  6:40 UTC (permalink / raw)
  To: buildroot

U-Boot, with the default environment, is looking for a zImage.

Signed-off-by: Georges Savoundararadj <savoundg@gmail.com>
---
 configs/freescale_imx6dlsabresd_defconfig | 2 --
 1 file changed, 2 deletions(-)

diff --git a/configs/freescale_imx6dlsabresd_defconfig b/configs/freescale_imx6dlsabresd_defconfig
index c01bf7a..7e42faa 100644
--- a/configs/freescale_imx6dlsabresd_defconfig
+++ b/configs/freescale_imx6dlsabresd_defconfig
@@ -17,8 +17,6 @@ BR2_LINUX_KERNEL_CUSTOM_GIT=y
 BR2_LINUX_KERNEL_CUSTOM_REPO_URL="git://git.freescale.com/imx/linux-2.6-imx.git"
 BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="rel_imx_4.1.15_1.1.0_ga"
 BR2_LINUX_KERNEL_DEFCONFIG="imx_v7"
-BR2_LINUX_KERNEL_UIMAGE=y
-BR2_LINUX_KERNEL_UIMAGE_LOADADDR="0x10008000"
 BR2_LINUX_KERNEL_DTS_SUPPORT=y
 BR2_LINUX_KERNEL_INTREE_DTS_NAME="imx6dl-sabresd"
 
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [Buildroot] [PATCH 1/5] freescale: genimage: Factorize scripts
  2016-07-09  6:40 ` [Buildroot] [PATCH 1/5] freescale: genimage: Factorize scripts Georges Savoundararadj
@ 2016-07-16 10:41   ` Thomas Petazzoni
  2016-07-16 20:36     ` Fabio Estevam
  0 siblings, 1 reply; 19+ messages in thread
From: Thomas Petazzoni @ 2016-07-16 10:41 UTC (permalink / raw)
  To: buildroot

Hello,

On Fri,  8 Jul 2016 23:40:00 -0700, Georges Savoundararadj wrote:
> For the boards imx6ulevk, imx6sabresd, mx25pdk, mx51evk, mx53loco:
> * Replace genimage.cfg with a common Freescale genimage template named
>   genimage.cfg.template because they all use the same layout.  The only
>   difference comes from the device tree blobs.
> * Replace each post-image.sh script with a generic post-image.sh script
>   which is able to generate the right genimage.cfg depending on:
> ** the image type (zImage or uImage) from BR2_LINUX_KERNEL_UIMAGE
> ** the device tree blobs from BR2_LINUX_KERNEL_INTREE_DTS_NAME
> ** the rootfs type (ext2, ext3 or ext4) from BR2_TARGET_ROOTFS_EXT2
> * Fix the readme.txt files accordingly
> 
> Signed-off-by: Georges Savoundararadj <savoundg@gmail.com>

Peter, Yann, Fabio, could you have a look at this patch and let me know
what you think?

On one hand, yes the genimage.cfg files and post-image scripts for the
different freescale boards are very similar, so some factorization
seems to make sense.

On the other hand, the factorization implies a bit of additional
complexity, which is not that nice for defconfigs, that aim at being
simple.

What is your take on this factorization vs. complexity trade-off? I'm
keeping the full patch below so you can have a look.

Thanks,

Thomas

> ---
>  .../genimage.cfg => common/genimage.cfg.template}  | 13 ++--
>  board/freescale/common/post-image.sh               | 71 ++++++++++++++++++++++
>  board/freescale/imx25pdk/post-image.sh             | 16 -----
>  board/freescale/imx25pdk/readme.txt                |  2 +-
>  board/freescale/imx51evk/genimage.cfg              | 41 -------------
>  board/freescale/imx51evk/post-image.sh             | 16 -----
>  board/freescale/imx51evk/readme.txt                |  2 +-
>  board/freescale/imx53loco/genimage.cfg             | 42 -------------
>  board/freescale/imx53loco/post-image.sh            | 16 -----
>  board/freescale/imx6ulevk/genimage.cfg             | 41 -------------
>  board/freescale/imx6ulevk/post-image.sh            | 16 -----
>  board/freescale/imx6ulevk/readme.txt               |  2 +-
>  board/freescale/imx7dsdb/genimage.cfg              | 41 -------------
>  board/freescale/imx7dsdb/post-image.sh             | 16 -----
>  board/freescale/imx7dsdb/readme.txt                |  2 +-
>  configs/freescale_imx6ulevk_defconfig              |  2 +-
>  configs/freescale_imx7dsabresd_defconfig           |  2 +-
>  configs/mx25pdk_defconfig                          |  2 +-
>  configs/mx51evk_defconfig                          |  2 +-
>  configs/mx53loco_defconfig                         |  2 +-
>  20 files changed, 86 insertions(+), 261 deletions(-)
>  rename board/freescale/{imx25pdk/genimage.cfg => common/genimage.cfg.template} (58%)
>  create mode 100755 board/freescale/common/post-image.sh
>  delete mode 100755 board/freescale/imx25pdk/post-image.sh
>  delete mode 100644 board/freescale/imx51evk/genimage.cfg
>  delete mode 100755 board/freescale/imx51evk/post-image.sh
>  delete mode 100644 board/freescale/imx53loco/genimage.cfg
>  delete mode 100755 board/freescale/imx53loco/post-image.sh
>  delete mode 100644 board/freescale/imx6ulevk/genimage.cfg
>  delete mode 100755 board/freescale/imx6ulevk/post-image.sh
>  delete mode 100644 board/freescale/imx7dsdb/genimage.cfg
>  delete mode 100755 board/freescale/imx7dsdb/post-image.sh
> 
> diff --git a/board/freescale/imx25pdk/genimage.cfg b/board/freescale/common/genimage.cfg.template
> similarity index 58%
> rename from board/freescale/imx25pdk/genimage.cfg
> rename to board/freescale/common/genimage.cfg.template
> index 9386e32..3adb12a 100644
> --- a/board/freescale/imx25pdk/genimage.cfg
> +++ b/board/freescale/common/genimage.cfg.template
> @@ -1,17 +1,16 @@
> -# Minimal SD card image for the Freescale's i.MX25 PDK board
> +# Minimal SD card image for the Freescale boards Template
>  #
> -# We mimic the .sdcard Freescale's image format for i.MX25:
> +# We mimic the .sdcard Freescale's image format:
>  # * the SD 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).
> +# * a FAT partition at offset 8 MB is containing zImage/uImage and DTB files
> +# * a single root filesystem partition is required (ext2, ext3 or ext4)
>  #
>  
>  image boot.vfat {
>    vfat {
>      files = {
> -      "imx25-pdk.dtb",
> -      "zImage"
> +      %FILES%
>      }
>    }
>    size = 16M
> @@ -36,6 +35,6 @@ image sdcard.img {
>  
>    partition rootfs {
>      partition-type = 0x83
> -    image = "rootfs.ext4"
> +    image = %ROOTFS%
>    }
>  }
> diff --git a/board/freescale/common/post-image.sh b/board/freescale/common/post-image.sh
> new file mode 100755
> index 0000000..6b22cf2
> --- /dev/null
> +++ b/board/freescale/common/post-image.sh
> @@ -0,0 +1,71 @@
> +#!/usr/bin/env bash
> +
> +#
> +# dtb_list extracts the list of DTB files from BR2_LINUX_KERNEL_INTREE_DTS_NAME
> +# in ${BR_CONFIG}, then prints the corresponding list of file names for the
> +# genimage configuration file
> +#
> +dtb_list()
> +{
> +	local DTB_LIST="$(sed -n 's/^BR2_LINUX_KERNEL_INTREE_DTS_NAME="\([a-z0-9 \-]*\)"$/\1/p' ${BR2_CONFIG})"
> +
> +	for dt in $DTB_LIST; do
> +		echo -n "\"$dt.dtb\", "
> +	done
> +}
> +
> +#
> +# linux_image extracts the Linux image format from BR2_LINUX_KERNEL_UIMAGE in
> +# ${BR_CONFIG}, then prints the corresponding file name for the genimage
> +# configuration file
> +#
> +linux_image()
> +{
> +	if grep -Eq "^BR2_LINUX_KERNEL_UIMAGE=y$" ${BR2_CONFIG}; then
> +		echo "\"uImage\""
> +	else
> +		echo "\"zImage\""
> +	fi
> +}
> +
> +#
> +# fstype extracts the type of the filesystem generated from BR_TARGET_ROOTFS_EXT2_*
> +# in ${BR_CONFIG}, then prints the extension
> +#
> +fstype()
> +{
> +	if grep -Eq "^BR2_TARGET_ROOTFS_EXT2_4=y$" ${BR2_CONFIG}; then
> +		echo "ext4"
> +	elif grep -Eq "^BR2_TARGET_ROOTFS_EXT2_3=y$" ${BR2_CONFIG}; then
> +		echo "ext3"
> +	else
> +		echo "ext2"
> +	fi
> +}
> +
> +main()
> +{
> +	local FILES="$(dtb_list) $(linux_image)"
> +	local ROOTFS="\"rootfs.$(fstype)\""
> +	local GENIMAGE_CFG="$(mktemp --suffix genimage.cfg)"
> +	local GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
> +
> +	sed -e "s/%FILES%/${FILES}/" \
> +	    -e "s/%ROOTFS%/${ROOTFS}/" \
> +		board/freescale/common/genimage.cfg.template > ${GENIMAGE_CFG}
> +
> +	rm -rf "${GENIMAGE_TMP}"
> +
> +	genimage \
> +		--rootpath "${TARGET_DIR}" \
> +		--tmppath "${GENIMAGE_TMP}" \
> +		--inputpath "${BINARIES_DIR}" \
> +		--outputpath "${BINARIES_DIR}" \
> +		--config "${GENIMAGE_CFG}"
> +
> +	rm -f ${GENIMAGE_CFG}
> +
> +	exit $?
> +}
> +
> +main $@
> diff --git a/board/freescale/imx25pdk/post-image.sh b/board/freescale/imx25pdk/post-image.sh
> deleted file mode 100755
> index 8757355..0000000
> --- a/board/freescale/imx25pdk/post-image.sh
> +++ /dev/null
> @@ -1,16 +0,0 @@
> -#!/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/board/freescale/imx25pdk/readme.txt b/board/freescale/imx25pdk/readme.txt
> index a154b99..df7c617 100644
> --- a/board/freescale/imx25pdk/readme.txt
> +++ b/board/freescale/imx25pdk/readme.txt
> @@ -40,7 +40,7 @@ command as root:
>  *** WARNING! This will destroy all the card content. Use with care! ***
>  
>  For details about the medium image layout, see the definition in
> -board/freescale/imx25pdk/genimage.cfg.
> +board/freescale/common/genimage.cfg.template.
>  
>  Boot the i.MX25 PDK board
>  =========================
> diff --git a/board/freescale/imx51evk/genimage.cfg b/board/freescale/imx51evk/genimage.cfg
> deleted file mode 100644
> index a44ed30..0000000
> --- a/board/freescale/imx51evk/genimage.cfg
> +++ /dev/null
> @@ -1,41 +0,0 @@
> -# Minimal SD card image for the Freescale's i.MX51 EVK board
> -#
> -# We mimic the .sdcard Freescale's image format for i.MX51:
> -# * 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 = {
> -      "imx51-babbage.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/imx51evk/post-image.sh b/board/freescale/imx51evk/post-image.sh
> deleted file mode 100755
> index 8757355..0000000
> --- a/board/freescale/imx51evk/post-image.sh
> +++ /dev/null
> @@ -1,16 +0,0 @@
> -#!/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/board/freescale/imx51evk/readme.txt b/board/freescale/imx51evk/readme.txt
> index 6639a92..bf739fd 100644
> --- a/board/freescale/imx51evk/readme.txt
> +++ b/board/freescale/imx51evk/readme.txt
> @@ -40,7 +40,7 @@ command as root:
>  *** WARNING! This will destroy all the card content. Use with care! ***
>  
>  For details about the medium image layout, see the definition in
> -board/freescale/imx51evk/genimage.cfg.
> +board/freescale/common/genimage.cfg.template.
>  
>  Boot the i.MX51 EVK board
>  =========================
> diff --git a/board/freescale/imx53loco/genimage.cfg b/board/freescale/imx53loco/genimage.cfg
> deleted file mode 100644
> index b56c168..0000000
> --- a/board/freescale/imx53loco/genimage.cfg
> +++ /dev/null
> @@ -1,42 +0,0 @@
> -# Minimal microSD card image for the Freescale's i.MX53 QSB board
> -#
> -# We mimic the .sdcard Freescale's image format for i.MX53:
> -# * 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 = {
> -      "imx53-qsb.dtb",
> -      "imx53-qsrb.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/imx53loco/post-image.sh b/board/freescale/imx53loco/post-image.sh
> deleted file mode 100755
> index 8757355..0000000
> --- a/board/freescale/imx53loco/post-image.sh
> +++ /dev/null
> @@ -1,16 +0,0 @@
> -#!/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/board/freescale/imx6ulevk/genimage.cfg b/board/freescale/imx6ulevk/genimage.cfg
> deleted file mode 100644
> index b58193a..0000000
> --- a/board/freescale/imx6ulevk/genimage.cfg
> +++ /dev/null
> @@ -1,41 +0,0 @@
> -# Minimal microSD card image for the Freescale's i.MX6UL EVK board
> -#
> -# We mimic the .sdcard Freescale's image format for i.MX6UL:
> -# * 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 = {
> -      "imx6ul-14x14-evk.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/imx6ulevk/post-image.sh b/board/freescale/imx6ulevk/post-image.sh
> deleted file mode 100755
> index 8757355..0000000
> --- a/board/freescale/imx6ulevk/post-image.sh
> +++ /dev/null
> @@ -1,16 +0,0 @@
> -#!/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/board/freescale/imx6ulevk/readme.txt b/board/freescale/imx6ulevk/readme.txt
> index 462715c..98de277 100644
> --- a/board/freescale/imx6ulevk/readme.txt
> +++ b/board/freescale/imx6ulevk/readme.txt
> @@ -43,7 +43,7 @@ command as root:
>  *** WARNING! This will destroy all the card content. Use with care! ***
>  
>  For details about the medium image layout, see the definition in
> -board/freescale/imx6ulevk/genimage.cfg.
> +board/freescale/common/genimage.cfg.template.
>  
>  Boot the i.MX6UL EVK board
>  =========================
> diff --git a/board/freescale/imx7dsdb/genimage.cfg b/board/freescale/imx7dsdb/genimage.cfg
> deleted file mode 100644
> index aa6ae9e..0000000
> --- a/board/freescale/imx7dsdb/genimage.cfg
> +++ /dev/null
> @@ -1,41 +0,0 @@
> -# Minimal microSD card image for the Freescale's i.MX7D SDB board
> -#
> -# We mimic the .sdcard Freescale's image format for i.MX7D:
> -# * 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 = {
> -      "imx7d-sdb.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/imx7dsdb/post-image.sh b/board/freescale/imx7dsdb/post-image.sh
> deleted file mode 100755
> index 8757355..0000000
> --- a/board/freescale/imx7dsdb/post-image.sh
> +++ /dev/null
> @@ -1,16 +0,0 @@
> -#!/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/board/freescale/imx7dsdb/readme.txt b/board/freescale/imx7dsdb/readme.txt
> index c72e9a9..9aeeb16 100644
> --- a/board/freescale/imx7dsdb/readme.txt
> +++ b/board/freescale/imx7dsdb/readme.txt
> @@ -40,7 +40,7 @@ command as root:
>  *** WARNING! This will destroy all the card content. Use with care! ***
>  
>  For details about the medium image layout, see the definition in
> -board/freescale/imx7dsdb/genimage.cfg.
> +board/freescale/common/genimage.cfg.template.
>  
>  Boot the i.MX7D SDB board
>  =========================
> diff --git a/configs/freescale_imx6ulevk_defconfig b/configs/freescale_imx6ulevk_defconfig
> index 5a18c1d..fb860b5 100644
> --- a/configs/freescale_imx6ulevk_defconfig
> +++ b/configs/freescale_imx6ulevk_defconfig
> @@ -31,6 +31,6 @@ BR2_PACKAGE_HOST_GENIMAGE=y
>  BR2_PACKAGE_HOST_MTOOLS=y
>  
>  # filesystem / image
> -BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/imx6ulevk/post-image.sh"
> +BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/post-image.sh"
>  BR2_TARGET_ROOTFS_EXT2=y
>  BR2_TARGET_ROOTFS_EXT2_4=y
> diff --git a/configs/freescale_imx7dsabresd_defconfig b/configs/freescale_imx7dsabresd_defconfig
> index 6768041..311f8ac 100644
> --- a/configs/freescale_imx7dsabresd_defconfig
> +++ b/configs/freescale_imx7dsabresd_defconfig
> @@ -33,4 +33,4 @@ BR2_TARGET_UBOOT_FORMAT_IMX=y
>  BR2_PACKAGE_HOST_DOSFSTOOLS=y
>  BR2_PACKAGE_HOST_GENIMAGE=y
>  BR2_PACKAGE_HOST_MTOOLS=y
> -BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/imx7dsdb/post-image.sh"
> +BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/post-image.sh"
> diff --git a/configs/mx25pdk_defconfig b/configs/mx25pdk_defconfig
> index d682f0f..645fe8a 100644
> --- a/configs/mx25pdk_defconfig
> +++ b/configs/mx25pdk_defconfig
> @@ -14,7 +14,7 @@ BR2_PACKAGE_HOST_GENIMAGE=y
>  BR2_PACKAGE_HOST_MTOOLS=y
>  
>  # Filesystem
> -BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/imx25pdk/post-image.sh"
> +BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/post-image.sh"
>  BR2_TARGET_ROOTFS_EXT2=y
>  BR2_TARGET_ROOTFS_EXT2_4=y
>  
> diff --git a/configs/mx51evk_defconfig b/configs/mx51evk_defconfig
> index 0e2682a..aee4d6b 100644
> --- a/configs/mx51evk_defconfig
> +++ b/configs/mx51evk_defconfig
> @@ -17,7 +17,7 @@ BR2_PACKAGE_HOST_GENIMAGE=y
>  BR2_PACKAGE_HOST_MTOOLS=y
>  
>  # Filesystem
> -BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/imx51evk/post-image.sh"
> +BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/post-image.sh"
>  BR2_TARGET_ROOTFS_EXT2=y
>  BR2_TARGET_ROOTFS_EXT2_4=y
>  
> diff --git a/configs/mx53loco_defconfig b/configs/mx53loco_defconfig
> index 72389e4..b549bd2 100644
> --- a/configs/mx53loco_defconfig
> +++ b/configs/mx53loco_defconfig
> @@ -17,7 +17,7 @@ BR2_PACKAGE_HOST_GENIMAGE=y
>  BR2_PACKAGE_HOST_MTOOLS=y
>  
>  # Filesystem
> -BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/imx53loco/post-image.sh"
> +BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/post-image.sh"
>  BR2_TARGET_ROOTFS_EXT2=y
>  BR2_TARGET_ROOTFS_EXT2_4=y
>  



-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Buildroot] [PATCH 1/5] freescale: genimage: Factorize scripts
  2016-07-16 10:41   ` Thomas Petazzoni
@ 2016-07-16 20:36     ` Fabio Estevam
  2016-07-20 23:55       ` Fabio Estevam
  0 siblings, 1 reply; 19+ messages in thread
From: Fabio Estevam @ 2016-07-16 20:36 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

On Sat, Jul 16, 2016 at 7:41 AM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:

> Peter, Yann, Fabio, could you have a look at this patch and let me know
> what you think?

I really like this patch as it will make it easier to add new i.mx
boards in Buildroot.

> On one hand, yes the genimage.cfg files and post-image scripts for the
> different freescale boards are very similar, so some factorization
> seems to make sense.
>
> On the other hand, the factorization implies a bit of additional
> complexity, which is not that nice for defconfigs, that aim at being
> simple.

It seems to me that the defconfig complexity did not change after this patch.
They only switched to using the common fsl post-image.sh.

Thanks

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Buildroot] [PATCH 1/5] freescale: genimage: Factorize scripts
  2016-07-16 20:36     ` Fabio Estevam
@ 2016-07-20 23:55       ` Fabio Estevam
  0 siblings, 0 replies; 19+ messages in thread
From: Fabio Estevam @ 2016-07-20 23:55 UTC (permalink / raw)
  To: buildroot

Hi Peter/Yann,

On Sat, Jul 16, 2016 at 5:36 PM, Fabio Estevam <festevam@gmail.com> wrote:
> Hi Thomas,
>
> On Sat, Jul 16, 2016 at 7:41 AM, Thomas Petazzoni
> <thomas.petazzoni@free-electrons.com> wrote:
>
>> Peter, Yann, Fabio, could you have a look at this patch and let me know
>> what you think?
>
> I really like this patch as it will make it easier to add new i.mx
> boards in Buildroot.
>
>> On one hand, yes the genimage.cfg files and post-image scripts for the
>> different freescale boards are very similar, so some factorization
>> seems to make sense.
>>
>> On the other hand, the factorization implies a bit of additional
>> complexity, which is not that nice for defconfigs, that aim at being
>> simple.
>
> It seems to me that the defconfig complexity did not change after this patch.
> They only switched to using the common fsl post-image.sh.

Any comments about this patch? It seems very useful.

Thanks

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Buildroot] [PATCH v2 1/5] freescale: genimage: Factorize scripts
  2016-07-09  6:39 [Buildroot] [PATCH 0/5] freescale: Factorize SD card generation scripts Georges Savoundararadj
                   ` (4 preceding siblings ...)
  2016-07-09  6:40 ` [Buildroot] [PATCH 5/5] imx6dlsabresd: " Georges Savoundararadj
@ 2016-09-07 22:29 ` Georges Savoundararadj
  2016-09-07 22:29   ` [Buildroot] [PATCH v2 2/5] freescale: genimage: Use the common genimage template Georges Savoundararadj
                     ` (4 more replies)
  5 siblings, 5 replies; 19+ messages in thread
From: Georges Savoundararadj @ 2016-09-07 22:29 UTC (permalink / raw)
  To: buildroot

For the boards imx6ulevk, imx6sabresd, mx25pdk, mx51evk, mx53loco,
warpboard:
* Replace genimage.cfg with a common Freescale genimage template named
  genimage.cfg.template because they all use the same layout.  The only
  difference comes from the device tree blobs.
* Replace each post-image.sh script with a generic post-image.sh script
  which is able to generate the right genimage.cfg depending on:
** the image type (zImage or uImage) from BR2_LINUX_KERNEL_UIMAGE
** the device tree blobs from BR2_LINUX_KERNEL_INTREE_DTS_NAME
** the rootfs type (ext2, ext3 or ext4) from BR2_TARGET_ROOTFS_EXT2
* Fix the readme.txt files accordingly

Signed-off-by: Georges Savoundararadj <savoundg@gmail.com>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Peter Korsgaard <peter@korsgaard.com>
Cc: Yann E. MORIN <yann.morin.1998@free.fr>

---
Changes v1 -> v2:
  - Rebase to 565fdbd6641ab2883cb9d6a1a9f8de82a71839b2
  - Add warpboard

Signed-off-by: Georges Savoundararadj <savoundg@gmail.com>
---
 .../genimage.cfg => common/genimage.cfg.template}  | 13 ++--
 board/freescale/common/post-image.sh               | 71 ++++++++++++++++++++++
 board/freescale/imx25pdk/post-image.sh             | 14 -----
 board/freescale/imx25pdk/readme.txt                |  2 +-
 board/freescale/imx51evk/genimage.cfg              | 41 -------------
 board/freescale/imx51evk/post-image.sh             | 14 -----
 board/freescale/imx51evk/readme.txt                |  2 +-
 board/freescale/imx53loco/genimage.cfg             | 42 -------------
 board/freescale/imx53loco/post-image.sh            | 14 -----
 board/freescale/imx6ulevk/genimage.cfg             | 41 -------------
 board/freescale/imx6ulevk/post-image.sh            | 14 -----
 board/freescale/imx6ulevk/readme.txt               |  2 +-
 board/freescale/imx7dsdb/genimage.cfg              | 41 -------------
 board/freescale/imx7dsdb/post-image.sh             | 14 -----
 board/freescale/imx7dsdb/readme.txt                |  2 +-
 board/freescale/warpboard/genimage.cfg             | 41 -------------
 board/freescale/warpboard/post-image.sh            | 14 -----
 configs/freescale_imx6ulevk_defconfig              |  2 +-
 configs/freescale_imx7dsabresd_defconfig           |  2 +-
 configs/mx25pdk_defconfig                          |  2 +-
 configs/mx51evk_defconfig                          |  2 +-
 configs/mx53loco_defconfig                         |  2 +-
 configs/warpboard_defconfig                        |  2 +-
 23 files changed, 87 insertions(+), 307 deletions(-)
 rename board/freescale/{imx25pdk/genimage.cfg => common/genimage.cfg.template} (58%)
 create mode 100755 board/freescale/common/post-image.sh
 delete mode 100755 board/freescale/imx25pdk/post-image.sh
 delete mode 100644 board/freescale/imx51evk/genimage.cfg
 delete mode 100755 board/freescale/imx51evk/post-image.sh
 delete mode 100644 board/freescale/imx53loco/genimage.cfg
 delete mode 100755 board/freescale/imx53loco/post-image.sh
 delete mode 100644 board/freescale/imx6ulevk/genimage.cfg
 delete mode 100755 board/freescale/imx6ulevk/post-image.sh
 delete mode 100644 board/freescale/imx7dsdb/genimage.cfg
 delete mode 100755 board/freescale/imx7dsdb/post-image.sh
 delete mode 100644 board/freescale/warpboard/genimage.cfg
 delete mode 100755 board/freescale/warpboard/post-image.sh

diff --git a/board/freescale/imx25pdk/genimage.cfg b/board/freescale/common/genimage.cfg.template
similarity index 58%
rename from board/freescale/imx25pdk/genimage.cfg
rename to board/freescale/common/genimage.cfg.template
index 9386e32..3adb12a 100644
--- a/board/freescale/imx25pdk/genimage.cfg
+++ b/board/freescale/common/genimage.cfg.template
@@ -1,17 +1,16 @@
-# Minimal SD card image for the Freescale's i.MX25 PDK board
+# Minimal SD card image for the Freescale boards Template
 #
-# We mimic the .sdcard Freescale's image format for i.MX25:
+# We mimic the .sdcard Freescale's image format:
 # * the SD 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).
+# * a FAT partition at offset 8 MB is containing zImage/uImage and DTB files
+# * a single root filesystem partition is required (ext2, ext3 or ext4)
 #
 
 image boot.vfat {
   vfat {
     files = {
-      "imx25-pdk.dtb",
-      "zImage"
+      %FILES%
     }
   }
   size = 16M
@@ -36,6 +35,6 @@ image sdcard.img {
 
   partition rootfs {
     partition-type = 0x83
-    image = "rootfs.ext4"
+    image = %ROOTFS%
   }
 }
diff --git a/board/freescale/common/post-image.sh b/board/freescale/common/post-image.sh
new file mode 100755
index 0000000..6b22cf2
--- /dev/null
+++ b/board/freescale/common/post-image.sh
@@ -0,0 +1,71 @@
+#!/usr/bin/env bash
+
+#
+# dtb_list extracts the list of DTB files from BR2_LINUX_KERNEL_INTREE_DTS_NAME
+# in ${BR_CONFIG}, then prints the corresponding list of file names for the
+# genimage configuration file
+#
+dtb_list()
+{
+	local DTB_LIST="$(sed -n 's/^BR2_LINUX_KERNEL_INTREE_DTS_NAME="\([a-z0-9 \-]*\)"$/\1/p' ${BR2_CONFIG})"
+
+	for dt in $DTB_LIST; do
+		echo -n "\"$dt.dtb\", "
+	done
+}
+
+#
+# linux_image extracts the Linux image format from BR2_LINUX_KERNEL_UIMAGE in
+# ${BR_CONFIG}, then prints the corresponding file name for the genimage
+# configuration file
+#
+linux_image()
+{
+	if grep -Eq "^BR2_LINUX_KERNEL_UIMAGE=y$" ${BR2_CONFIG}; then
+		echo "\"uImage\""
+	else
+		echo "\"zImage\""
+	fi
+}
+
+#
+# fstype extracts the type of the filesystem generated from BR_TARGET_ROOTFS_EXT2_*
+# in ${BR_CONFIG}, then prints the extension
+#
+fstype()
+{
+	if grep -Eq "^BR2_TARGET_ROOTFS_EXT2_4=y$" ${BR2_CONFIG}; then
+		echo "ext4"
+	elif grep -Eq "^BR2_TARGET_ROOTFS_EXT2_3=y$" ${BR2_CONFIG}; then
+		echo "ext3"
+	else
+		echo "ext2"
+	fi
+}
+
+main()
+{
+	local FILES="$(dtb_list) $(linux_image)"
+	local ROOTFS="\"rootfs.$(fstype)\""
+	local GENIMAGE_CFG="$(mktemp --suffix genimage.cfg)"
+	local GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
+
+	sed -e "s/%FILES%/${FILES}/" \
+	    -e "s/%ROOTFS%/${ROOTFS}/" \
+		board/freescale/common/genimage.cfg.template > ${GENIMAGE_CFG}
+
+	rm -rf "${GENIMAGE_TMP}"
+
+	genimage \
+		--rootpath "${TARGET_DIR}" \
+		--tmppath "${GENIMAGE_TMP}" \
+		--inputpath "${BINARIES_DIR}" \
+		--outputpath "${BINARIES_DIR}" \
+		--config "${GENIMAGE_CFG}"
+
+	rm -f ${GENIMAGE_CFG}
+
+	exit $?
+}
+
+main $@
diff --git a/board/freescale/imx25pdk/post-image.sh b/board/freescale/imx25pdk/post-image.sh
deleted file mode 100755
index b4ac460..0000000
--- a/board/freescale/imx25pdk/post-image.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/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}"
diff --git a/board/freescale/imx25pdk/readme.txt b/board/freescale/imx25pdk/readme.txt
index a154b99..df7c617 100644
--- a/board/freescale/imx25pdk/readme.txt
+++ b/board/freescale/imx25pdk/readme.txt
@@ -40,7 +40,7 @@ command as root:
 *** WARNING! This will destroy all the card content. Use with care! ***
 
 For details about the medium image layout, see the definition in
-board/freescale/imx25pdk/genimage.cfg.
+board/freescale/common/genimage.cfg.template.
 
 Boot the i.MX25 PDK board
 =========================
diff --git a/board/freescale/imx51evk/genimage.cfg b/board/freescale/imx51evk/genimage.cfg
deleted file mode 100644
index a44ed30..0000000
--- a/board/freescale/imx51evk/genimage.cfg
+++ /dev/null
@@ -1,41 +0,0 @@
-# Minimal SD card image for the Freescale's i.MX51 EVK board
-#
-# We mimic the .sdcard Freescale's image format for i.MX51:
-# * 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 = {
-      "imx51-babbage.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/imx51evk/post-image.sh b/board/freescale/imx51evk/post-image.sh
deleted file mode 100755
index b4ac460..0000000
--- a/board/freescale/imx51evk/post-image.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/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}"
diff --git a/board/freescale/imx51evk/readme.txt b/board/freescale/imx51evk/readme.txt
index 6639a92..bf739fd 100644
--- a/board/freescale/imx51evk/readme.txt
+++ b/board/freescale/imx51evk/readme.txt
@@ -40,7 +40,7 @@ command as root:
 *** WARNING! This will destroy all the card content. Use with care! ***
 
 For details about the medium image layout, see the definition in
-board/freescale/imx51evk/genimage.cfg.
+board/freescale/common/genimage.cfg.template.
 
 Boot the i.MX51 EVK board
 =========================
diff --git a/board/freescale/imx53loco/genimage.cfg b/board/freescale/imx53loco/genimage.cfg
deleted file mode 100644
index b56c168..0000000
--- a/board/freescale/imx53loco/genimage.cfg
+++ /dev/null
@@ -1,42 +0,0 @@
-# Minimal microSD card image for the Freescale's i.MX53 QSB board
-#
-# We mimic the .sdcard Freescale's image format for i.MX53:
-# * 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 = {
-      "imx53-qsb.dtb",
-      "imx53-qsrb.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/imx53loco/post-image.sh b/board/freescale/imx53loco/post-image.sh
deleted file mode 100755
index b4ac460..0000000
--- a/board/freescale/imx53loco/post-image.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/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}"
diff --git a/board/freescale/imx6ulevk/genimage.cfg b/board/freescale/imx6ulevk/genimage.cfg
deleted file mode 100644
index b58193a..0000000
--- a/board/freescale/imx6ulevk/genimage.cfg
+++ /dev/null
@@ -1,41 +0,0 @@
-# Minimal microSD card image for the Freescale's i.MX6UL EVK board
-#
-# We mimic the .sdcard Freescale's image format for i.MX6UL:
-# * 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 = {
-      "imx6ul-14x14-evk.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/imx6ulevk/post-image.sh b/board/freescale/imx6ulevk/post-image.sh
deleted file mode 100755
index b4ac460..0000000
--- a/board/freescale/imx6ulevk/post-image.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/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}"
diff --git a/board/freescale/imx6ulevk/readme.txt b/board/freescale/imx6ulevk/readme.txt
index 462715c..98de277 100644
--- a/board/freescale/imx6ulevk/readme.txt
+++ b/board/freescale/imx6ulevk/readme.txt
@@ -43,7 +43,7 @@ command as root:
 *** WARNING! This will destroy all the card content. Use with care! ***
 
 For details about the medium image layout, see the definition in
-board/freescale/imx6ulevk/genimage.cfg.
+board/freescale/common/genimage.cfg.template.
 
 Boot the i.MX6UL EVK board
 =========================
diff --git a/board/freescale/imx7dsdb/genimage.cfg b/board/freescale/imx7dsdb/genimage.cfg
deleted file mode 100644
index aa6ae9e..0000000
--- a/board/freescale/imx7dsdb/genimage.cfg
+++ /dev/null
@@ -1,41 +0,0 @@
-# Minimal microSD card image for the Freescale's i.MX7D SDB board
-#
-# We mimic the .sdcard Freescale's image format for i.MX7D:
-# * 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 = {
-      "imx7d-sdb.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/imx7dsdb/post-image.sh b/board/freescale/imx7dsdb/post-image.sh
deleted file mode 100755
index b4ac460..0000000
--- a/board/freescale/imx7dsdb/post-image.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/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}"
diff --git a/board/freescale/imx7dsdb/readme.txt b/board/freescale/imx7dsdb/readme.txt
index c72e9a9..9aeeb16 100644
--- a/board/freescale/imx7dsdb/readme.txt
+++ b/board/freescale/imx7dsdb/readme.txt
@@ -40,7 +40,7 @@ command as root:
 *** WARNING! This will destroy all the card content. Use with care! ***
 
 For details about the medium image layout, see the definition in
-board/freescale/imx7dsdb/genimage.cfg.
+board/freescale/common/genimage.cfg.template.
 
 Boot the i.MX7D SDB board
 =========================
diff --git a/board/freescale/warpboard/genimage.cfg b/board/freescale/warpboard/genimage.cfg
deleted file mode 100644
index a22aa2a..0000000
--- a/board/freescale/warpboard/genimage.cfg
+++ /dev/null
@@ -1,41 +0,0 @@
-# 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
deleted file mode 100755
index b4ac460..0000000
--- a/board/freescale/warpboard/post-image.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/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}"
diff --git a/configs/freescale_imx6ulevk_defconfig b/configs/freescale_imx6ulevk_defconfig
index 5a18c1d..fb860b5 100644
--- a/configs/freescale_imx6ulevk_defconfig
+++ b/configs/freescale_imx6ulevk_defconfig
@@ -31,6 +31,6 @@ BR2_PACKAGE_HOST_GENIMAGE=y
 BR2_PACKAGE_HOST_MTOOLS=y
 
 # filesystem / image
-BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/imx6ulevk/post-image.sh"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/post-image.sh"
 BR2_TARGET_ROOTFS_EXT2=y
 BR2_TARGET_ROOTFS_EXT2_4=y
diff --git a/configs/freescale_imx7dsabresd_defconfig b/configs/freescale_imx7dsabresd_defconfig
index 6768041..311f8ac 100644
--- a/configs/freescale_imx7dsabresd_defconfig
+++ b/configs/freescale_imx7dsabresd_defconfig
@@ -33,4 +33,4 @@ BR2_TARGET_UBOOT_FORMAT_IMX=y
 BR2_PACKAGE_HOST_DOSFSTOOLS=y
 BR2_PACKAGE_HOST_GENIMAGE=y
 BR2_PACKAGE_HOST_MTOOLS=y
-BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/imx7dsdb/post-image.sh"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/post-image.sh"
diff --git a/configs/mx25pdk_defconfig b/configs/mx25pdk_defconfig
index d682f0f..645fe8a 100644
--- a/configs/mx25pdk_defconfig
+++ b/configs/mx25pdk_defconfig
@@ -14,7 +14,7 @@ BR2_PACKAGE_HOST_GENIMAGE=y
 BR2_PACKAGE_HOST_MTOOLS=y
 
 # Filesystem
-BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/imx25pdk/post-image.sh"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/post-image.sh"
 BR2_TARGET_ROOTFS_EXT2=y
 BR2_TARGET_ROOTFS_EXT2_4=y
 
diff --git a/configs/mx51evk_defconfig b/configs/mx51evk_defconfig
index bc72e06..1fca282 100644
--- a/configs/mx51evk_defconfig
+++ b/configs/mx51evk_defconfig
@@ -14,7 +14,7 @@ BR2_PACKAGE_HOST_GENIMAGE=y
 BR2_PACKAGE_HOST_MTOOLS=y
 
 # Filesystem
-BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/imx51evk/post-image.sh"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/post-image.sh"
 BR2_TARGET_ROOTFS_EXT2=y
 BR2_TARGET_ROOTFS_EXT2_4=y
 
diff --git a/configs/mx53loco_defconfig b/configs/mx53loco_defconfig
index 286b719..94ac818 100644
--- a/configs/mx53loco_defconfig
+++ b/configs/mx53loco_defconfig
@@ -14,7 +14,7 @@ BR2_PACKAGE_HOST_GENIMAGE=y
 BR2_PACKAGE_HOST_MTOOLS=y
 
 # Filesystem
-BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/imx53loco/post-image.sh"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/post-image.sh"
 BR2_TARGET_ROOTFS_EXT2=y
 BR2_TARGET_ROOTFS_EXT2_4=y
 
diff --git a/configs/warpboard_defconfig b/configs/warpboard_defconfig
index 19425b3..5e9c051 100644
--- a/configs/warpboard_defconfig
+++ b/configs/warpboard_defconfig
@@ -42,7 +42,7 @@ 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_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/post-image.sh"
 BR2_TARGET_ROOTFS_EXT2=y
 BR2_TARGET_ROOTFS_EXT2_4=y
 
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [Buildroot] [PATCH v2 2/5] freescale: genimage: Use the common genimage template
  2016-09-07 22:29 ` [Buildroot] [PATCH v2 1/5] freescale: genimage: Factorize scripts Georges Savoundararadj
@ 2016-09-07 22:29   ` Georges Savoundararadj
  2016-09-11 21:28     ` Thomas Petazzoni
  2016-09-07 22:29   ` [Buildroot] [PATCH v2 3/5] imx6sololiteevk: use " Georges Savoundararadj
                     ` (3 subsequent siblings)
  4 siblings, 1 reply; 19+ messages in thread
From: Georges Savoundararadj @ 2016-09-07 22:29 UTC (permalink / raw)
  To: buildroot

The boards imx6dlsabreauto, imx6dlsabresd, imx6qsabreauto, imx6qsabresd,
imx6sxsabresd were referring to board/freescale/create-boot-sd.sh for
the sdcard image generation:
* Remove board/freescale/create-boot-sd.sh
* Use the common Freescale genimage template instead.
  The offset of the first partition was 1MB in the script and is
  modified to 8MB in the template.
* Fix the readme.txt file accordingly

Signed-off-by: Georges Savoundararadj <savoundg@gmail.com>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Peter Korsgaard <peter@korsgaard.com>
Cc: Yann E. MORIN <yann.morin.1998@free.fr>

---
Changes v1 -> v2:
  - No change

Signed-off-by: Georges Savoundararadj <savoundg@gmail.com>
---
 board/freescale/create-boot-sd.sh           | 93 -----------------------------
 board/freescale/imx6sabre/readme.txt        | 10 +++-
 configs/freescale_imx6dlsabreauto_defconfig |  6 ++
 configs/freescale_imx6dlsabresd_defconfig   |  6 ++
 configs/freescale_imx6qsabreauto_defconfig  |  6 ++
 configs/freescale_imx6qsabresd_defconfig    |  6 ++
 configs/freescale_imx6sxsabresd_defconfig   |  6 ++
 7 files changed, 37 insertions(+), 96 deletions(-)
 delete mode 100755 board/freescale/create-boot-sd.sh

diff --git a/board/freescale/create-boot-sd.sh b/board/freescale/create-boot-sd.sh
deleted file mode 100755
index af45115..0000000
--- a/board/freescale/create-boot-sd.sh
+++ /dev/null
@@ -1,93 +0,0 @@
-#!/bin/sh
-
-set -u
-set -e
-
-PROGNAME=$(basename $0)
-
-usage()
-{
-    echo "Create an SD card that boots on an i.MX53/6 board."
-    echo
-    echo "Note: all data on the the card will be completely deleted!"
-    echo "Use with care!"
-    echo "Superuser permissions may be required to write to the device."
-    echo
-    echo "Usage: ${PROGNAME} <sd_block_device>"
-    echo "Arguments:"
-    echo "  <sd_block_device>     The device to be written to"
-    echo
-    echo "Example: ${PROGNAME} /dev/mmcblk0"
-    echo
-}
-
-if [ $# -ne 1 ]; then
-    usage
-    exit 1
-fi
-
-if [ $(id -u) -ne 0 ]; then
-    echo "${PROGNAME} must be run as root"
-    exit 1
-fi
-
-DEV=${1}
-
-# The partition name prefix depends on the device name:
-# - /dev/sde -> /dev/sde1
-# - /dev/mmcblk0 -> /dev/mmcblk0p1
-if echo ${DEV}|grep -q mmcblk ; then
-    PART="p"
-else
-    PART=""
-fi
-
-PART1=${DEV}${PART}1
-PART2=${DEV}${PART}2
-
-# Unmount the partitions if mounted
-umount ${PART1} || true
-umount ${PART2} || true
-
-# First, clear the card
-dd if=/dev/zero of=${DEV} bs=1M count=20
-
-sync
-
-# Partition the card.
-# SD layout for i.MX6 boot:
-# - Bootloader at offset 1024
-# - FAT partition starting at 1MB offset, containing uImage and *.dtb
-# - ext2/3 partition formatted as ext2 or ext3, containing the root filesystem.
-sfdisk ${DEV} <<EOF
-32,480,b
-512,,L
-EOF
-
-sync
-
-# Copy the bootloader@offset 1024
-dd if=output/images/u-boot.imx of=${DEV} obs=512 seek=2
-
-# Prepare a temp dir for mounting partitions
-TMPDIR=$(mktemp -d)
-
-# FAT partition: kernel and DTBs
-mkfs.vfat ${PART1}
-mount ${PART1} ${TMPDIR}
-cp output/images/*Image ${TMPDIR}/
-cp output/images/*.dtb  ${TMPDIR}/ || true
-sync
-umount ${TMPDIR}
-
-# ext2 partition: root filesystem
-mkfs.ext2 ${PART2}
-mount ${PART2} ${TMPDIR}
-tar -C ${TMPDIR}/ -xf output/images/rootfs.tar
-sync
-umount ${TMPDIR}
-
-# Cleanup
-rmdir ${TMPDIR}
-sync
-echo Done
diff --git a/board/freescale/imx6sabre/readme.txt b/board/freescale/imx6sabre/readme.txt
index 6c44e22..e409d8f 100644
--- a/board/freescale/imx6sabre/readme.txt
+++ b/board/freescale/imx6sabre/readme.txt
@@ -62,12 +62,16 @@ To determine the device associated to the SD card have a look in the
 
   cat /proc/partitions
 
-Run the following script as root on your SD card. This will partition the card
-and copy the bootloader, kernel, DTBs and root filesystem as needed.
+Buildroot prepares a bootable "sdcard.img" image in the output/images/
+directory, ready to be dumped on a microSD card. Launch the following
+command as root:
+
+  dd if=./output/images/sdcard.img of=/dev/<your-microsd-device>
 
 *** WARNING! The script will destroy all the card content. Use with care! ***
 
-  ./board/freescale/create-boot-sd.sh <your-sd-device>
+For details about the medium image layout, see the definition in
+board/freescale/common/genimage.cfg.template.
 
 Boot the SABRE board
 ====================
diff --git a/configs/freescale_imx6dlsabreauto_defconfig b/configs/freescale_imx6dlsabreauto_defconfig
index a58ab5d..5a8d4ce 100644
--- a/configs/freescale_imx6dlsabreauto_defconfig
+++ b/configs/freescale_imx6dlsabreauto_defconfig
@@ -23,8 +23,14 @@ BR2_LINUX_KERNEL_DTS_SUPPORT=y
 BR2_LINUX_KERNEL_INTREE_DTS_NAME="imx6dl-sabreauto"
 
 # filesystem
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/post-image.sh"
 BR2_TARGET_ROOTFS_EXT2=y
 
+# required tools to create the microSD image
+BR2_PACKAGE_HOST_DOSFSTOOLS=y
+BR2_PACKAGE_HOST_GENIMAGE=y
+BR2_PACKAGE_HOST_MTOOLS=y
+
 # bootloader
 BR2_TARGET_UBOOT=y
 BR2_TARGET_UBOOT_BOARDNAME="mx6dlsabreauto"
diff --git a/configs/freescale_imx6dlsabresd_defconfig b/configs/freescale_imx6dlsabresd_defconfig
index ecb5f8b..c01bf7a 100644
--- a/configs/freescale_imx6dlsabresd_defconfig
+++ b/configs/freescale_imx6dlsabresd_defconfig
@@ -23,8 +23,14 @@ BR2_LINUX_KERNEL_DTS_SUPPORT=y
 BR2_LINUX_KERNEL_INTREE_DTS_NAME="imx6dl-sabresd"
 
 # filesystem
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/post-image.sh"
 BR2_TARGET_ROOTFS_EXT2=y
 
+# required tools to create the microSD image
+BR2_PACKAGE_HOST_DOSFSTOOLS=y
+BR2_PACKAGE_HOST_GENIMAGE=y
+BR2_PACKAGE_HOST_MTOOLS=y
+
 # bootloader
 BR2_TARGET_UBOOT=y
 BR2_TARGET_UBOOT_BOARDNAME="mx6dlsabresd"
diff --git a/configs/freescale_imx6qsabreauto_defconfig b/configs/freescale_imx6qsabreauto_defconfig
index 6ed33ee..b9a9446 100644
--- a/configs/freescale_imx6qsabreauto_defconfig
+++ b/configs/freescale_imx6qsabreauto_defconfig
@@ -23,8 +23,14 @@ BR2_LINUX_KERNEL_DTS_SUPPORT=y
 BR2_LINUX_KERNEL_INTREE_DTS_NAME="imx6q-sabreauto"
 
 # filesystem
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/post-image.sh"
 BR2_TARGET_ROOTFS_EXT2=y
 
+# required tools to create the microSD image
+BR2_PACKAGE_HOST_DOSFSTOOLS=y
+BR2_PACKAGE_HOST_GENIMAGE=y
+BR2_PACKAGE_HOST_MTOOLS=y
+
 # bootloader
 BR2_TARGET_UBOOT=y
 BR2_TARGET_UBOOT_BOARDNAME="mx6qsabreauto"
diff --git a/configs/freescale_imx6qsabresd_defconfig b/configs/freescale_imx6qsabresd_defconfig
index bd01f05..b7419b0 100644
--- a/configs/freescale_imx6qsabresd_defconfig
+++ b/configs/freescale_imx6qsabresd_defconfig
@@ -23,8 +23,14 @@ BR2_LINUX_KERNEL_DTS_SUPPORT=y
 BR2_LINUX_KERNEL_INTREE_DTS_NAME="imx6q-sabresd"
 
 # filesystem
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/post-image.sh"
 BR2_TARGET_ROOTFS_EXT2=y
 
+# required tools to create the microSD image
+BR2_PACKAGE_HOST_DOSFSTOOLS=y
+BR2_PACKAGE_HOST_GENIMAGE=y
+BR2_PACKAGE_HOST_MTOOLS=y
+
 # bootloader
 BR2_TARGET_UBOOT=y
 BR2_TARGET_UBOOT_BOARDNAME="mx6qsabresd"
diff --git a/configs/freescale_imx6sxsabresd_defconfig b/configs/freescale_imx6sxsabresd_defconfig
index 2519f49..9f8df63 100644
--- a/configs/freescale_imx6sxsabresd_defconfig
+++ b/configs/freescale_imx6sxsabresd_defconfig
@@ -21,8 +21,14 @@ BR2_LINUX_KERNEL_DTS_SUPPORT=y
 BR2_LINUX_KERNEL_INTREE_DTS_NAME="imx6sx-sdb"
 
 # filesystem
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/post-image.sh"
 BR2_TARGET_ROOTFS_EXT2=y
 
+# required tools to create the microSD image
+BR2_PACKAGE_HOST_DOSFSTOOLS=y
+BR2_PACKAGE_HOST_GENIMAGE=y
+BR2_PACKAGE_HOST_MTOOLS=y
+
 # bootloader
 BR2_TARGET_UBOOT=y
 BR2_TARGET_UBOOT_BOARDNAME="mx6sxsabresd"
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [Buildroot] [PATCH v2 3/5] imx6sololiteevk: use the common genimage template
  2016-09-07 22:29 ` [Buildroot] [PATCH v2 1/5] freescale: genimage: Factorize scripts Georges Savoundararadj
  2016-09-07 22:29   ` [Buildroot] [PATCH v2 2/5] freescale: genimage: Use the common genimage template Georges Savoundararadj
@ 2016-09-07 22:29   ` Georges Savoundararadj
  2016-09-11 21:28     ` Thomas Petazzoni
  2016-09-07 22:29   ` [Buildroot] [PATCH v2 4/5] imx6sololiteevk: use zImage Georges Savoundararadj
                     ` (2 subsequent siblings)
  4 siblings, 1 reply; 19+ messages in thread
From: Georges Savoundararadj @ 2016-09-07 22:29 UTC (permalink / raw)
  To: buildroot

* Generate an sdcard image based on the common Freescale genimage
  template.

Signed-off-by: Georges Savoundararadj <savoundg@gmail.com>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Peter Korsgaard <peter@korsgaard.com>
Cc: Yann E. MORIN <yann.morin.1998@free.fr>

---
Changes v1 -> v2:
  - No change

Signed-off-by: Georges Savoundararadj <savoundg@gmail.com>
---
 configs/freescale_imx6sololiteevk_defconfig | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/configs/freescale_imx6sololiteevk_defconfig b/configs/freescale_imx6sololiteevk_defconfig
index 18043e8..3827751 100644
--- a/configs/freescale_imx6sololiteevk_defconfig
+++ b/configs/freescale_imx6sololiteevk_defconfig
@@ -20,8 +20,14 @@ BR2_LINUX_KERNEL_DTS_SUPPORT=y
 BR2_LINUX_KERNEL_INTREE_DTS_NAME="imx6sl-evk"
 
 # filesystem
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/post-image.sh"
 BR2_TARGET_ROOTFS_EXT2=y
 
+# required tools to create the microSD image
+BR2_PACKAGE_HOST_DOSFSTOOLS=y
+BR2_PACKAGE_HOST_GENIMAGE=y
+BR2_PACKAGE_HOST_MTOOLS=y
+
 # bootloader
 BR2_TARGET_UBOOT=y
 BR2_TARGET_UBOOT_BOARDNAME="mx6slevk"
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [Buildroot] [PATCH v2 4/5] imx6sololiteevk: use zImage
  2016-09-07 22:29 ` [Buildroot] [PATCH v2 1/5] freescale: genimage: Factorize scripts Georges Savoundararadj
  2016-09-07 22:29   ` [Buildroot] [PATCH v2 2/5] freescale: genimage: Use the common genimage template Georges Savoundararadj
  2016-09-07 22:29   ` [Buildroot] [PATCH v2 3/5] imx6sololiteevk: use " Georges Savoundararadj
@ 2016-09-07 22:29   ` Georges Savoundararadj
  2016-09-11 21:28     ` Thomas Petazzoni
  2016-09-07 22:29   ` [Buildroot] [PATCH v2 5/5] imx6dlsabresd: " Georges Savoundararadj
  2016-09-11 21:27   ` [Buildroot] [PATCH v2 1/5] freescale: genimage: Factorize scripts Thomas Petazzoni
  4 siblings, 1 reply; 19+ messages in thread
From: Georges Savoundararadj @ 2016-09-07 22:29 UTC (permalink / raw)
  To: buildroot

U-Boot, with the default environment, is looking for a zImage.

Signed-off-by: Georges Savoundararadj <savoundg@gmail.com>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Peter Korsgaard <peter@korsgaard.com>
Cc: Yann E. MORIN <yann.morin.1998@free.fr>

---
Changes v1 -> v2:
  - No change

Signed-off-by: Georges Savoundararadj <savoundg@gmail.com>
---
 configs/freescale_imx6sololiteevk_defconfig | 2 --
 1 file changed, 2 deletions(-)

diff --git a/configs/freescale_imx6sololiteevk_defconfig b/configs/freescale_imx6sololiteevk_defconfig
index 3827751..fa83f0c 100644
--- a/configs/freescale_imx6sololiteevk_defconfig
+++ b/configs/freescale_imx6sololiteevk_defconfig
@@ -14,8 +14,6 @@ BR2_LINUX_KERNEL_CUSTOM_GIT=y
 BR2_LINUX_KERNEL_CUSTOM_REPO_URL="git://git.freescale.com/imx/linux-2.6-imx.git"
 BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="rel_imx_4.1.15_1.1.0_ga"
 BR2_LINUX_KERNEL_DEFCONFIG="imx_v7"
-BR2_LINUX_KERNEL_UIMAGE=y
-BR2_LINUX_KERNEL_UIMAGE_LOADADDR="0x80008000"
 BR2_LINUX_KERNEL_DTS_SUPPORT=y
 BR2_LINUX_KERNEL_INTREE_DTS_NAME="imx6sl-evk"
 
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [Buildroot] [PATCH v2 5/5] imx6dlsabresd: use zImage
  2016-09-07 22:29 ` [Buildroot] [PATCH v2 1/5] freescale: genimage: Factorize scripts Georges Savoundararadj
                     ` (2 preceding siblings ...)
  2016-09-07 22:29   ` [Buildroot] [PATCH v2 4/5] imx6sololiteevk: use zImage Georges Savoundararadj
@ 2016-09-07 22:29   ` Georges Savoundararadj
  2016-09-11 21:28     ` Thomas Petazzoni
  2016-09-11 21:27   ` [Buildroot] [PATCH v2 1/5] freescale: genimage: Factorize scripts Thomas Petazzoni
  4 siblings, 1 reply; 19+ messages in thread
From: Georges Savoundararadj @ 2016-09-07 22:29 UTC (permalink / raw)
  To: buildroot

U-Boot, with the default environment, is looking for a zImage.

Signed-off-by: Georges Savoundararadj <savoundg@gmail.com>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Peter Korsgaard <peter@korsgaard.com>
Cc: Yann E. MORIN <yann.morin.1998@free.fr>

---
Changes v1 -> v2:
  - No change

Signed-off-by: Georges Savoundararadj <savoundg@gmail.com>
---
 configs/freescale_imx6dlsabresd_defconfig | 2 --
 1 file changed, 2 deletions(-)

diff --git a/configs/freescale_imx6dlsabresd_defconfig b/configs/freescale_imx6dlsabresd_defconfig
index c01bf7a..7e42faa 100644
--- a/configs/freescale_imx6dlsabresd_defconfig
+++ b/configs/freescale_imx6dlsabresd_defconfig
@@ -17,8 +17,6 @@ BR2_LINUX_KERNEL_CUSTOM_GIT=y
 BR2_LINUX_KERNEL_CUSTOM_REPO_URL="git://git.freescale.com/imx/linux-2.6-imx.git"
 BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="rel_imx_4.1.15_1.1.0_ga"
 BR2_LINUX_KERNEL_DEFCONFIG="imx_v7"
-BR2_LINUX_KERNEL_UIMAGE=y
-BR2_LINUX_KERNEL_UIMAGE_LOADADDR="0x10008000"
 BR2_LINUX_KERNEL_DTS_SUPPORT=y
 BR2_LINUX_KERNEL_INTREE_DTS_NAME="imx6dl-sabresd"
 
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [Buildroot] [PATCH v2 1/5] freescale: genimage: Factorize scripts
  2016-09-07 22:29 ` [Buildroot] [PATCH v2 1/5] freescale: genimage: Factorize scripts Georges Savoundararadj
                     ` (3 preceding siblings ...)
  2016-09-07 22:29   ` [Buildroot] [PATCH v2 5/5] imx6dlsabresd: " Georges Savoundararadj
@ 2016-09-11 21:27   ` Thomas Petazzoni
  4 siblings, 0 replies; 19+ messages in thread
From: Thomas Petazzoni @ 2016-09-11 21:27 UTC (permalink / raw)
  To: buildroot

Hello,

On Wed,  7 Sep 2016 15:29:08 -0700, Georges Savoundararadj wrote:
> For the boards imx6ulevk, imx6sabresd, mx25pdk, mx51evk, mx53loco,
> warpboard:
> * Replace genimage.cfg with a common Freescale genimage template named
>   genimage.cfg.template because they all use the same layout.  The only
>   difference comes from the device tree blobs.
> * Replace each post-image.sh script with a generic post-image.sh script
>   which is able to generate the right genimage.cfg depending on:
> ** the image type (zImage or uImage) from BR2_LINUX_KERNEL_UIMAGE
> ** the device tree blobs from BR2_LINUX_KERNEL_INTREE_DTS_NAME
> ** the rootfs type (ext2, ext3 or ext4) from BR2_TARGET_ROOTFS_EXT2

This point was not needed: rootfs.ext2 is always the correct image.
Despite its name, it might be an ext2 image, an ext3 image or an ext4
image depending on the configuration. rootfs.ext3 and rootfs.ext4 are
just symbolic links to rootfs.ext2.

So I've dropped the handling of this aspect, and applied your patch.

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Buildroot] [PATCH v2 2/5] freescale: genimage: Use the common genimage template
  2016-09-07 22:29   ` [Buildroot] [PATCH v2 2/5] freescale: genimage: Use the common genimage template Georges Savoundararadj
@ 2016-09-11 21:28     ` Thomas Petazzoni
  0 siblings, 0 replies; 19+ messages in thread
From: Thomas Petazzoni @ 2016-09-11 21:28 UTC (permalink / raw)
  To: buildroot

Hello,

On Wed,  7 Sep 2016 15:29:09 -0700, Georges Savoundararadj wrote:
> The boards imx6dlsabreauto, imx6dlsabresd, imx6qsabreauto, imx6qsabresd,
> imx6sxsabresd were referring to board/freescale/create-boot-sd.sh for
> the sdcard image generation:
> * Remove board/freescale/create-boot-sd.sh
> * Use the common Freescale genimage template instead.
>   The offset of the first partition was 1MB in the script and is
>   modified to 8MB in the template.
> * Fix the readme.txt file accordingly
> 
> Signed-off-by: Georges Savoundararadj <savoundg@gmail.com>
> Cc: Fabio Estevam <festevam@gmail.com>
> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> Cc: Peter Korsgaard <peter@korsgaard.com>
> Cc: Yann E. MORIN <yann.morin.1998@free.fr>
> 
> ---
> Changes v1 -> v2:
>   - No change

Applied to master, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Buildroot] [PATCH v2 3/5] imx6sololiteevk: use the common genimage template
  2016-09-07 22:29   ` [Buildroot] [PATCH v2 3/5] imx6sololiteevk: use " Georges Savoundararadj
@ 2016-09-11 21:28     ` Thomas Petazzoni
  0 siblings, 0 replies; 19+ messages in thread
From: Thomas Petazzoni @ 2016-09-11 21:28 UTC (permalink / raw)
  To: buildroot

Hello,

On Wed,  7 Sep 2016 15:29:10 -0700, Georges Savoundararadj wrote:
> * Generate an sdcard image based on the common Freescale genimage
>   template.
> 
> Signed-off-by: Georges Savoundararadj <savoundg@gmail.com>
> Cc: Fabio Estevam <festevam@gmail.com>
> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> Cc: Peter Korsgaard <peter@korsgaard.com>
> Cc: Yann E. MORIN <yann.morin.1998@free.fr>
> 
> ---
> Changes v1 -> v2:
>   - No change

Applied to master, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Buildroot] [PATCH v2 4/5] imx6sololiteevk: use zImage
  2016-09-07 22:29   ` [Buildroot] [PATCH v2 4/5] imx6sololiteevk: use zImage Georges Savoundararadj
@ 2016-09-11 21:28     ` Thomas Petazzoni
  0 siblings, 0 replies; 19+ messages in thread
From: Thomas Petazzoni @ 2016-09-11 21:28 UTC (permalink / raw)
  To: buildroot

Hello,

On Wed,  7 Sep 2016 15:29:11 -0700, Georges Savoundararadj wrote:
> U-Boot, with the default environment, is looking for a zImage.
> 
> Signed-off-by: Georges Savoundararadj <savoundg@gmail.com>
> Cc: Fabio Estevam <festevam@gmail.com>
> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> Cc: Peter Korsgaard <peter@korsgaard.com>
> Cc: Yann E. MORIN <yann.morin.1998@free.fr>
> 
> ---
> Changes v1 -> v2:
>   - No change

Applied to master, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Buildroot] [PATCH v2 5/5] imx6dlsabresd: use zImage
  2016-09-07 22:29   ` [Buildroot] [PATCH v2 5/5] imx6dlsabresd: " Georges Savoundararadj
@ 2016-09-11 21:28     ` Thomas Petazzoni
  0 siblings, 0 replies; 19+ messages in thread
From: Thomas Petazzoni @ 2016-09-11 21:28 UTC (permalink / raw)
  To: buildroot

Hello,

On Wed,  7 Sep 2016 15:29:12 -0700, Georges Savoundararadj wrote:
> U-Boot, with the default environment, is looking for a zImage.
> 
> Signed-off-by: Georges Savoundararadj <savoundg@gmail.com>
> Cc: Fabio Estevam <festevam@gmail.com>
> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> Cc: Peter Korsgaard <peter@korsgaard.com>
> Cc: Yann E. MORIN <yann.morin.1998@free.fr>
> 
> ---
> Changes v1 -> v2:
>   - No change

Applied to master, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2016-09-11 21:28 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-09  6:39 [Buildroot] [PATCH 0/5] freescale: Factorize SD card generation scripts Georges Savoundararadj
2016-07-09  6:40 ` [Buildroot] [PATCH 1/5] freescale: genimage: Factorize scripts Georges Savoundararadj
2016-07-16 10:41   ` Thomas Petazzoni
2016-07-16 20:36     ` Fabio Estevam
2016-07-20 23:55       ` Fabio Estevam
2016-07-09  6:40 ` [Buildroot] [PATCH 2/5] freescale: genimage: Use the common genimage template Georges Savoundararadj
2016-07-09  6:40 ` [Buildroot] [PATCH 3/5] imx6sololiteevk: use " Georges Savoundararadj
2016-07-09  6:40 ` [Buildroot] [PATCH 4/5] imx6sololiteevk: use zImage Georges Savoundararadj
2016-07-09  6:40 ` [Buildroot] [PATCH 5/5] imx6dlsabresd: " Georges Savoundararadj
2016-09-07 22:29 ` [Buildroot] [PATCH v2 1/5] freescale: genimage: Factorize scripts Georges Savoundararadj
2016-09-07 22:29   ` [Buildroot] [PATCH v2 2/5] freescale: genimage: Use the common genimage template Georges Savoundararadj
2016-09-11 21:28     ` Thomas Petazzoni
2016-09-07 22:29   ` [Buildroot] [PATCH v2 3/5] imx6sololiteevk: use " Georges Savoundararadj
2016-09-11 21:28     ` Thomas Petazzoni
2016-09-07 22:29   ` [Buildroot] [PATCH v2 4/5] imx6sololiteevk: use zImage Georges Savoundararadj
2016-09-11 21:28     ` Thomas Petazzoni
2016-09-07 22:29   ` [Buildroot] [PATCH v2 5/5] imx6dlsabresd: " Georges Savoundararadj
2016-09-11 21:28     ` Thomas Petazzoni
2016-09-11 21:27   ` [Buildroot] [PATCH v2 1/5] freescale: genimage: Factorize scripts Thomas Petazzoni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.