diff options
Diffstat (limited to 'import-layers/meta-raspberrypi/classes/sdcard_image-rpi.bbclass')
-rw-r--r-- | import-layers/meta-raspberrypi/classes/sdcard_image-rpi.bbclass | 22 |
1 files changed, 10 insertions, 12 deletions
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 |