diff options
Diffstat (limited to 'import-layers/meta-raspberrypi/classes')
-rw-r--r-- | import-layers/meta-raspberrypi/classes/linux-raspberrypi-base.bbclass | 24 | ||||
-rw-r--r-- | import-layers/meta-raspberrypi/classes/sdcard_image-rpi.bbclass | 22 |
2 files changed, 17 insertions, 29 deletions
diff --git a/import-layers/meta-raspberrypi/classes/linux-raspberrypi-base.bbclass b/import-layers/meta-raspberrypi/classes/linux-raspberrypi-base.bbclass index 40beef1d8..dc2330af2 100644 --- a/import-layers/meta-raspberrypi/classes/linux-raspberrypi-base.bbclass +++ b/import-layers/meta-raspberrypi/classes/linux-raspberrypi-base.bbclass @@ -1,7 +1,8 @@ inherit linux-kernel-base +def get_dts(d, ver=None): + import re -def get_dts(d, ver): staging_dir = d.getVar("STAGING_KERNEL_BUILDDIR", True) dts = d.getVar("KERNEL_DEVICETREE", True) @@ -13,27 +14,16 @@ def get_dts(d, ver): from the kernel staging ''' ver = get_kernelversion_file(staging_dir) - if ver is not None: - min_ver = ver.split('.', 3) - else: - return dts - - # Always turn off device tree support for kernel's < 3.18 - try: - if int(min_ver[0]) <= 3: - if int(min_ver[1]) < 18: - dts = "" - except IndexError: - min_ver = None - return dts -def split_overlays(d, out): - dts = get_dts(d, None) +def split_overlays(d, out, ver=None): + dts = get_dts(d, ver) if out: overlays = oe.utils.str_filter_out('\S+\-overlay\.dtb$', dts, d) + overlays = oe.utils.str_filter_out('\S+\.dtbo$', overlays, d) else: - overlays = oe.utils.str_filter('\S+\-overlay\.dtb$', dts, d) + overlays = oe.utils.str_filter('\S+\-overlay\.dtb$', dts, d) + \ + " " + oe.utils.str_filter('\S+\.dtbo$', dts, d) return overlays diff --git a/import-layers/meta-raspberrypi/classes/sdcard_image-rpi.bbclass b/import-layers/meta-raspberrypi/classes/sdcard_image-rpi.bbclass index 57cefea08..116d5e82c 100644 --- a/import-layers/meta-raspberrypi/classes/sdcard_image-rpi.bbclass +++ b/import-layers/meta-raspberrypi/classes/sdcard_image-rpi.bbclass @@ -47,7 +47,7 @@ IMAGE_ROOTFS_ALIGNMENT = "4096" # Use an uncompressed ext3 by default as rootfs SDIMG_ROOTFS_TYPE ?= "ext3" -SDIMG_ROOTFS = "${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.${SDIMG_ROOTFS_TYPE}" +SDIMG_ROOTFS = "${IMGDEPLOYDIR}/${IMAGE_NAME}.rootfs.${SDIMG_ROOTFS_TYPE}" IMAGE_DEPENDS_rpi-sdimg = " \ parted-native \ @@ -59,7 +59,7 @@ IMAGE_DEPENDS_rpi-sdimg = " \ " # SD card image name -SDIMG = "${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.rpi-sdimg" +SDIMG = "${IMGDEPLOYDIR}/${IMAGE_NAME}.rootfs.rpi-sdimg" # Compression method to apply to SDIMG after it has been created. Supported # compression formats are "gzip", "bzip2" or "xz". The original .rpi-sdimg file @@ -71,10 +71,6 @@ SDIMG = "${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.rpi-sdimg" # Additional files and/or directories to be copied into the vfat partition from the IMAGE_ROOTFS. FATPAYLOAD ?= "" -IMAGEDATESTAMP = "${@time.strftime('%Y.%m.%d',time.gmtime())}" -IMAGE_CMD_rpi-sdimg[vardepsexclude] += "IMAGEDATESTAMP" -IMAGE_CMD_rpi-sdimg[vardepsexclude] += "DATETIME" - IMAGE_CMD_rpi-sdimg () { # Align partitions @@ -85,7 +81,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)}" # Initialize sdcard image file dd if=/dev/zero of=${SDIMG} bs=1024 count=0 seek=${SDIMG_SIZE} @@ -105,7 +101,7 @@ 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 + # 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, 0)}" DT_ROOT="${@split_overlays(d, 1)}" @@ -119,15 +115,17 @@ 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 "uImage") mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/u-boot.bin ::${SDIMG_KERNELIMAGE} mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}${KERNEL_INITRAMFS}-${MACHINE}.bin ::uImage + mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/boot.scr ::boot.scr ;; *) mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}${KERNEL_INITRAMFS}-${MACHINE}.bin ::${SDIMG_KERNELIMAGE} @@ -143,8 +141,8 @@ IMAGE_CMD_rpi-sdimg () { fi # Add stamp file - echo "${IMAGE_NAME}-${IMAGEDATESTAMP}" > ${WORKDIR}/image-version-info - mcopy -i ${WORKDIR}/boot.img -v ${WORKDIR}//image-version-info :: + echo "${IMAGE_NAME}" > ${WORKDIR}/image-version-info + mcopy -i ${WORKDIR}/boot.img -v ${WORKDIR}/image-version-info :: # Burn Partitions dd if=${WORKDIR}/boot.img of=${SDIMG} conv=notrunc seek=1 bs=$(expr ${IMAGE_ROOTFS_ALIGNMENT} \* 1024) && sync && sync |