diff options
22 files changed, 275 insertions, 94 deletions
diff --git a/conf/machine/dragonboard-845c.conf b/conf/machine/dragonboard-845c.conf index 8391ef6..e5f0755 100644 --- a/conf/machine/dragonboard-845c.conf +++ b/conf/machine/dragonboard-845c.conf @@ -8,6 +8,7 @@ MACHINE_FEATURES = "usbhost usbgadget alsa screen wifi bluetooth ext2" KERNEL_IMAGETYPE ?= "Image.gz" KERNEL_DEVICETREE ?= "qcom/sdm845-db845c.dtb" +KERNEL_CMDLINE_EXTRA ?= "clk_ignore_unused pd_ignore_unused" SERIAL_CONSOLE ?= "115200 ttyMSM0" diff --git a/conf/machine/include/qcom-apq8016.inc b/conf/machine/include/qcom-apq8016.inc index 80e097b..a073ae7 100644 --- a/conf/machine/include/qcom-apq8016.inc +++ b/conf/machine/include/qcom-apq8016.inc @@ -9,3 +9,6 @@ MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += " \ MACHINE_EXTRA_RRECOMMENDS += " \ fastrpc \ " + +# Android boot image settings +QCOM_BOOTIMG_PAGE_SIZE = "2048" diff --git a/conf/machine/include/qcom-apq8064.inc b/conf/machine/include/qcom-apq8064.inc index 96f880c..af8e87a 100644 --- a/conf/machine/include/qcom-apq8064.inc +++ b/conf/machine/include/qcom-apq8064.inc @@ -1,3 +1,6 @@ SOC_FAMILY = "apq8064" require conf/machine/include/qcom-common.inc require conf/machine/include/tune-cortexa8.inc + +# Android boot image settings +QCOM_BOOTIMG_PAGE_SIZE = "2048" diff --git a/conf/machine/include/qcom-apq8096.inc b/conf/machine/include/qcom-apq8096.inc index 4f62b59..8038091 100644 --- a/conf/machine/include/qcom-apq8096.inc +++ b/conf/machine/include/qcom-apq8096.inc @@ -10,6 +10,3 @@ MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += " \ MACHINE_EXTRA_RRECOMMENDS += " \ fastrpc \ " - -# Android boot image settings -QCOM_BOOTIMG_PAGE_SIZE = "4096" diff --git a/conf/machine/include/qcom-common.inc b/conf/machine/include/qcom-common.inc index d2434f9..fd86574 100644 --- a/conf/machine/include/qcom-common.inc +++ b/conf/machine/include/qcom-common.inc @@ -30,4 +30,4 @@ IMAGE_ROOTFS_ALIGNMENT ?= "4096" # Android boot image settings QCOM_BOOTIMG_KERNEL_BASE ?= "0x80000000" -QCOM_BOOTIMG_PAGE_SIZE ?= "2048" +QCOM_BOOTIMG_PAGE_SIZE ?= "4096" diff --git a/conf/machine/include/qcom-qcs404.inc b/conf/machine/include/qcom-qcs404.inc index eacc03c..90f9acb 100644 --- a/conf/machine/include/qcom-qcs404.inc +++ b/conf/machine/include/qcom-qcs404.inc @@ -5,6 +5,3 @@ require conf/machine/include/arm/arch-armv8a.inc MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += " \ qrtr \ " - -# Android boot image settings -QCOM_BOOTIMG_PAGE_SIZE = "4096" diff --git a/conf/machine/include/qcom-sdm845.inc b/conf/machine/include/qcom-sdm845.inc index da6ff9f..d197ca6 100644 --- a/conf/machine/include/qcom-sdm845.inc +++ b/conf/machine/include/qcom-sdm845.inc @@ -13,6 +13,3 @@ MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += " \ MACHINE_EXTRA_RRECOMMENDS += " \ fastrpc \ " - -# Android boot image settings -QCOM_BOOTIMG_PAGE_SIZE = "4096" diff --git a/conf/machine/include/qcom-sdx55.inc b/conf/machine/include/qcom-sdx55.inc new file mode 100644 index 0000000..c02924c --- /dev/null +++ b/conf/machine/include/qcom-sdx55.inc @@ -0,0 +1,12 @@ +SOC_FAMILY = "sdx55" +require conf/machine/include/qcom-common.inc +require conf/machine/include/tune-cortexa7.inc + +MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += " \ + qrtr \ + rmtfs \ +" + +# UBI filesystem settings +IMAGE_FSTYPES ?= "ubi" +QCOM_BOOTIMG_PAGE_SIZE ?= "4096" diff --git a/conf/machine/include/qcom-sm8250.inc b/conf/machine/include/qcom-sm8250.inc index fbdd7cb..c557147 100644 --- a/conf/machine/include/qcom-sm8250.inc +++ b/conf/machine/include/qcom-sm8250.inc @@ -13,6 +13,3 @@ MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += " \ MACHINE_EXTRA_RRECOMMENDS += " \ fastrpc \ " - -# Android boot image settings -QCOM_BOOTIMG_PAGE_SIZE ?= "4096" diff --git a/conf/machine/qcom-armv8a.conf b/conf/machine/qcom-armv8a.conf new file mode 100644 index 0000000..c171c27 --- /dev/null +++ b/conf/machine/qcom-armv8a.conf @@ -0,0 +1,49 @@ +require conf/machine/include/qcom-common.inc +require conf/machine/include/arm/arch-armv8a.inc + +MACHINE_FEATURES = "usbhost usbgadget alsa screen wifi bluetooth ext2" + +# UFS partitions in 820/845/RB5 setup with 4096 logical sector size +EXTRA_IMAGECMD_ext4 += " -b 4096 " + +# Support for dragonboard{410, 820, 845}c, rb5 +KERNEL_IMAGETYPE ?= "Image.gz" +SERIAL_CONSOLE ?= "115200 ttyMSM0" +KERNEL_DEVICETREE ?= "qcom/apq8016-sbc.dtb qcom/apq8096-db820c.dtb qcom/sdm845-db845c.dtb qcom/qrb5165-rb5.dtb qcom/sm8250-rb5-dvt.dtb" + +QCOM_BOOTIMG_PAGE_SIZE[apq8016-sbc] = "2048" +QCOM_BOOTIMG_ROOTFS = "/dev/sda1" +QCOM_BOOTIMG_ROOTFS[apq8016-sbc] = "/dev/mmcblk0p14" +QCOM_BOOTIMG_ROOTFS[qrb5165-rb5] = "PARTLABEL=userdata" +QCOM_BOOTIMG_ROOTFS[sm8250-rb5-dvt] = "PARTLABEL=userdata" +SD_QCOM_BOOTIMG_ROOTFS[apq8016-sbc] = "/dev/mmcblk1p7" +KERNEL_CMDLINE_EXTRA[sdm845-db845c] = "clk_ignore_unused pd_ignore_unused" + +# Userspace tools +MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += " \ + pd-mapper \ + qrtr \ + rmtfs \ + tqftpserv \ +" + +MACHINE_EXTRA_RRECOMMENDS += " \ + fastrpc \ +" + +# Modules and firmware for all supported machines +MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += " \ + kernel-modules \ + firmware-qcom-dragonboard410c \ + firmware-qcom-dragonboard820c \ + firmware-qcom-dragonboard845c \ + firmware-qcom-rb5 \ + ${@bb.utils.contains('DISTRO_FEATURES', 'wifi', 'linux-firmware-ath10k linux-firmware-ath11k linux-firmware-qcom-sdm845-modem wireless-regdb-static', '', d)} \ + ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'linux-firmware-qca linux-firmware-qcom-sdm845-modem', '', d)} \ + linux-firmware-qcom-sdm845-audio \ + linux-firmware-qcom-sdm845-compute \ + ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'linux-firmware-qcom-adreno-a3xx linux-firmware-qcom-adreno-a530 linux-firmware-qcom-adreno-a630', '', d)} \ + linux-firmware-qcom-venus-1.8 \ + linux-firmware-qcom-venus-4.2 \ + linux-firmware-qcom-venus-5.2 \ +" diff --git a/conf/machine/qrb5165-rb5.conf b/conf/machine/qrb5165-rb5.conf index bbb00ab..a15690a 100644 --- a/conf/machine/qrb5165-rb5.conf +++ b/conf/machine/qrb5165-rb5.conf @@ -8,12 +8,14 @@ MACHINE_FEATURES = "usbhost usbgadget alsa screen wifi bluetooth ext2" KERNEL_IMAGETYPE ?= "Image.gz" KERNEL_DEVICETREE ?= "qcom/qrb5165-rb5.dtb qcom/sm8250-rb5-dvt.dtb" +KERNEL_CMDLINE_EXTRA ?= "pcie_pme=nomsi" SERIAL_CONSOLE ?= "115200 ttyMSM0" MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += " \ kernel-modules \ firmware-qcom-rb5 linux-firmware-lt9611uxc \ + lt9611uxc-upgrade \ ${@bb.utils.contains('DISTRO_FEATURES', 'wifi', 'linux-firmware-ath11k wireless-regdb-static', '', d)} \ ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'linux-firmware-qca', '', d)} \ ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'mesa-driver-msm', '', d)} \ diff --git a/conf/machine/sdx55-mtp.conf b/conf/machine/sdx55-mtp.conf new file mode 100644 index 0000000..92fcd9e --- /dev/null +++ b/conf/machine/sdx55-mtp.conf @@ -0,0 +1,22 @@ +#@TYPE: Machine +#@NAME: SDX55-MTP +#@DESCRIPTION: Machine configuration for the SDX55-MTP development board, with Qualcomm SDX55. + +require conf/machine/include/qcom-sdx55.inc + +MACHINE_FEATURES = "usbhost usbgadget" + +KERNEL_IMAGETYPE ?= "zImage" +KERNEL_DEVICETREE ?= "qcom-sdx55-mtp.dtb" + +# UBI filesystem parameters +MKUBIFS_ARGS ?= "-m 4096 -e 253952 -c 1188" +UBINIZE_ARGS ?= "-m 4096 -p 256KiB -s 4096" + +# Use system partition for rootfs +UBI_VOLNAME ?= "system" +QCOM_BOOTIMG_ROOTFS ?= "ubi0:system" + +SERIAL_CONSOLES ?= "115200;ttyMSM0" + +PREFERRED_PROVIDER_virtual/kernel = "linux-linaro-qcomlt-dev" diff --git a/conf/machine/sdx55-telit-fn980.conf b/conf/machine/sdx55-telit-fn980.conf new file mode 100644 index 0000000..24f5f97 --- /dev/null +++ b/conf/machine/sdx55-telit-fn980.conf @@ -0,0 +1,22 @@ +#@TYPE: Machine +#@NAME: SDX55-TELIT-FN980 +#@DESCRIPTION: Machine configuration for the Telit FN980 development board, with Qualcomm SDX55. + +require conf/machine/include/qcom-sdx55.inc + +MACHINE_FEATURES = "usbhost usbgadget" + +KERNEL_IMAGETYPE ?= "zImage" +KERNEL_DEVICETREE ?= "qcom-sdx55-telit-fn980.dtb" + +# UBI filesystem parameters +MKUBIFS_ARGS ?= "-m 4096 -e 253952 -c 528" +UBINIZE_ARGS ?= "-m 4096 -p 256KiB -s 4096" + +# Use system partition for rootfs +UBI_VOLNAME ?= "system" +QCOM_BOOTIMG_ROOTFS ?= "ubi0:system" + +SERIAL_CONSOLES ?= "921600;ttyMSM0" + +PREFERRED_PROVIDER_virtual/kernel = "linux-linaro-qcomlt-dev" diff --git a/recipes-bsp/lt9611uxc-upgrade/lt9611uxc-upgrade.bb b/recipes-bsp/lt9611uxc-upgrade/lt9611uxc-upgrade.bb new file mode 100644 index 0000000..e6ae271 --- /dev/null +++ b/recipes-bsp/lt9611uxc-upgrade/lt9611uxc-upgrade.bb @@ -0,0 +1,19 @@ +SUMMARY = "Upgrade Lontium LT9611UXC firmware to the latest image" + +SRC_URI = "file://lt9611uxc.service file://lt9611uxc-upgrade.sh" +LICENSE = "MIT" + +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" + +inherit systemd + +RDEPENDS_${PN} += "linux-firmware-lt9611uxc" + +do_install() { + install -d ${D}${bindir} + install -m 0755 ${WORKDIR}/lt9611uxc-upgrade.sh ${D}${bindir} + install -d ${D}${systemd_system_unitdir} + install -m 0644 ${WORKDIR}/lt9611uxc.service ${D}${systemd_system_unitdir} +} + +SYSTEMD_SERVICE_${PN} = "lt9611uxc.service" diff --git a/recipes-bsp/lt9611uxc-upgrade/lt9611uxc-upgrade/lt9611uxc-upgrade.sh b/recipes-bsp/lt9611uxc-upgrade/lt9611uxc-upgrade/lt9611uxc-upgrade.sh new file mode 100644 index 0000000..0886980 --- /dev/null +++ b/recipes-bsp/lt9611uxc-upgrade/lt9611uxc-upgrade/lt9611uxc-upgrade.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +set -e + +if [ ! -r /lib/firmware/lt9611uxc_fw.bin ] ; then + echo "LT9611UXC firmware not found" + exit 1 +fi + +if [ ! -d /sys/bus/i2c/drivers/lt9611uxc ] ; then + modprobe lontium-lt9611uxc + sleep 1 +fi + +for f in /sys/bus/i2c/drivers/lt9611uxc/* ; do + [ -L $f ] || continue + version=`cat $f/lt9611uxc_firmware` + if [ "$version" -lt "43" ] ; then + echo > $f/lt9611uxc_firmware + fi +done diff --git a/recipes-bsp/lt9611uxc-upgrade/lt9611uxc-upgrade/lt9611uxc.service b/recipes-bsp/lt9611uxc-upgrade/lt9611uxc-upgrade/lt9611uxc.service new file mode 100644 index 0000000..c55e8ff --- /dev/null +++ b/recipes-bsp/lt9611uxc-upgrade/lt9611uxc-upgrade/lt9611uxc.service @@ -0,0 +1,11 @@ +[Unit] +Description=Update LT9611UXC Firmware +ConditionOnFirstBoot=true +After=systemd-udev-settle.service + +[Service] +Type=oneshot +ExecStart=/usr/bin/lt9611uxc-upgrade.sh + +[Install] +WantedBy=getty.target diff --git a/recipes-graphics/mesa/mesa_git.bb b/recipes-graphics/mesa/mesa_git.bb index 0cdeb05..871d560 100644 --- a/recipes-graphics/mesa/mesa_git.bb +++ b/recipes-graphics/mesa/mesa_git.bb @@ -9,7 +9,7 @@ SRC_URI = "git://gitlab.freedesktop.org/mesa/mesa.git;protocol=https \ " LIC_FILES_CHKSUM = "file://docs/license.rst;md5=9aa1bc48c9826ad9fdb16661f6930496" -SRCREV = "eb2a4a7dee7c84cde44294f991ae731f88d19272" +SRCREV = "13f92183c7dbff9d76a83656862d0b2c2536e25d" #SRCREV_sm8250 = "${AUTOREV}" PLATFORMS_remove = "drm surfaceless" @@ -27,8 +27,8 @@ FILES_${PN}-ci = "${bindir}/deqp-runner.sh ${datadir}/mesa/deqp-*" do_install_append () { install -d ${D}/${datadir}/mesa - install -m 0644 ${S}/.gitlab-ci/deqp-default-skips.txt ${D}/${datadir}/mesa/ - for f in ${S}/.gitlab-ci/deqp-freedreno-*; do + install -m 0644 ${S}/ci-expects/default/deqp-default-skips.txt ${D}/${datadir}/mesa/ + for f in ${S}/ci-expects/freedreno/deqp-freedreno-*; do install -m 0644 $f ${D}/${datadir}/mesa/ done diff --git a/recipes-kernel/linux/linux-linaro-qcom.inc b/recipes-kernel/linux/linux-linaro-qcom.inc index 1719ff3..4e78597 100644 --- a/recipes-kernel/linux/linux-linaro-qcom.inc +++ b/recipes-kernel/linux/linux-linaro-qcom.inc @@ -18,6 +18,7 @@ S = "${WORKDIR}/git" KERNEL_DEFCONFIG_aarch64 ?= "${S}/arch/arm64/configs/defconfig" KERNEL_DEFCONFIG_apq8064 ?= "${S}/arch/arm/configs/qcom_defconfig" +KERNEL_DEFCONFIG_sdx55 ?= "${S}/arch/arm/configs/qcom_defconfig" KERNEL_CONFIG_FRAGMENTS += "${S}/kernel/configs/distro.config" kernel_conf_variable() { @@ -80,23 +81,3 @@ do_configure_prepend() { yes '' | oe_runmake -C ${S} O=${B} oldconfig oe_runmake -C ${S} O=${B} savedefconfig && cp ${B}/defconfig ${WORKDIR}/defconfig.saved } - -# append DTB -do_deploy_append() { - for dtbf in ${KERNEL_DEVICETREE}; do - dtb=`normalize_dtb "$dtbf"` - dtb_ext=${dtb##*.} - dtb_base_name=`basename $dtb .$dtb_ext` - install -d $deployDir - install -m 0644 ${D}/${KERNEL_IMAGEDEST}/$dtb_base_name.$dtb_ext $deployDir/$dtb_base_name-${KERNEL_DTB_NAME}.$dtb_ext - for type in ${KERNEL_IMAGETYPE_FOR_MAKE}; do - if [ "$type" = "Image.gz" ] ; then - cat ${deployDir}/$type \ - $deployDir/$dtb_base_name-${KERNEL_DTB_NAME}.$dtb_ext \ - > $deployDir/$type-$dtb_base_name-${KERNEL_DTB_NAME}.$dtb_ext.bin - ln -sf $type-$dtb_base_name-${KERNEL_DTB_NAME}.$dtb_ext.bin \ - $deployDir/$type-$dtb_base_name-${KERNEL_DTB_LINK_NAME}.$dtb_ext.bin - fi - done - done -} diff --git a/recipes-kernel/linux/linux-linaro-qcomlt_5.10.bb b/recipes-kernel/linux/linux-linaro-qcomlt_5.10.bb index 0c4cdc1..01a4502 100644 --- a/recipes-kernel/linux/linux-linaro-qcomlt_5.10.bb +++ b/recipes-kernel/linux/linux-linaro-qcomlt_5.10.bb @@ -10,6 +10,6 @@ require recipes-kernel/linux/linux-qcom-bootimg.inc LOCALVERSION ?= "-linaro-lt-qcom" SRCBRANCH = "release/qcomlt-5.10" -SRCREV = "3f30f43cd449a911c7f304078aa8464ec5eb0903" +SRCREV = "9ab492e76768cd1bd9f2da52004ed537c8b329f3" -COMPATIBLE_MACHINE = "(apq8016|apq8096|sdm845|sm8250)" +COMPATIBLE_MACHINE = "(qcom)" diff --git a/recipes-kernel/linux/linux-linaro-qcomlt_5.7.bb b/recipes-kernel/linux/linux-linaro-qcomlt_5.7.bb index d59db58..88b33be 100644 --- a/recipes-kernel/linux/linux-linaro-qcomlt_5.7.bb +++ b/recipes-kernel/linux/linux-linaro-qcomlt_5.7.bb @@ -23,7 +23,7 @@ LOCALVERSION ?= "-linaro-lt-qcom" SRCBRANCH ?= "release/qcomlt-5.7" SRCREV ?= "4af49ea41ecf17e5e6243f3ac81dfc2f84d8a3a1" -COMPATIBLE_MACHINE = "(apq8016|apq8096|sdm845|sm8250)" +COMPATIBLE_MACHINE = "(qcom)" # Wifi firmware has a recognizable arch :( ERROR_QA_remove = "arch" diff --git a/recipes-kernel/linux/linux-linaro-qcomlt_5.9.bb b/recipes-kernel/linux/linux-linaro-qcomlt_5.9.bb index a1af3c0..118ff78 100644 --- a/recipes-kernel/linux/linux-linaro-qcomlt_5.9.bb +++ b/recipes-kernel/linux/linux-linaro-qcomlt_5.9.bb @@ -15,4 +15,4 @@ SRCREV ?= "b5ff44498a19a685aa10a07ec67e3d12bc95a33a" SRCBRANCH_sm8250 = "release/rb5/qcomlt-5.9" SRCREV_sm8250 = "6d5a9a5da79684f69e4c66a7cf9108ab4e77025f" -COMPATIBLE_MACHINE = "(apq8016|apq8096|sdm845|sm8250)" +COMPATIBLE_MACHINE = "(qcom)" diff --git a/recipes-kernel/linux/linux-qcom-bootimg.inc b/recipes-kernel/linux/linux-qcom-bootimg.inc index cfa0cf5..15b3397 100644 --- a/recipes-kernel/linux/linux-qcom-bootimg.inc +++ b/recipes-kernel/linux/linux-qcom-bootimg.inc @@ -1,57 +1,104 @@ -DEPENDS += "skales-native" - -QCOM_BOOTIMG_ROOTFS ?= "undefined" -SD_QCOM_BOOTIMG_ROOTFS ?= "undefined" - -# set output file names -KERNEL_CMDLINE = "root=${1} rw rootwait console=${ttydev},${baudrate}n8" -KERNEL_CMDLINE_append_dragonboard-845c = " clk_ignore_unused pd_ignore_unused" -KERNEL_CMDLINE_append_qrb5165-rb5 = " pcie_pme=nomsi" - -# param ${1} partition where rootfs is located -# param ${2} output boot image file name -# param ${3} kernel imagename -priv_make_image() { - ${STAGING_BINDIR_NATIVE}/skales/mkbootimg --kernel ${3} \ - --ramdisk ${B}/initrd.img \ - --output ${DEPLOYDIR}/${2}.img \ - --pagesize ${QCOM_BOOTIMG_PAGE_SIZE} \ - --base ${QCOM_BOOTIMG_KERNEL_BASE} \ - --cmdline "${KERNEL_CMDLINE}" +QIMG_DEPLOYDIR = "${WORKDIR}/qcom_deploy-${PN}" + +python do_qcom_img_deploy() { + import shutil + import subprocess + + subdir = d.getVar("KERNEL_DEPLOYSUBDIR") + if subdir is not None: + qcom_deploy_dir = os.path.join(d.getVar("QIMG_DEPLOYDIR"), subdir) + image_dir = os.path.join(d.getVar("DEPLOY_DIR_IMAGE"), subdir) + else: + qcom_deploy_dir = d.getVar("QIMG_DEPLOYDIR") + image_dir = d.getVar("DEPLOY_DIR_IMAGE") + + B = d.getVar("B") + D = d.getVar("D") + kernel_output_dir = d.getVar("KERNEL_OUTPUT_DIR") + kernel_imagedest = d.getVar("KERNEL_IMAGEDEST") + kernel = os.path.join(B, "kernel-dtb") + definitrd = os.path.join(B, "initrd.img") + mkbootimg = os.path.join(d.getVar("STAGING_BINDIR_NATIVE"), "skales", "mkbootimg") + kernel_image_name = d.getVar("KERNEL_IMAGE_NAME") + kernel_link_name = d.getVar("KERNEL_IMAGE_LINK_NAME") + output_img = os.path.join(qcom_deploy_dir, "boot-%s.img" % (kernel_link_name)) + output_sd_img = os.path.join(qcom_deploy_dir, "boot-sd-%s.img" % (kernel_link_name)) + + arch = d.getVar("ARCH") + if arch is "arm": + kernel_name = "zImage" + elif arch is "arm64": + kernel_name = "Image.gz" + else: + bb.fatal("Unuspported ARCH %s" % arch) + + if os.path.exists(output_img): + os.unlink(output_img) + if os.path.exists(output_sd_img): + os.unlink(output_sd_img) + + with open(definitrd, "w") as f: + f.write("This is not an initrd\n") + + for dtbf in d.getVar("KERNEL_DEVICETREE").split(): + dtb = os.path.basename(dtbf) + dtb_name = dtb.rsplit('.', 1)[0] + + def getVarDTB(name): + return d.getVarFlag(name, dtb_name) or d.getVar(name) + + def make_image(template, rootfs): + output = os.path.join(qcom_deploy_dir, template % (dtb_name, kernel_image_name)) + output_link = os.path.join(qcom_deploy_dir, template % (dtb_name, kernel_link_name)) + subprocess.check_call([mkbootimg, + "--kernel", kernel, + "--ramdisk", definitrd, + "--output", output, + "--pagesize", getVarDTB("QCOM_BOOTIMG_PAGE_SIZE"), + "--base", getVarDTB("QCOM_BOOTIMG_KERNEL_BASE"), + "--cmdline", "root=%s rw rootwait %s %s" % (rootfs, consoles, getVarDTB("KERNEL_CMDLINE_EXTRA") or "")]) + if os.path.exists(output_link): + os.unlink(output_link) + os.symlink(os.path.basename(output), output_link) + return output + + consoles = ' '.join(map(lambda c: "console=%(tty)s,%(rate)sn8" % dict(zip(("rate", "tty"), c.split(';'))), getVarDTB("SERIAL_CONSOLES").split())) + + # prepare kernel image with appended dtb + with open(kernel, 'wb') as wfd: + with open(os.path.join(kernel_output_dir, kernel_name), 'rb') as rfd: + shutil.copyfileobj(rfd, wfd) + with open(os.path.join(D, kernel_imagedest, dtb), 'rb') as rfd: + shutil.copyfileobj(rfd, wfd) + + rootfs = getVarDTB("QCOM_BOOTIMG_ROOTFS") + if not rootfs or rootfs is "": + bb.fatal("QCOM_BOOTIMG_ROOTFS is undefined") + + output = make_image("boot-%s-%s.img", rootfs) + if not os.path.exists(output_img): + os.symlink(os.path.basename(output), output_img) + + sd_rootfs = getVarDTB("SD_QCOM_BOOTIMG_ROOTFS") + if sd_rootfs: + output = make_image("boot-sd-%s-%s.img", sd_rootfs) + if not os.path.exists(output_sd_img): + os.symlink(os.path.basename(output), output_sd_img) } -do_deploy_append() { - - tmp="${SERIAL_CONSOLES}" - baudrate=`echo $tmp | sed 's/\;.*//'` - ttydev=`echo $tmp | sed -e 's/^[0-9]*\;//' -e 's/\s.*//' -e 's/\;.*//'` - - # mkbootimg requires an initrd file, make fake one that will be ignored - # during boot - echo "This is not an initrd" > ${B}/initrd.img - - # don't build bootimg if rootfs partition is not defined - if [ "${QCOM_BOOTIMG_ROOTFS}" = "undefined" ]; then - bbfatal "Rootfs partition must be defined" - fi - - for dtbf in ${KERNEL_DEVICETREE}; do - dtb=`normalize_dtb "$dtbf"` - dtb_ext=${dtb##*.} - dtb_base_name=`basename $dtb .$dtb_ext` - priv_make_image ${QCOM_BOOTIMG_ROOTFS} boot-$dtb_base_name-${KERNEL_IMAGE_NAME} ${deployDir}/Image.gz-$dtb_base_name-${KERNEL_DTB_NAME}.$dtb_ext.bin - ln -sf boot-${dtb_base_name}-${KERNEL_IMAGE_NAME}.img ${DEPLOYDIR}/boot-${dtb_base_name}-${KERNEL_IMAGE_LINK_NAME}.img - if [ ! -h ${DEPLOYDIR}/boot-${KERNEL_IMAGE_LINK_NAME}.img ]; then - ln -sf boot-${dtb_base_name}-${KERNEL_IMAGE_NAME}.img ${DEPLOYDIR}/boot-${KERNEL_IMAGE_LINK_NAME}.img - fi - - # build sd boot image only for machines supporting it. - if [ "${SD_QCOM_BOOTIMG_ROOTFS}" != "undefined" ]; then - priv_make_image ${SD_QCOM_BOOTIMG_ROOTFS} boot-sd-$dtb_base_name-${KERNEL_IMAGE_NAME} ${deployDir}/Image.gz-$dtb_base_name-${KERNEL_DTB_NAME}.$dtb_ext.bin - ln -sf boot-sd-${dtb_base_name}-${KERNEL_IMAGE_NAME}.img ${DEPLOYDIR}/boot-sd-${dtb_base_name}-${KERNEL_IMAGE_LINK_NAME}.img - if [ ! -h ${DEPLOYDIR}/boot-sd-${KERNEL_IMAGE_LINK_NAME}.img ]; then - ln -sf boot-sd-${dtb_base_name}-${KERNEL_IMAGE_NAME}.img ${DEPLOYDIR}/boot-sd-${KERNEL_IMAGE_LINK_NAME}.img - fi - fi - done +do_qcom_img_deploy[depends] += "skales-native:do_populate_sysroot" + +addtask qcom_img_deploy after do_populate_sysroot do_packagedata bundle_initramfs before do_deploy + +# Setup sstate, see deploy.bbclass +SSTATETASKS += "do_qcom_img_deploy" +do_qcom_img_deploy[sstate-inputdirs] = "${QIMG_DEPLOYDIR}" +do_qcom_img_deploy[sstate-outputdirs] = "${DEPLOY_DIR_IMAGE}" + +python do_qcom_img_deploy_setscene () { + sstate_setscene(d) } +addtask do_qcom_img_deploy_setscene +do_qcom_img_deploy[dirs] = "${QIMG_DEPLOYDIR} ${B}" +do_qcom_img_deploy[cleandirs] = "${QIMG_DEPLOYDIR}" +do_qcom_img_deploy[stamp-extra-info] = "${MACHINE_ARCH}" |