diff options
Diffstat (limited to 'meta-raspberrypi/classes')
-rw-r--r-- | meta-raspberrypi/classes/sdcard_image-rpi.bbclass | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/meta-raspberrypi/classes/sdcard_image-rpi.bbclass b/meta-raspberrypi/classes/sdcard_image-rpi.bbclass index e7c34c63f..6244ee55b 100644 --- a/meta-raspberrypi/classes/sdcard_image-rpi.bbclass +++ b/meta-raspberrypi/classes/sdcard_image-rpi.bbclass @@ -28,9 +28,6 @@ IMAGE_TYPEDEP_rpi-sdimg = "${SDIMG_ROOTFS_TYPE}" # Set kernel and boot loader IMAGE_BOOTLOADER ?= "bcm2835-bootfiles" -# Set initramfs extension -KERNEL_INITRAMFS ?= "" - # Kernel image name SDIMG_KERNELIMAGE_raspberrypi ?= "kernel.img" SDIMG_KERNELIMAGE_raspberrypi2 ?= "kernel7.img" @@ -49,6 +46,9 @@ IMAGE_ROOTFS_ALIGNMENT = "4096" SDIMG_ROOTFS_TYPE ?= "ext3" SDIMG_ROOTFS = "${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.${SDIMG_ROOTFS_TYPE}" +# For the names of kernel artifacts +inherit kernel-artifact-names + do_image_rpi_sdimg[depends] = " \ parted-native:do_populate_sysroot \ mtools-native:do_populate_sysroot \ @@ -75,6 +75,7 @@ SDIMG = "${IMGDEPLOYDIR}/${IMAGE_NAME}.rootfs.rpi-sdimg" FATPAYLOAD ?= "" # SD card vfat partition image name +SDIMG_VFAT_DEPLOY ?= "${RPI_USE_U_BOOT}" SDIMG_VFAT = "${IMAGE_NAME}.vfat" SDIMG_LINK_VFAT = "${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.vfat" @@ -135,10 +136,18 @@ IMAGE_CMD_rpi-sdimg () { fi if [ "${RPI_USE_U_BOOT}" = "1" ]; then 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 ::${KERNEL_IMAGETYPE} mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/boot.scr ::boot.scr + if [ ! -z "${INITRAMFS_IMAGE}" -a "${INITRAMFS_IMAGE_BUNDLE}" = "1" ]; then + mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${INITRAMFS_LINK_NAME}.bin ::${KERNEL_IMAGETYPE} + else + mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE} ::${KERNEL_IMAGETYPE} + fi else - mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}${KERNEL_INITRAMFS}-${MACHINE}.bin ::${SDIMG_KERNELIMAGE} + if [ ! -z "${INITRAMFS_IMAGE}" -a "${INITRAMFS_IMAGE_BUNDLE}" = "1" ]; then + mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${INITRAMFS_LINK_NAME}.bin ::${SDIMG_KERNELIMAGE} + else + mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE} ::${SDIMG_KERNELIMAGE} + fi fi if [ -n ${FATPAYLOAD} ] ; then @@ -153,8 +162,8 @@ IMAGE_CMD_rpi-sdimg () { echo "${IMAGE_NAME}" > ${WORKDIR}/image-version-info mcopy -i ${WORKDIR}/boot.img -v ${WORKDIR}/image-version-info :: - # Deploy vfat partition (for u-boot case only) - if [ "${RPI_USE_U_BOOT}" = "1" ]; then + # Deploy vfat partition + if [ "${SDIMG_VFAT_DEPLOY}" = "1" ]; then cp ${WORKDIR}/boot.img ${IMGDEPLOYDIR}/${SDIMG_VFAT} ln -sf ${SDIMG_VFAT} ${SDIMG_LINK_VFAT} fi |