From: Khem Raj <raj.khem@gmail.com>
To: yocto@yoctoproject.org
Subject: [meta-raspberrypi][PATCH 04/23] sdcard_image-rpi.bbclass: support for .dtbo files for dtb overlays
Date: Thu, 11 Aug 2016 18:05:49 -0700 [thread overview]
Message-ID: <20160812010608.31182-4-raj.khem@gmail.com> (raw)
In-Reply-To: <20160812010608.31182-1-raj.khem@gmail.com>
From: Herve Jourdain <herve.jourdain@neuf.fr>
Kernel 4.4.6+ on RaspberryPi support .dtbo files for overlays, instead of .dtb.
Add support for both extensions for overlays (".dtb" and ".dtbo")
CAUTION: in IMAGE_CMD_rpi-sdimg, 'TMPDIR' is not set, causing 'STAGING_KERNEL_BUILDDIR' to not be expanded, causing get_dts() to not being able to get the kernel version!
To avoid this problem, the kernel version is added in a new variable outside the scope of IMAGE_CMD_rpi-sdimg, and its value passed to get_dts() and split_overlays()!
Signed-off-by: Herve Jourdain <herve.jourdain@neuf.fr>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
classes/sdcard_image-rpi.bbclass | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/classes/sdcard_image-rpi.bbclass b/classes/sdcard_image-rpi.bbclass
index 57cefea..a04204a 100644
--- a/classes/sdcard_image-rpi.bbclass
+++ b/classes/sdcard_image-rpi.bbclass
@@ -75,6 +75,8 @@ IMAGEDATESTAMP = "${@time.strftime('%Y.%m.%d',time.gmtime())}"
IMAGE_CMD_rpi-sdimg[vardepsexclude] += "IMAGEDATESTAMP"
IMAGE_CMD_rpi-sdimg[vardepsexclude] += "DATETIME"
+RPI_KERNEL_VERSION := "${@get_kernelversion_file('${STAGING_KERNEL_BUILDDIR}')}"
+
IMAGE_CMD_rpi-sdimg () {
# Align partitions
@@ -85,7 +87,7 @@ IMAGE_CMD_rpi-sdimg () {
echo "Creating filesystem with Boot partition ${BOOT_SPACE_ALIGNED} KiB and RootFS $ROOTFS_SIZE KiB"
# Check if we are building with device tree support
- DTS="${@get_dts(d, None)}"
+ DTS="${@get_dts(d, '${RPI_KERNEL_VERSION}')}"
# Initialize sdcard image file
dd if=/dev/zero of=${SDIMG} bs=1024 count=0 seek=${SDIMG_SIZE}
@@ -105,9 +107,9 @@ IMAGE_CMD_rpi-sdimg () {
mkfs.vfat -n "${BOOTDD_VOLUME_ID}" -S 512 -C ${WORKDIR}/boot.img $BOOT_BLOCKS
mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/bcm2835-bootfiles/* ::/
if test -n "${DTS}"; then
- # Device Tree Overlays are assumed to be suffixed by '-overlay.dtb' string and will be put in a dedicated folder
- DT_OVERLAYS="${@split_overlays(d, 0)}"
- DT_ROOT="${@split_overlays(d, 1)}"
+ # Device Tree Overlays are assumed to be suffixed by '-overlay.dtb' (4.1.x) or by '.dtbo' (4.4.9+) string and will be put in a dedicated folder
+ DT_OVERLAYS="${@split_overlays(d, '${RPI_KERNEL_VERSION}', 0)}"
+ DT_ROOT="${@split_overlays(d, '${RPI_KERNEL_VERSION}', 1)}"
# Copy board device trees to root folder
for DTB in ${DT_ROOT}; do
@@ -119,9 +121,10 @@ IMAGE_CMD_rpi-sdimg () {
# Copy device tree overlays to dedicated folder
mmd -i ${WORKDIR}/boot.img overlays
for DTB in ${DT_OVERLAYS}; do
- DTB_BASE_NAME=`basename ${DTB} .dtb`
+ DTB_EXT=${DTB##*.}
+ DTB_BASE_NAME=`basename ${DTB} ."${DTB_EXT}"`
- mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${DTB_BASE_NAME}.dtb ::overlays/${DTB_BASE_NAME}.dtb
+ mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${DTB_BASE_NAME}.${DTB_EXT} ::overlays/${DTB_BASE_NAME}.${DTB_EXT}
done
fi
case "${KERNEL_IMAGETYPE}" in
--
2.9.2
next prev parent reply other threads:[~2016-08-12 1:06 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-12 1:05 [meta-raspberrypi][PATCH 01/23] linux-raspberrypi_4.4.bb: support for .dtbo files for dtb overlays Khem Raj
2016-08-12 1:05 ` [meta-raspberrypi][PATCH 02/23] rpi-base.inc: " Khem Raj
2016-08-12 1:05 ` [meta-raspberrypi][PATCH 03/23] linux-raspberrypi-base.bbclass: " Khem Raj
2016-08-12 1:05 ` Khem Raj [this message]
2016-08-12 1:05 ` [meta-raspberrypi][PATCH 05/23] rpi-default-providers.inc: change default providers to support vc4graphics Khem Raj
2016-08-12 1:05 ` [meta-raspberrypi][PATCH 06/23] rpi-base.inc: add vc4-kms-v3d to the overlays " Khem Raj
2016-08-12 1:05 ` [meta-raspberrypi][PATCH 07/23] raspberrypi.conf: set the default value of VC4_CMA_SIZE " Khem Raj
2016-08-12 1:05 ` [meta-raspberrypi][PATCH 08/23] raspberrypi0.conf: " Khem Raj
2016-08-12 1:05 ` [meta-raspberrypi][PATCH 09/23] raspberrypi2.conf: " Khem Raj
2016-08-12 1:05 ` [meta-raspberrypi][PATCH 10/23] raspberrypi3.conf: " Khem Raj
2016-08-12 1:05 ` [meta-raspberrypi][PATCH 11/23] rpi-config_git.bb: add v4c overlay to config.txt " Khem Raj
2016-08-12 1:05 ` [meta-raspberrypi][PATCH 12/23] wayland/weston_%.bbappend: modify configuration options " Khem Raj
2016-08-12 1:05 ` [meta-raspberrypi][PATCH 13/23] weston/weston_%.bbappend: " Khem Raj
2016-08-12 1:05 ` [meta-raspberrypi][PATCH 14/23] mesa_%.bbappend: new file to add the correct " Khem Raj
2016-08-12 1:06 ` [meta-raspberrypi][PATCH 15/23] linux-rpi.inc: add the configuration options required " Khem Raj
2016-08-12 1:06 ` [meta-raspberrypi][PATCH 16/23] linux-raspberrypi-4.4: add patch to enable proper operation of renderD128 device Khem Raj
2016-08-12 1:06 ` [meta-raspberrypi][PATCH 17/23] linux-raspberrypi_4.4: upgrade to 4.4.16 Khem Raj
2016-09-21 16:41 ` Andrei Gherzan
2016-08-12 1:06 ` [meta-raspberrypi][PATCH 18/23] linux-raspberrypi: Add recipe for 4.7 release Khem Raj
2016-08-12 1:06 ` [meta-raspberrypi][PATCH 19/23] linux-raspberrypi_3.18: Remove Khem Raj
2016-08-12 1:06 ` [meta-raspberrypi][PATCH 20/23] firmware, userland: Bump to latest Khem Raj
2016-08-12 1:06 ` [meta-raspberrypi][PATCH 21/23] vc4graphics: Support X11 with the VC4 driver Khem Raj
2016-08-12 1:06 ` [meta-raspberrypi][PATCH 22/23] Switch to using 4.4 as default kernel Khem Raj
2016-08-12 1:06 ` [meta-raspberrypi][PATCH 23/23] weston: Fix typo with override Khem Raj
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=20160812010608.31182-4-raj.khem@gmail.com \
--to=raj.khem@gmail.com \
--cc=yocto@yoctoproject.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.