From: Anton Mikanovich <amikan@ilbers.de>
To: isar-users@googlegroups.com
Cc: Anton Mikanovich <amikan@ilbers.de>
Subject: [PATCH v2 2/7] ubi: Move imager-related defines to image bbclasses
Date: Thu, 14 Apr 2022 21:00:56 +0300 [thread overview]
Message-ID: <20220414180101.3373-3-amikan@ilbers.de> (raw)
In-Reply-To: <20220414180101.3373-1-amikan@ilbers.de>
To be able to use some default deploy paths of kernel, initrd and dtb
in any image move these declarations into image bbclass.
The same done with ubifs and fit image deploy paths moving default
ones to imagetypes bbclass.
Also move template-related variables to imagetypes bbclass because they
are only used for imager.
Signed-off-by: Anton Mikanovich <amikan@ilbers.de>
---
meta-isar/recipes-core/images/isar-image-ubi.bb | 14 --------------
meta/classes/image.bbclass | 6 ++++++
meta/classes/imagetypes.bbclass | 14 ++++++++++++++
3 files changed, 20 insertions(+), 14 deletions(-)
diff --git a/meta-isar/recipes-core/images/isar-image-ubi.bb b/meta-isar/recipes-core/images/isar-image-ubi.bb
index 8c70c1f..b01ecff 100644
--- a/meta-isar/recipes-core/images/isar-image-ubi.bb
+++ b/meta-isar/recipes-core/images/isar-image-ubi.bb
@@ -11,17 +11,3 @@ LICENSE = "gpl-2.0"
LIC_FILES_CHKSUM = "file://${LAYERDIR_core}/licenses/COPYING.GPLv2;md5=751419260aa954499f7abaabaa882bbe"
inherit image
-
-SRC_URI += "file://ubinize.cfg.tmpl \
- file://fitimage.its.tmpl"
-
-TEMPLATE_VARS = "KERNEL_IMG INITRD_IMG DTB_IMG UBIFS_IMG FIT_IMG"
-TEMPLATE_FILES = "ubinize.cfg.tmpl fitimage.its.tmpl"
-
-KERNEL_IMG = "${PP_DEPLOY}/${KERNEL_IMAGE}"
-INITRD_IMG = "${PP_DEPLOY}/${INITRD_IMAGE}"
-# only one dtb file supported, pick the first
-DTB_IMG = "${PP_DEPLOY}/${@(d.getVar('DTB_FILES').split() or [''])[0]}"
-
-UBIFS_IMG = "${PP_DEPLOY}/${IMAGE_FULLNAME}.ubifs"
-FIT_IMG = "${PP_DEPLOY}/${IMAGE_FULLNAME}.fit"
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index e3a64d1..11d2ca9 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -318,6 +318,12 @@ devtmpfs /dev devtmpfs mode=0755,nosuid 0 0
EOF
}
+# Default kernel, initrd and dtb image deploy paths (inside imager)
+KERNEL_IMG = "${PP_DEPLOY}/${KERNEL_IMAGE}"
+INITRD_IMG = "${PP_DEPLOY}/${INITRD_IMAGE}"
+# only one dtb file supported, pick the first
+DTB_IMG = "${PP_DEPLOY}/${@(d.getVar('DTB_FILES').split() or [''])[0]}"
+
do_copy_boot_files[dirs] = "${DEPLOY_DIR_IMAGE}"
do_copy_boot_files[lockfiles] += "${DEPLOY_DIR_IMAGE}/isar.lock"
do_copy_boot_files() {
diff --git a/meta/classes/imagetypes.bbclass b/meta/classes/imagetypes.bbclass
index a31a198..acb3401 100644
--- a/meta/classes/imagetypes.bbclass
+++ b/meta/classes/imagetypes.bbclass
@@ -39,6 +39,13 @@ MKIMAGE_ARGS ??= ""
FIT_IMAGE_SOURCE ??= "fitimage.its"
IMAGER_INSTALL_fit += "u-boot-tools device-tree-compiler"
+IMAGE_SRC_URI_fit = "file://${FIT_IMAGE_SOURCE}.tmpl"
+IMAGE_TEMPLATE_FILES_fit = "${FIT_IMAGE_SOURCE}.tmpl"
+IMAGE_TEMPLATE_VARS_fit = "KERNEL_IMG INITRD_IMG DTB_IMG"
+
+# Default fit image deploy path (inside imager)
+FIT_IMG ?= "${PP_DEPLOY}/${IMAGE_FULLNAME}.fit"
+
IMAGE_CMD_fit() {
if [ ! -e "${WORKDIR}/${FIT_IMAGE_SOURCE}" ]; then
die "FIT_IMAGE_SOURCE does not contain fitimage source file"
@@ -53,6 +60,9 @@ IMAGE_CMD_fit[depends] = "${PN}:do_transform_template"
IMAGER_INSTALL_ubifs += "mtd-utils"
IMAGE_CMD_REQUIRED_ARGS_ubifs = "MKUBIFS_ARGS"
+# Default UBIFS image deploy path (inside imager)
+UBIFS_IMG ?= "${PP_DEPLOY}/${IMAGE_FULLNAME}.ubifs"
+
# glibc bug 23960 https://sourceware.org/bugzilla/show_bug.cgi?id=23960
# should not use QEMU on armhf target with mkfs.ubifs < v2.1.3
python() {
@@ -70,6 +80,10 @@ IMAGER_INSTALL_ubi += "mtd-utils"
IMAGE_CMD_REQUIRED_ARGS_ubi = "UBINIZE_ARGS"
UBINIZE_CFG ??= "ubinize.cfg"
+IMAGE_SRC_URI_ubi = "file://${UBINIZE_CFG}.tmpl"
+IMAGE_TEMPLATE_FILES_ubi = "${UBINIZE_CFG}.tmpl"
+IMAGE_TEMPLATE_VARS_ubi = "KERNEL_IMG INITRD_IMG DTB_IMG UBIFS_IMG FIT_IMG"
+
IMAGE_CMD_ubi() {
if [ ! -e "${WORKDIR}/${UBINIZE_CFG}" ]; then
die "UBINIZE_CFG does not contain ubinize config file."
--
2.17.1
next prev parent reply other threads:[~2022-04-14 18:01 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-14 18:00 [PATCH v2 0/7] Rebuild phyBOARD-Mira UBI image generation Anton Mikanovich
2022-04-14 18:00 ` [PATCH v2 1/7] image: Introduce template support for imagetypes Anton Mikanovich
2022-04-14 18:00 ` Anton Mikanovich [this message]
2022-04-14 18:00 ` [PATCH v2 3/7] ubi: Remove isar-image-ubi Anton Mikanovich
2022-04-14 18:00 ` [PATCH v2 4/7] ubi: Split UBI configs for phyboard-mira and imx6-sabrelite Anton Mikanovich
2022-04-14 18:00 ` [PATCH v2 5/7] conf: Remove machine-specific defines from multiconfig Anton Mikanovich
2022-04-14 18:01 ` [PATCH v2 6/7] meta-isar: Add linux-phy kernel Anton Mikanovich
2022-04-14 18:01 ` [PATCH v2 7/7] meta: Add barebox bootloader support Anton Mikanovich
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=20220414180101.3373-3-amikan@ilbers.de \
--to=amikan@ilbers.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