diff options
-rw-r--r-- | conf/machine/dragonboard-410c.conf | 2 | ||||
-rw-r--r-- | recipes-bsp/firmware/firmware-qcom-dragonboard410c-bootloader-sdcard_17.09.bb | 4 | ||||
-rw-r--r-- | recipes-kernel/linux/linux-qcom-bootimg.inc | 35 |
3 files changed, 32 insertions, 9 deletions
diff --git a/conf/machine/dragonboard-410c.conf b/conf/machine/dragonboard-410c.conf index a0b7e6a..2244a55 100644 --- a/conf/machine/dragonboard-410c.conf +++ b/conf/machine/dragonboard-410c.conf @@ -21,3 +21,5 @@ MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += " \ " QCOM_BOOTIMG_ROOTFS ?= "mmcblk0p10" + +SD_QCOM_BOOTIMG_ROOTFS ?= "mmcblk1p9" diff --git a/recipes-bsp/firmware/firmware-qcom-dragonboard410c-bootloader-sdcard_17.09.bb b/recipes-bsp/firmware/firmware-qcom-dragonboard410c-bootloader-sdcard_17.09.bb index c262245..537dae3 100644 --- a/recipes-bsp/firmware/firmware-qcom-dragonboard410c-bootloader-sdcard_17.09.bb +++ b/recipes-bsp/firmware/firmware-qcom-dragonboard410c-bootloader-sdcard_17.09.bb @@ -12,8 +12,10 @@ SRC_URI[sha256sum] = "9885f915ebd4986432340cf1d03b8fd2bfdd97ad6a4a7466200fddbe41 COMPATIBLE_MACHINE = "(dragonboard-410c)" PACKAGE_ARCH = "${MACHINE_ARCH}" +S = "${WORKDIR}" + do_deploy() { - install -D -p -m644 ${WORKDIR}/*.mbn ${DEPLOYDIR} + install -D -p -m644 ${S}/*.mbn ${DEPLOYDIR} } addtask deploy before do_build after do_compile 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 } |