From: claudius.heine.ext@siemens.com
To: isar-users@googlegroups.com
Cc: Claudius Heine <ch@denx.de>
Subject: [PATCH v4 4/5] meta/classes: added fit-img class for creation of fit images
Date: Tue, 5 Feb 2019 12:59:05 +0100 [thread overview]
Message-ID: <20190205115906.15204-5-claudius.heine.ext@siemens.com> (raw)
In-Reply-To: <20190205115906.15204-1-claudius.heine.ext@siemens.com>
From: Claudius Heine <ch@denx.de>
This class implements a new image type for FIT image creation.
Signed-off-by: Claudius Heine <ch@denx.de>
---
meta/classes/fit-img.bbclass | 49 ++++++++++++++++++++++++++++++++++++
1 file changed, 49 insertions(+)
create mode 100644 meta/classes/fit-img.bbclass
diff --git a/meta/classes/fit-img.bbclass b/meta/classes/fit-img.bbclass
new file mode 100644
index 0000000..013b553
--- /dev/null
+++ b/meta/classes/fit-img.bbclass
@@ -0,0 +1,49 @@
+# This software is a part of ISAR.
+# Copyright (C) Siemens AG, 2019
+#
+# SPDX-License-Identifier: MIT
+
+MKIMAGE_ARGS ??= ""
+
+FIT_IMAGE_SOURCE ??= "fitimage.its"
+
+inherit image
+
+FIT_IMAGE_FILE ?= "${IMAGE_FULLNAME}.fit.img"
+
+IMAGER_INSTALL += "u-boot-tools device-tree-compiler"
+
+PP = "/home/builder/${PN}"
+PP_DEPLOY = "${PP}/deploy"
+PP_ROOTFS = "${PP}/rootfs"
+PP_WORK = "${PP}/work"
+
+BUILDROOT = "${BUILDCHROOT_DIR}${PP}"
+BUILDROOT_DEPLOY = "${BUILDCHROOT_DIR}${PP_DEPLOY}"
+BUILDROOT_ROOTFS = "${BUILDCHROOT_DIR}${PP_ROOTFS}"
+BUILDROOT_WORK = "${BUILDCHROOT_DIR}${PP_WORK}"
+
+do_fit_image[stamp-extra-info] = "${DISTRO}-${MACHINE}"
+
+# Generate fit image
+do_fit_image() {
+ if [ ! -e "${WORKDIR}/${FIT_IMAGE_SOURCE}" ]; then
+ die "FIT_IMAGE_SOURCE does not contain fitimage source file"
+ fi
+
+ rm -f ${DEPLOY_DIR_IMAGE}/${FIT_IMAGE_FILE}
+
+ buildchroot_do_mounts
+
+ sudo flock ${MOUNT_LOCKFILE} -c ' \
+ mkdir -p ${BUILDROOT_DEPLOY} ${BUILDROOT_ROOTFS} ${BUILDROOT_WORK}
+ mount --bind ${DEPLOY_DIR_IMAGE} ${BUILDROOT_DEPLOY}
+ mount --bind ${IMAGE_ROOTFS} ${BUILDROOT_ROOTFS}
+ mount --bind ${WORKDIR} ${BUILDROOT_WORK}
+ '
+
+ # Create fit image using buildchroot tools
+ sudo chroot ${BUILDCHROOT_DIR} /usr/bin/mkimage ${MKIMAGE_ARGS} \
+ -f "${PP_WORK}/${FIT_IMAGE_SOURCE}" "${PP_DEPLOY}/${FIT_IMAGE_FILE}"
+}
+addtask fit_image before do_build after do_copy_boot_files do_install_imager_deps do_unpack do_transform_template
--
2.20.1
next prev parent reply other threads:[~2019-02-05 11:59 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-05 11:59 [PATCH v4 0/5] UBI support claudius.heine.ext
2019-02-05 11:59 ` [PATCH v4 1/5] doc/user: added targz-img to image type list claudius.heine.ext
2019-02-05 11:59 ` [PATCH v4 2/5] meta/classes: added ubifs-img class claudius.heine.ext
2019-02-05 11:59 ` [PATCH v4 3/5] meta/classes: added ubi-img class claudius.heine.ext
2019-02-05 11:59 ` claudius.heine.ext [this message]
2019-02-05 11:59 ` [PATCH v4 5/5] meta-isar: added nand-ubi-demo example to demonstrate UBI use claudius.heine.ext
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=20190205115906.15204-5-claudius.heine.ext@siemens.com \
--to=claudius.heine.ext@siemens.com \
--cc=ch@denx.de \
--cc=isar-users@googlegroups.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox