* [RFC PATCH 0/3] Deploy DTBs with kernel recipe
@ 2024-06-13 4:19 Uladzimir Bely
2024-06-13 4:19 ` [RFC PATCH 1/3] Don't deploy devicetree files with image Uladzimir Bely
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Uladzimir Bely @ 2024-06-13 4:19 UTC (permalink / raw)
To: isar-users
Image task "do_copy_boot_files" is used to deploy kernel, initrd and
devicetree binaries to deploy directory.
When different images for the same target are built (e.g., "-base" and
"-debug") in parallel, this causes issues with DTB deployment since
they have no any image name specific stuff in the path, unlike kernel
and initrd.
Here we make kernel recipes (that are original source of these files)
responcible for DTB deployment.
Related topics on maillist:
https://groups.google.com/g/isar-users/c/4BRDM02xC40
https://groups.google.com/g/isar-users/c/qAnjahjjfsw
https://groups.google.com/g/isar-users/c/ZMD4XY4dKWQ
https://groups.google.com/g/isar-users/c/PSGU_AcdPZ8
https://groups.google.com/g/isar-users/c/Va0Ue-ISYeA
To fix the case when different distro use same namings for DTB, this
patchset should be merged with "[PATCH] Fix do_copy_boot_files error":
https://groups.google.com/g/isar-users/c/Va0Ue-ISYeA
Uladzimir Bely (3):
Don't deploy devicetree files with image
linux-distro: Deploy devicetree files
linux-custom: Deploy devicetree files
meta/classes/image.bbclass | 11 --------
meta/recipes-kernel/linux/linux-custom.inc | 13 +++++++++
meta/recipes-kernel/linux/linux-distro.bb | 31 ++++++++++++++++++++++
3 files changed, 44 insertions(+), 11 deletions(-)
--
2.44.2
^ permalink raw reply [flat|nested] 5+ messages in thread
* [RFC PATCH 1/3] Don't deploy devicetree files with image
2024-06-13 4:19 [RFC PATCH 0/3] Deploy DTBs with kernel recipe Uladzimir Bely
@ 2024-06-13 4:19 ` Uladzimir Bely
2024-06-13 4:19 ` [RFC PATCH 2/3] linux-distro: Deploy devicetree files Uladzimir Bely
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Uladzimir Bely @ 2024-06-13 4:19 UTC (permalink / raw)
To: isar-users
Task do_copy_boot_files deploy device tree files to the same location
for different images (e.g. -base or -debug). This causes build issue.
Stop deploying devicetree files here and let kernel recipe care about
deployment.
Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
---
meta/classes/image.bbclass | 11 -----------
1 file changed, 11 deletions(-)
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index ff039438..bf669953 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -351,17 +351,6 @@ do_copy_boot_files() {
cp -f "$initrd" '${DEPLOYDIR}/${INITRD_DEPLOY_FILE}'
fi
fi
-
- for file in ${DTB_FILES}; do
- dtb="$(find '${IMAGE_ROOTFS}/usr/lib' -type f \
- -iwholename '*linux-image-*/'${file} | head -1)"
-
- if [ -z "$dtb" -o ! -e "$dtb" ]; then
- die "${file} not found"
- fi
-
- cp -f "$dtb" "${DEPLOYDIR}/"
- done
}
addtask copy_boot_files before do_rootfs_postprocess after do_rootfs_install
--
2.44.2
^ permalink raw reply [flat|nested] 5+ messages in thread
* [RFC PATCH 2/3] linux-distro: Deploy devicetree files
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
2024-06-13 4:19 ` [RFC PATCH 3/3] linux-custom: " Uladzimir Bely
2024-06-21 3:20 ` [RFC PATCH 0/3] Deploy DTBs with kernel recipe Liu, Yi
3 siblings, 0 replies; 5+ messages in thread
From: Uladzimir Bely @ 2024-06-13 4:19 UTC (permalink / raw)
To: isar-users
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* [RFC PATCH 3/3] linux-custom: Deploy devicetree files
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 ` [RFC PATCH 2/3] linux-distro: Deploy devicetree files Uladzimir Bely
@ 2024-06-13 4:19 ` Uladzimir Bely
2024-06-21 3:20 ` [RFC PATCH 0/3] Deploy DTBs with kernel recipe Liu, Yi
3 siblings, 0 replies; 5+ messages in thread
From: Uladzimir Bely @ 2024-06-13 4:19 UTC (permalink / raw)
To: isar-users
Deploy devicetree files with the custom kernel package instead of
using image recipe.
Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
---
meta/recipes-kernel/linux/linux-custom.inc | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/meta/recipes-kernel/linux/linux-custom.inc b/meta/recipes-kernel/linux/linux-custom.inc
index 647f09dd..c45dad4b 100644
--- a/meta/recipes-kernel/linux/linux-custom.inc
+++ b/meta/recipes-kernel/linux/linux-custom.inc
@@ -278,3 +278,16 @@ EOF
do_dpkg_source:prepend() {
dpkg_configure_kernel
}
+
+do_deploy[dirs] = "${DEPLOY_DIR_IMAGE}"
+do_deploy[cleandirs] = "${WORKDIR}/deploy"
+do_deploy() {
+ dpkg --fsys-tarfile ${WORKDIR}/linux-image-${KERNEL_NAME}_${CHANGELOG_V}_${PACKAGE_ARCH}.deb | \
+ tar --wildcards --extract --directory ${WORKDIR}/deploy ./usr/lib/linux-image-*
+ for dtb in ${DTB_FILES}; do
+ mkdir -p ${DEPLOY_DIR_IMAGE}/$(dirname ${dtb})
+ find ${WORKDIR}/deploy/usr/lib/linux-image* -path "*${dtb}" -print \
+ -exec cp {} ${DEPLOY_DIR_IMAGE}/${dtb} \;
+ done
+}
+addtask deploy before do_deploy_deb after do_dpkg_build
--
2.44.2
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [RFC PATCH 0/3] Deploy DTBs with kernel recipe
2024-06-13 4:19 [RFC PATCH 0/3] Deploy DTBs with kernel recipe Uladzimir Bely
` (2 preceding siblings ...)
2024-06-13 4:19 ` [RFC PATCH 3/3] linux-custom: " Uladzimir Bely
@ 2024-06-21 3:20 ` Liu, Yi
3 siblings, 0 replies; 5+ messages in thread
From: Liu, Yi @ 2024-06-21 3:20 UTC (permalink / raw)
To: isar-users
This patch works well for my isar image installer case. Thanks!
Best Regards,
Liu Yi
-----Original Message-----
From: isar-users@googlegroups.com <isar-users@googlegroups.com> On Behalf Of Uladzimir Bely
Sent: Thursday, June 13, 2024 12:20 PM
To: isar-users@googlegroups.com
Subject: [RFC PATCH 0/3] Deploy DTBs with kernel recipe
Image task "do_copy_boot_files" is used to deploy kernel, initrd and devicetree binaries to deploy directory.
When different images for the same target are built (e.g., "-base" and
"-debug") in parallel, this causes issues with DTB deployment since they have no any image name specific stuff in the path, unlike kernel and initrd.
Here we make kernel recipes (that are original source of these files) responcible for DTB deployment.
Related topics on maillist:
https://groups.google.com/g/isar-users/c/4BRDM02xC40
https://groups.google.com/g/isar-users/c/qAnjahjjfsw
https://groups.google.com/g/isar-users/c/ZMD4XY4dKWQ
https://groups.google.com/g/isar-users/c/PSGU_AcdPZ8
https://groups.google.com/g/isar-users/c/Va0Ue-ISYeA
To fix the case when different distro use same namings for DTB, this patchset should be merged with "[PATCH] Fix do_copy_boot_files error":
https://groups.google.com/g/isar-users/c/Va0Ue-ISYeA
Uladzimir Bely (3):
Don't deploy devicetree files with image
linux-distro: Deploy devicetree files
linux-custom: Deploy devicetree files
meta/classes/image.bbclass | 11 --------
meta/recipes-kernel/linux/linux-custom.inc | 13 +++++++++ meta/recipes-kernel/linux/linux-distro.bb | 31 ++++++++++++++++++++++
3 files changed, 44 insertions(+), 11 deletions(-)
--
2.44.2
--
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/isar-users/20240613043635.21239-1-ubely%40ilbers.de.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-06-21 3:20 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [RFC PATCH 2/3] linux-distro: Deploy devicetree files Uladzimir Bely
2024-06-13 4:19 ` [RFC PATCH 3/3] linux-custom: " Uladzimir Bely
2024-06-21 3:20 ` [RFC PATCH 0/3] Deploy DTBs with kernel recipe Liu, Yi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox