aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArtur Mądrzak <artur@madrzak.eu>2017-10-29 12:36:23 +0100
committerArtur Mądrzak <artur@madrzak.eu>2017-11-04 22:30:28 +0100
commit98f6eafac0c2e53d3386edf70d98b6dcfd061c10 (patch)
treeda2d2d8362733d234e6a58c6ea1638301da7cf72
parenta53a7fc0981cb8e44b2997ef41acf89b8dbb29e5 (diff)
downloadmeta-qcom-98f6eafac0c2e53d3386edf70d98b6dcfd061c10.tar.gz
meta-qcom-98f6eafac0c2e53d3386edf70d98b6dcfd061c10.tar.bz2
meta-qcom-98f6eafac0c2e53d3386edf70d98b6dcfd061c10.zip
sdimg: build bootimg for sd-card
-rw-r--r--conf/machine/dragonboard-410c.conf2
-rw-r--r--recipes-bsp/firmware/firmware-qcom-dragonboard410c-bootloader-sdcard_17.09.bb4
-rw-r--r--recipes-kernel/linux/linux-qcom-bootimg.inc35
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
}