From: Anton Mikanovich <amikan@ilbers.de>
To: isar-users@googlegroups.com
Cc: adriaan.schmidt@siemens.com, Anton Mikanovich <amikan@ilbers.de>
Subject: [PATCH v3 2/7] ubi: Move imager-related defines to image bbclasses
Date: Wed, 4 May 2022 08:41:24 +0300 [thread overview]
Message-ID: <20220504054129.15218-3-amikan@ilbers.de> (raw)
In-Reply-To: <20220504054129.15218-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 0246ad3..aa6c510 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -328,6 +328,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 07ad0cd..2838c96 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
THIS_ISAR_CROSS_COMPILE := "${ISAR_CROSS_COMPILE}"
@@ -68,6 +78,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-05-04 5:41 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-04 5:41 [PATCH v3 0/7] Rebuild phyBOARD-Mira UBI image generation Anton Mikanovich
2022-05-04 5:41 ` [PATCH v3 1/7] image: Introduce template support for imagetypes Anton Mikanovich
2022-05-04 5:41 ` Anton Mikanovich [this message]
2022-05-04 5:41 ` [PATCH v3 3/7] ubi: Remove isar-image-ubi Anton Mikanovich
2022-05-04 5:41 ` [PATCH v3 4/7] ubi: Split UBI configs for phyboard-mira and imx6-sabrelite Anton Mikanovich
2022-05-04 5:41 ` [PATCH v3 5/7] conf: Remove machine-specific defines from multiconfig Anton Mikanovich
2022-05-04 5:41 ` [PATCH v3 6/7] meta-isar: Add linux-phy kernel Anton Mikanovich
2022-05-04 5:41 ` [PATCH v3 7/7] meta: Add barebox bootloader support Anton Mikanovich
2022-05-16 9:31 ` [PATCH v3 0/7] Rebuild phyBOARD-Mira UBI image generation 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=20220504054129.15218-3-amikan@ilbers.de \
--to=amikan@ilbers.de \
--cc=adriaan.schmidt@siemens.com \
--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