aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-kernel
diff options
context:
space:
mode:
authorNicolas Dechesne <ndechesne@users.noreply.github.com>2017-11-12 19:10:40 +0100
committerGitHub <noreply@github.com>2017-11-12 19:10:40 +0100
commitcc9d3b8c7af7493359c253f47d305b6369fc9a15 (patch)
treee5009aa301b41c9ac714f75dee876d976883c5bf /recipes-kernel
parentc669b3ce2e23966bc071e098fe9f4870baa1874d (diff)
parentfee0035421d7f6c87157089b8cc09d92bd7c2855 (diff)
downloadmeta-qcom-cc9d3b8c7af7493359c253f47d305b6369fc9a15.tar.gz
meta-qcom-cc9d3b8c7af7493359c253f47d305b6369fc9a15.tar.bz2
meta-qcom-cc9d3b8c7af7493359c253f47d305b6369fc9a15.zip
Merge pull request #49 from madrypl/master-sdcard-image-support
Bootable SD card image - master
Diffstat (limited to 'recipes-kernel')
-rw-r--r--recipes-kernel/linux/linux-qcom-bootimg.inc35
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
}