aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Baryshkov <dmitry.baryshkov@linaro.org>2020-10-08 18:42:24 +0300
committerDmitry Baryshkov <dmitry.baryshkov@linaro.org>2021-04-09 16:38:46 +0300
commite0e4421179da59777061eed481619241169b6185 (patch)
tree67e1bfc727f98439de4a835dd6c5320042471050
parenta3117ad80252e83a72fad8fce23cc83148f6d8ec (diff)
downloadmeta-qcom-e0e4421179da59777061eed481619241169b6185.tar.gz
meta-qcom-e0e4421179da59777061eed481619241169b6185.tar.bz2
meta-qcom-e0e4421179da59777061eed481619241169b6185.zip
linux-linaro: support building with multiple dtbs
Basing on the kernel from kernel-devicetree.bbclass support several devicetree files per machine. The first one from ${KERNEL_DEVICETREE} is used for 'default' boot images. Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> (cherry picked from commit 0a8e0038e119e9f14a1946793ac2188e0c61e2d9)
-rw-r--r--recipes-kernel/linux/linux-linaro-qcom.inc24
-rw-r--r--recipes-kernel/linux/linux-qcom-bootimg.inc34
2 files changed, 38 insertions, 20 deletions
diff --git a/recipes-kernel/linux/linux-linaro-qcom.inc b/recipes-kernel/linux/linux-linaro-qcom.inc
index 21f0ae6..1719ff3 100644
--- a/recipes-kernel/linux/linux-linaro-qcom.inc
+++ b/recipes-kernel/linux/linux-linaro-qcom.inc
@@ -82,11 +82,21 @@ do_configure_prepend() {
}
# append DTB
-do_compile_append() {
- if ! [ -e ${B}/arch/${ARCH}/boot/dts/${KERNEL_DEVICETREE} ] ; then
- oe_runmake ${KERNEL_DEVICETREE}
- fi
- cp arch/${ARCH}/boot/${KERNEL_IMAGETYPE} arch/${ARCH}/boot/${KERNEL_IMAGETYPE}.backup
- cat arch/${ARCH}/boot/${KERNEL_IMAGETYPE}.backup arch/${ARCH}/boot/dts/${KERNEL_DEVICETREE} > arch/${ARCH}/boot/${KERNEL_IMAGETYPE}
- rm -f arch/${ARCH}/boot/${KERNEL_IMAGETYPE}.backup
+do_deploy_append() {
+ for dtbf in ${KERNEL_DEVICETREE}; do
+ dtb=`normalize_dtb "$dtbf"`
+ dtb_ext=${dtb##*.}
+ dtb_base_name=`basename $dtb .$dtb_ext`
+ install -d $deployDir
+ install -m 0644 ${D}/${KERNEL_IMAGEDEST}/$dtb_base_name.$dtb_ext $deployDir/$dtb_base_name-${KERNEL_DTB_NAME}.$dtb_ext
+ for type in ${KERNEL_IMAGETYPE_FOR_MAKE}; do
+ if [ "$type" = "Image.gz" ] ; then
+ cat ${deployDir}/$type \
+ $deployDir/$dtb_base_name-${KERNEL_DTB_NAME}.$dtb_ext \
+ > $deployDir/$type-$dtb_base_name-${KERNEL_DTB_NAME}.$dtb_ext.bin
+ ln -sf $type-$dtb_base_name-${KERNEL_DTB_NAME}.$dtb_ext.bin \
+ $deployDir/$type-$dtb_base_name-${KERNEL_DTB_LINK_NAME}.$dtb_ext.bin
+ fi
+ done
+ done
}
diff --git a/recipes-kernel/linux/linux-qcom-bootimg.inc b/recipes-kernel/linux/linux-qcom-bootimg.inc
index 8a8a407..cfa0cf5 100644
--- a/recipes-kernel/linux/linux-qcom-bootimg.inc
+++ b/recipes-kernel/linux/linux-qcom-bootimg.inc
@@ -4,18 +4,15 @@ QCOM_BOOTIMG_ROOTFS ?= "undefined"
SD_QCOM_BOOTIMG_ROOTFS ?= "undefined"
# set output file names
-BOOT_IMAGE_BASE_NAME = "boot-${KERNEL_IMAGE_NAME}"
-BOOT_IMAGE_SYMLINK_NAME = "boot-${KERNEL_IMAGE_LINK_NAME}"
-SD_BOOT_IMAGE_BASE_NAME = "boot-sd${KERNEL_IMAGE_NAME}"
-SD_BOOT_IMAGE_SYMLINK_NAME = "boot-sd-${KERNEL_IMAGE_LINK_NAME}"
KERNEL_CMDLINE = "root=${1} rw rootwait console=${ttydev},${baudrate}n8"
KERNEL_CMDLINE_append_dragonboard-845c = " clk_ignore_unused pd_ignore_unused"
KERNEL_CMDLINE_append_qrb5165-rb5 = " pcie_pme=nomsi"
# param ${1} partition where rootfs is located
# param ${2} output boot image file name
+# param ${3} kernel imagename
priv_make_image() {
- ${STAGING_BINDIR_NATIVE}/skales/mkbootimg --kernel ${B}/arch/${ARCH}/boot/${KERNEL_IMAGETYPE} \
+ ${STAGING_BINDIR_NATIVE}/skales/mkbootimg --kernel ${3} \
--ramdisk ${B}/initrd.img \
--output ${DEPLOYDIR}/${2}.img \
--pagesize ${QCOM_BOOTIMG_PAGE_SIZE} \
@@ -38,12 +35,23 @@ do_deploy_append() {
bbfatal "Rootfs partition must be defined"
fi
- priv_make_image ${QCOM_BOOTIMG_ROOTFS} ${BOOT_IMAGE_BASE_NAME}
- ln -sf ${BOOT_IMAGE_BASE_NAME}.img ${DEPLOYDIR}/${BOOT_IMAGE_SYMLINK_NAME}.img
-
- # build sd boot image only for machines supporting it.
- if [ "${SD_QCOM_BOOTIMG_ROOTFS}" != "undefined" ]; then
- priv_make_image ${SD_QCOM_BOOTIMG_ROOTFS} ${SD_BOOT_IMAGE_BASE_NAME}
- ln -sf ${SD_BOOT_IMAGE_BASE_NAME}.img ${DEPLOYDIR}/${SD_BOOT_IMAGE_SYMLINK_NAME}.img
- fi
+ for dtbf in ${KERNEL_DEVICETREE}; do
+ dtb=`normalize_dtb "$dtbf"`
+ dtb_ext=${dtb##*.}
+ dtb_base_name=`basename $dtb .$dtb_ext`
+ priv_make_image ${QCOM_BOOTIMG_ROOTFS} boot-$dtb_base_name-${KERNEL_IMAGE_NAME} ${deployDir}/Image.gz-$dtb_base_name-${KERNEL_DTB_NAME}.$dtb_ext.bin
+ ln -sf boot-${dtb_base_name}-${KERNEL_IMAGE_NAME}.img ${DEPLOYDIR}/boot-${dtb_base_name}-${KERNEL_IMAGE_LINK_NAME}.img
+ if [ ! -h ${DEPLOYDIR}/boot-${KERNEL_IMAGE_LINK_NAME}.img ]; then
+ ln -sf boot-${dtb_base_name}-${KERNEL_IMAGE_NAME}.img ${DEPLOYDIR}/boot-${KERNEL_IMAGE_LINK_NAME}.img
+ fi
+
+ # build sd boot image only for machines supporting it.
+ if [ "${SD_QCOM_BOOTIMG_ROOTFS}" != "undefined" ]; then
+ priv_make_image ${SD_QCOM_BOOTIMG_ROOTFS} boot-sd-$dtb_base_name-${KERNEL_IMAGE_NAME} ${deployDir}/Image.gz-$dtb_base_name-${KERNEL_DTB_NAME}.$dtb_ext.bin
+ ln -sf boot-sd-${dtb_base_name}-${KERNEL_IMAGE_NAME}.img ${DEPLOYDIR}/boot-sd-${dtb_base_name}-${KERNEL_IMAGE_LINK_NAME}.img
+ if [ ! -h ${DEPLOYDIR}/boot-sd-${KERNEL_IMAGE_LINK_NAME}.img ]; then
+ ln -sf boot-sd-${dtb_base_name}-${KERNEL_IMAGE_NAME}.img ${DEPLOYDIR}/boot-sd-${KERNEL_IMAGE_LINK_NAME}.img
+ fi
+ fi
+ done
}