public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Uladzimir Bely <ubely@ilbers.de>
To: isar-users@googlegroups.com
Subject: [RFC PATCH 2/3] linux-distro: Deploy devicetree files
Date: Thu, 13 Jun 2024 07:19:55 +0300	[thread overview]
Message-ID: <20240613043635.21239-3-ubely@ilbers.de> (raw)
In-Reply-To: <20240613043635.21239-1-ubely@ilbers.de>

For targets using distro kernel create .deb that includes devicetree
binaries taken from correspoinding "linux-image-*" distro package.

This .deb is then used to deploy devicetree files outside of image
recipe.

Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
---
 meta/recipes-kernel/linux/linux-distro.bb | 31 +++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/meta/recipes-kernel/linux/linux-distro.bb b/meta/recipes-kernel/linux/linux-distro.bb
index d4f6026d..df858a8a 100644
--- a/meta/recipes-kernel/linux/linux-distro.bb
+++ b/meta/recipes-kernel/linux/linux-distro.bb
@@ -21,3 +21,34 @@ python() {
 }
 
 inherit multiarch
+
+inherit dpkg-raw
+DEBIAN_BUILD_DEPENDS = "linux-image-${KERNEL_NAME}"
+
+do_prepare_build:prepend() {
+    mkdir -p ${D}/usr/lib/${PN}
+}
+
+do_prepare_build:append() {
+    cat <<EOF >> ${S}/debian/rules
+
+override_dh_auto_build:
+EOF
+    for dtb in ${DTB_FILES}; do
+        mkdir -p ${D}/usr/lib/${PN}/$(dirname ${dtb})
+        ppdir=${PP}/image/usr/lib/${PN}/$(dirname ${dtb})
+        cat <<EOF >> ${S}/debian/rules
+	find /usr/lib/linux-image* -path "*${dtb}" -print -exec cp {} ${ppdir} \;
+EOF
+    done
+}
+
+do_deploy[dirs] = "${DEPLOY_DIR_IMAGE}"
+do_deploy() {
+    for dtb in ${DTB_FILES}; do
+        dpkg --fsys-tarfile ${WORKDIR}/${PN}_${CHANGELOG_V}_${PACKAGE_ARCH}.deb | \
+        tar xOf - ./usr/lib/${PN}/${dtb} \
+        > ${DEPLOY_DIR_IMAGE}/${dtb}
+    done
+}
+addtask deploy before do_deploy_deb after do_dpkg_build
-- 
2.44.2


  parent reply	other threads:[~2024-06-13  4:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-13  4:19 [RFC PATCH 0/3] Deploy DTBs with kernel recipe Uladzimir Bely
2024-06-13  4:19 ` [RFC PATCH 1/3] Don't deploy devicetree files with image Uladzimir Bely
2024-06-13  4:19 ` Uladzimir Bely [this message]
2024-06-13  4:19 ` [RFC PATCH 3/3] linux-custom: Deploy devicetree files Uladzimir Bely
2024-06-21  3:20 ` [RFC PATCH 0/3] Deploy DTBs with kernel recipe Liu, Yi

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=20240613043635.21239-3-ubely@ilbers.de \
    --to=ubely@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