public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Anton Mikanovich <amikan@ilbers.de>
To: isar-users@googlegroups.com
Cc: Anton Mikanovich <amikan@ilbers.de>
Subject: [PATCH 1/7] ubi: Move default output paths to image class
Date: Wed,  9 Feb 2022 16:54:05 +0300	[thread overview]
Message-ID: <20220209135411.1313521-2-amikan@ilbers.de> (raw)
In-Reply-To: <20220209135411.1313521-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 image type classes.

Signed-off-by: Anton Mikanovich <amikan@ilbers.de>
---
 meta-isar/recipes-core/images/isar-image-ubi.bb | 8 --------
 meta/classes/fit-img.bbclass                    | 5 ++++-
 meta/classes/image.bbclass                      | 6 ++++++
 meta/classes/ubifs-img.bbclass                  | 5 ++++-
 4 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/meta-isar/recipes-core/images/isar-image-ubi.bb b/meta-isar/recipes-core/images/isar-image-ubi.bb
index ef2cf1c..9323822 100644
--- a/meta-isar/recipes-core/images/isar-image-ubi.bb
+++ b/meta-isar/recipes-core/images/isar-image-ubi.bb
@@ -17,11 +17,3 @@ SRC_URI += "file://ubinize.cfg.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}/${UBIFS_IMAGE_FILE}"
-FIT_IMG = "${PP_DEPLOY}/${FIT_IMAGE_FILE}"
diff --git a/meta/classes/fit-img.bbclass b/meta/classes/fit-img.bbclass
index 1ad0c5b..37736f0 100644
--- a/meta/classes/fit-img.bbclass
+++ b/meta/classes/fit-img.bbclass
@@ -10,6 +10,9 @@ FIT_IMAGE_FILE ?= "${IMAGE_FULLNAME}.fit.img"
 
 IMAGER_INSTALL += "u-boot-tools device-tree-compiler"
 
+# Default fit image deploy path (inside imager)
+FIT_IMG ?= "${PP_DEPLOY}/${FIT_IMAGE_FILE}"
+
 # Generate fit image
 do_fit_image() {
     if [ ! -e "${WORKDIR}/${FIT_IMAGE_SOURCE}" ]; then
@@ -22,7 +25,7 @@ do_fit_image() {
 
     # 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}'
+                -f '${PP_WORK}/${FIT_IMAGE_SOURCE}' '${FIT_IMG}'
     sudo chown $(id -u):$(id -g) '${DEPLOY_DIR_IMAGE}/${FIT_IMAGE_FILE}'
 }
 addtask fit_image before do_image after do_image_tools do_transform_template
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 6d77243..4b56e91 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -140,6 +140,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/ubifs-img.bbclass b/meta/classes/ubifs-img.bbclass
index 229eb3e..41814b0 100644
--- a/meta/classes/ubifs-img.bbclass
+++ b/meta/classes/ubifs-img.bbclass
@@ -10,6 +10,9 @@ python() {
 
 UBIFS_IMAGE_FILE ?= "${IMAGE_FULLNAME}.ubifs.img"
 
+# Default UBIFS image deploy path (inside imager)
+UBIFS_IMG ?= "${PP_DEPLOY}/${UBIFS_IMAGE_FILE}"
+
 IMAGER_INSTALL += "mtd-utils"
 
 # glibc bug 23960 https://sourceware.org/bugzilla/show_bug.cgi?id=23960
@@ -24,7 +27,7 @@ do_ubifs_image() {
 
     # Create ubifs image using buildchroot tools
     sudo chroot ${BUILDCHROOT_DIR} /usr/sbin/mkfs.ubifs ${MKUBIFS_ARGS} \
-                -r '${PP_ROOTFS}' '${PP_DEPLOY}/${UBIFS_IMAGE_FILE}'
+                -r '${PP_ROOTFS}' '${UBIFS_IMG}'
     sudo chown $(id -u):$(id -g) '${DEPLOY_DIR_IMAGE}/${UBIFS_IMAGE_FILE}'
 }
 
-- 
2.25.1


  reply	other threads:[~2022-02-09 13:54 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-09 13:54 [PATCH 0/7] Rebuild phyBOARD-Mira UBI image generation Anton Mikanovich
2022-02-09 13:54 ` Anton Mikanovich [this message]
2022-02-09 13:54 ` [PATCH 2/7] ubi: Remove isar-image-ubi Anton Mikanovich
2022-02-09 13:54 ` [PATCH 3/7] ubi: Move tasks reorder into parent task Anton Mikanovich
2022-02-09 13:54 ` [PATCH 4/7] ubi: Split UBI configs for phyboard-mira and imx6-sabrelite Anton Mikanovich
2022-02-09 13:54 ` [PATCH 5/7] conf: Remove machine-specific defines from multiconfig Anton Mikanovich
2022-02-09 13:54 ` [PATCH 6/7] meta-isar: Add linux-phy kernel Anton Mikanovich
2022-02-09 13:54 ` [PATCH 7/7] meta: Add barebox bootloader support Anton Mikanovich
2022-02-09 18:08   ` Jan Kiszka
2022-02-10  7:58     ` Anton Mikanovich
2022-02-10  8:05       ` Jan Kiszka
2022-02-10  8:45         ` Anton Mikanovich
2022-02-10 11:24           ` Jan Kiszka
2022-02-10 14:03             ` Anton Mikanovich
2022-02-10  6:52 ` [PATCH 0/7] Rebuild phyBOARD-Mira UBI image generation Schmidt, Adriaan
2022-02-10  8:12   ` Anton Mikanovich
2022-02-18 16:38   ` Anton Mikanovich
2022-03-31  6:10     ` Schmidt, Adriaan

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=20220209135411.1313521-2-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