Building and Customizing qcom-multimedia-image with Yocto¶
The purpose of this page is to outline how to build the qcom-multimedia-image from source.
Please be aware that rebuilding from source takes considerable hardware space (~120 GB) and execution time (depending on the capabilities of your machine a fresh build can take 2-10 hours).
Setting Up the Build Environment¶
This section details the steps needed to prepare for a Yocto build. These steps do not need to be re-run for rebuilds (e.g. source or configuration changes after an initial build).
Note that these steps were validated on a machine running Ubuntu 24.04 with repo, git and docker installed. You should be able to run these steps on any system that has repo, git and docker.
- Create a top level directory for your build: We will refer to this directory as ${YOCTO_BUILD_DIR} moving forward.
- Initialize the repo manifest for the Qualcomm Yocto build: This initializes the repo tool with the Qualcomm manifest and branch specific to the qcom-linux-scarthgap release and also clones the QIM meta-layer for camera support.
repo init -u https://github.com/quic-yocto/qcom-manifest -b qcom-linux-scarthgap -m qcom-6.6.90-QLI.1.5-Ver.1.1_qim-product-sdk-2.0.1.xml
- Synchronize the repositories: Downloads all the source layers specified in the manifest.
repo sync
- Clone the Critical Link meta-layer for the dev kit: Adds Critical Link's custom Yocto layer for the MitySOM-QC6490/5430 development kit.
git clone https://support.criticallink.com/git/meta-mitysom-qc6490-5430-devkit.git -b scarthgap layers/meta-mitysom-qc6490-5430-devkit
- The
scarthgapbranch contains the latest regression tested release. - The
scarthgap-nextbranch is where new features are being staged for release. This allows for early access to new features, but has not yet been regression tested and git history may be re-written. Please only use this branch if you are willing to accept the risks of these caveats.
- The
- Pull a Docker image for running the Yocto build: This pulls a Docker image from the crops project that will have everything we need to build the image.
docker pull crops/poky:ubuntu-22.04
You are now ready to continue to Building the Image
Building the Image¶
This section details the steps to build from source, once you have completed the steps in Setting Up the Build Environment. If changes are made to source files, etc. only these steps need to be run to create a new image with said changes.
- Navigate to the ${YOCTO_BUILD_DIR} directory: This was created after following the steps in Setting Up the Build Environment and should have a sub-directory called layers in it.
- Start the Yocto Docker environment: Launches a Docker container with the required Ubuntu base image for building the image.
docker run --rm -it -e LOCAL_USER_ID=`id -u $USER` -v `pwd`:/work crops/poky:ubuntu-22.04 --workdir=/work /bin/bash
- Set the additional layer for the build: This declares your custom meta-layer so it’s picked up during the environment setup.
export EXTRALAYERS="meta-mitysom-qc6490-5430-devkit meta-qcom-qim-product-sdk"
- Source the environment setup script: This configures the Yocto environment for the selected machine and distribution.
MACHINE=qcs6490-mitysom-devkit DISTRO=qcom-wayland QCOM_SELECTED_BSP=custom source setup-environment
- Build the image: Starts the build for the
qcom-multimedia-image.bitbake qcom-multimedia-image
Once bitbake has completed successfully ${YOCTO_BUILD_DIR}/build-qcom-wayland/tmp-glibc/deploy/images/qcs6490-mitysom-devkit/qcom-multimedia-image is the directory to navigate to in order to run the qdl tool to program the SOM.
See Programming the MitySOM QC6490 for further details on using the qdl tool to program the SOM.
Note that if you are trying to locate the build outputs from within the docker instanceafter running the previous commands, your pwd will be ${YOCTO_BUILD_DIR}/build-qcom-wayland.
Customizing qcom-multimedia-image¶
This section will detail some common changes you may want to make to customize the image you are building.
Adding Packages to the Filesystem¶
- Update
IMAGE_INSTALL:appendin${YOCTO_BUILD_DIR}/layers/meta-mitysom-qc6490-5430-devkit/recipes-products/images/qcom-multimedia-image.bbappend
Kernel Development¶
The kernel for the MitySOM-QC is based on the linux-qcom-custom recipe. ${YOCTO_BUILD_DIR}/layers/meta-mitysom-qc6490-5430-devkit/recipes-kernel/linux/linux-qcom-custom_6.6.bbappend specifies how patches are applied on top of linux-qcom-custom at build time.
In order to see and modify the source of the kernel, please utilize the following steps:
- Checkout a patched version of the kernel: This will extract a copy of the kernel from qualcomm's site, and apply all the patches from any bitbake recipes into the
${YOCTO_BUILD_DIR}/build-qcom-*/workspace/sources/linux-qcom-customarea.devtool modify linux-qcom-custom
- Update the kernel config: Launches menuconfig and saves config changes to a devtool-generated fragment file.
devtool menuconfig linux-qcom-custom
- Make changes to the kernel source or dts: In the workspace area, make any changes needed to kernel as normal. You can build kernel outputs running the command below.
devtool build linux-qcom-custom
- Build all outputs with your kernel/device tree changes: This rebuilds the full image including your kernel and device tree updates.
devtool build-image qcom-multimedia-image
- When you are happy with your changes: Commit your changes on the local branch as you would for a normal development cycle.
- Note: You may need to commit from inside the docker
- Generate Patch Files in meta layer: When you are ready to migrate patches over to the meta-layer, run one of two the commands below:
- This will generate patch files and update the bbappend file SRCURIs and maintains the working folder to allow continued development:
devtool update-recipe linux-qcom-custom -a ../layers/meta-mitysom-qc6490-5430-devkit
- This will generate patch files and update the bbappend file SRCURIs and finish will clean up / move the working folder to an archive area:
devtool finish linux-qcom-custom ../layers/meta-mitysom-qc6490-5430-devkit
- This will generate patch files and update the bbappend file SRCURIs and maintains the working folder to allow continued development:
- Save defconfig changes to your layer: Once your done developing/debugging, to persist config updates, append the devtool fragment to your meta layer (e.g.
mitysom-kernel-fragment.cfg) or create a new fragment file and update our layer's kernel bbappend. If you create a new fragment file, you will need a new "KERNEL_CONFIG_FRAGMENTS:append" line.# Append this: /work/build-qcom-wayland/workspace/sources/linux-qcom-custom/oe-local-files/devtool-fragment.cfg # To this: meta-mitysom-qc6490-5430-devkit/recipes-kernel/linux/linux-qcom-custom/mitysom-kernel-fragment.cfg
Updating Devicetree¶
If you only need to update Devicetree, the following steps will be quicker than rebuilding the entire qcom-multimedia-image:
- Checkout a patched version of the kernel: This will extract a copy of the kernel from qualcomm's site, and apply all the patches from any bitbake recipes into the
${YOCTO_BUILD_DIR}/build-qcom-*/workspace/sources/linux-qcom-customarea.devtool modify linux-qcom-custom
- Modify the desired dts file(s)
- e.g.
${YOCTO_BUILD_DIR}/build-qcom-*/workspace/sources/linux-qcom-custom/arch/arm64/boot/dts/qcom/mitysom-qc6490-devkit.dtsis the top level dts file for the MitySOM-QC Development Kit.
- e.g.
- Build the DTB
devtool build-image dtb-qcom-image
- Update the DTB on your MitySOM-QC
- Ensure you have fastboot installed on your host PC
- e.g.
sudo apt install android-tools-fastbooton Ubuntu (24.04)
- e.g.
- Boot the MitySOM-QC in
fastbootmode- Power the SOM on while holding the
Vol Downbutton- Note that this can be accomplished by applying 12V to the Development Kit, then holding
Vol Downwhile plugging in the USB-C cable connected to your PC
- Note that this can be accomplished by applying 12V to the Development Kit, then holding
- If successful you should see
Android Fastboot modenear the bottom of the console output- Note that if you try to boot into
fastbootmode without USB-C connected you will seeReboot into firmware interface not supported. ???????????????????????????????????????????????????
- Note that if you try to boot into
- Power the SOM on while holding the
- Flash
${YOCTO_BUILD_DIR}/build-qcom-*/tmp-glibc/deploy/images/qcs6490-mitysom-devkit/dtb-qcom-image-qcs6490-mitysom-devkit.rootfs.vfatfastboot flash dtb_a dtb-qcom-image-qcs6490-mitysom-devkit.rootfs.vfat
- Press any key on the console to continue the boot process
- Ensure you have fastboot installed on your host PC
Issues¶
If you have any issue please make sure to post in the forums so that we can provide support.
Go to top