diff options
Diffstat (limited to 'recipes-kernel/linux/linux-qcom-bootimg.inc')
-rw-r--r-- | recipes-kernel/linux/linux-qcom-bootimg.inc | 35 |
1 files changed, 27 insertions, 8 deletions
diff --git a/recipes-kernel/linux/linux-qcom-bootimg.inc b/recipes-kernel/linux/linux-qcom-bootimg.inc index ab1065b..e0969ef 100644 --- a/recipes-kernel/linux/linux-qcom-bootimg.inc +++ b/recipes-kernel/linux/linux-qcom-bootimg.inc @@ -1,12 +1,28 @@ DEPENDS += "skales-native" QCOM_BOOTIMG_ROOTFS ?= "undefined" +SD_QCOM_BOOTIMG_ROOTFS ?= "undefined" # set output file names DT_IMAGE_BASE_NAME = "dt-${KERNEL_IMAGE_BASE_NAME}" DT_IMAGE_SYMLINK_NAME = "dt-${KERNEL_IMAGE_SYMLINK_NAME}" BOOT_IMAGE_BASE_NAME = "boot-${KERNEL_IMAGE_BASE_NAME}" BOOT_IMAGE_SYMLINK_NAME = "boot-${KERNEL_IMAGE_SYMLINK_NAME}" +SD_BOOT_IMAGE_BASE_NAME = "boot-sd${KERNEL_IMAGE_BASE_NAME}" +SD_BOOT_IMAGE_SYMLINK_NAME = "boot-sd-${KERNEL_IMAGE_SYMLINK_NAME}" + +# param ${1} partition where rootfs is located +# param ${2} output boot image file name +priv_make_image() { + ${STAGING_BINDIR_NATIVE}/skales/mkbootimg --kernel ${B}/arch/${ARCH}/boot/${KERNEL_IMAGETYPE} \ + --ramdisk ${B}/initrd.img \ + --output ${DEPLOYDIR}/${2}.img \ + $mkbootimg_dtarg \ + --pagesize ${QCOM_BOOTIMG_PAGE_SIZE} \ + --base ${QCOM_BOOTIMG_KERNEL_BASE} \ + --cmdline \ + "root=/dev/${1} rw rootwait console=${ttydev},${baudrate}n8" +} do_deploy_append() { @@ -26,14 +42,17 @@ do_deploy_append() { # during boot echo "This is not an initrd" > ${B}/initrd.img - ${STAGING_BINDIR_NATIVE}/skales/mkbootimg --kernel ${B}/arch/${ARCH}/boot/${KERNEL_IMAGETYPE} \ - --ramdisk ${B}/initrd.img \ - --output ${DEPLOYDIR}/${BOOT_IMAGE_BASE_NAME}.img \ - $mkbootimg_dtarg \ - --pagesize ${QCOM_BOOTIMG_PAGE_SIZE} \ - --base ${QCOM_BOOTIMG_KERNEL_BASE} \ - --cmdline \ - "root=/dev/${QCOM_BOOTIMG_ROOTFS} rw rootwait console=${ttydev},${baudrate}n8" + # don't build bootimg if rootfs partition is not defined + if [ "${QCOM_BOOTIMG_ROOTFS}" == "undefined"]; then + 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 } |