All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Gonzalez <alex.gonzalez@digi.com>
To: <meta-freescale@yoctoproject.org>
Subject: [3rdparty][PATCH 1/5] classes/image_types_digi: Image types for Digi ConnectCore modules
Date: Tue, 6 Nov 2018 16:08:38 +0100	[thread overview]
Message-ID: <1541516922-22117-2-git-send-email-alex.gonzalez@digi.com> (raw)
In-Reply-To: <1541516922-22117-1-git-send-email-alex.gonzalez@digi.com>

From: Javier Viguera <javier.viguera@digi.com>

This patch adds a new boot.ubifs image type that is programmed into the
boot partition of the NAND based ConnectCore modules.

Signed-off-by: Alex Gonzalez <alex.gonzalez@digi.com>
---
 classes/image_types_digi.bbclass | 51 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 51 insertions(+)
 create mode 100644 classes/image_types_digi.bbclass

diff --git a/classes/image_types_digi.bbclass b/classes/image_types_digi.bbclass
new file mode 100644
index 000000000000..ab2442222712
--- /dev/null
+++ b/classes/image_types_digi.bbclass
@@ -0,0 +1,51 @@
+inherit image_types
+
+do_image_boot_ubifs[depends] += " \
+    mtd-utils-native:do_populate_sysroot \
+    u-boot:do_deploy \
+    virtual/kernel:do_deploy \
+"
+
+IMAGE_CMD_boot.ubifs() {
+	BOOTIMG_FILES_SYMLINK="${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${MACHINE}.bin"
+	if [ -n "${KERNEL_DEVICETREE}" ]; then
+		for DTB in ${KERNEL_DEVICETREE}; do
+			# Remove potential sub-folders
+			DTB="$(basename ${DTB})"
+			if [ -e "${DEPLOY_DIR_IMAGE}/${DTB}" ]; then
+				BOOTIMG_FILES_SYMLINK="${BOOTIMG_FILES_SYMLINK} ${DEPLOY_DIR_IMAGE}/${DTB}"
+			fi
+		done
+	fi
+
+	# Create temporary folder
+	TMP_BOOTDIR="$(mktemp -d ${IMGDEPLOYDIR}/boot.XXXXXX)"
+
+	# Hard-link BOOTIMG_FILES into the temporary folder with the symlink filename
+	for item in ${BOOTIMG_FILES_SYMLINK}; do
+		orig="$(readlink -e ${item})"
+		ln "${orig}" "${TMP_BOOTDIR}/$(basename ${item})"
+	done
+
+	# Hard-link extlinux.conf file if available
+	if [ "${UBOOT_EXTLINUX}" = "1" ]; then
+		mkdir -p ${TMP_BOOTDIR}/${UBOOT_EXTLINUX_INSTALL_DIR}
+		orig="$(readlink -e ${DEPLOY_DIR_IMAGE}/${UBOOT_EXTLINUX_CONF_NAME})"
+		ln "${orig}" "${TMP_BOOTDIR}${UBOOT_EXTLINUX_INSTALL_DIR}/${UBOOT_EXTLINUX_CONF_NAME}"
+	fi
+
+	# Hard-link boot script if available
+	if [ -n "${UBOOT_BOOTSCRIPT}" ]; then
+		orig="$(readlink -e ${DEPLOY_DIR_IMAGE}/${UBOOT_BOOTSCRIPT})"
+		ln "${orig}" "${TMP_BOOTDIR}/${UBOOT_BOOTSCRIPT}"
+	fi
+
+	# Build UBIFS boot image out of temp folder
+	mkfs.ubifs -r "${TMP_BOOTDIR}" -o "${IMGDEPLOYDIR}/${IMAGE_NAME}.boot.ubifs" ${MKUBIFS_BOOT_ARGS}
+
+	# Remove the temporary folder
+	rm -rf ${TMP_BOOTDIR}
+}
+
+# Remove the default ".rootfs." suffix for 'boot.ubifs' images
+do_image_boot_ubifs[imgsuffix] = "."


  reply	other threads:[~2018-11-06 15:23 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-06 15:08 [3rdparty][PATCH 0/5] Add support for ConnectCore 6UL SOM and SBC Express Alex Gonzalez
2018-11-06 15:08 ` Alex Gonzalez [this message]
2018-11-06 15:08 ` [3rdparty][PATCH 2/5] u-boot-digi: Add Digi U-Boot for ConnectCore System-On-Modules Alex Gonzalez
2018-11-10  1:16   ` Otavio Salvador
2018-11-12  8:59     ` Gonzalez, Alex
2018-11-06 15:08 ` [3rdparty][PATCH 3/5] linux-fslc: Add support for the ConnectCore 6UL SoM and SBC Express Alex Gonzalez
2018-11-06 15:08 ` [3rdparty][PATCH 4/5] ccimx6ul: Add machine configuration for ConnectCore 6UL SOM Alex Gonzalez
2018-11-10  1:22   ` Otavio Salvador
2018-11-12  8:58     ` Gonzalez, Alex
2018-11-12 11:53       ` Otavio Salvador
2018-11-06 15:08 ` [3rdparty][PATCH 5/5] ccimx6ulsbcexpress: Add initial board configuration Alex Gonzalez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1541516922-22117-2-git-send-email-alex.gonzalez@digi.com \
    --to=alex.gonzalez@digi.com \
    --cc=meta-freescale@yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.