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
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}