> ## Documentation Index
> Fetch the complete documentation index at: https://dragonwingdocs.qualcomm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Add image recipes

Provides information on how to add image recipes and build using BitBake command.

## **Image recipe concepts**

An image recipe (`.bb` file) defines the complete set of packages installed in the root filesystem. Qualcomm provides reference images in `meta-qcom-distro/recipes-products/images`. For a description of each reference image, see [meta-qcom-distro](./meta-qcom-distro#image-recipes).

## **Qualcomm reference images**

| **Image**                            | **Description**                                                    |
| ------------------------------------ | ------------------------------------------------------------------ |
| `qcom-minimal-image`                 | Minimal rootfs to boot to the shell                                |
| `qcom-console-image`                 | Extends minimal image with SSH and package management              |
| `qcom-multimedia-image`              | Full multimedia packages with upstream components                  |
| `qcom-multimedia-proprietary-image`  | Multimedia image with Qualcomm proprietary features                |
| `qcom-container-orchestration-image` | Multimedia proprietary image with Kubernetes and container runtime |

## **Creating a custom image recipe**

1. To add an image recipe, change the directory to `<workspace>/layers/meta-qcom-distro/recipes-products/images`.
2. Create a file, for example `sample-image.bb`, and add the following content:
   ```text theme={null}
   require qcom-minimal-image.bb

   SUMMARY = "Basic sample image"

   IMAGE_FEATURES += "${@bb.utils.contains('DISTRO_FEATURES', 'sota', '', 'package-management', d)} \
                       ssh-server-openssh"

   CORE_IMAGE_BASE_INSTALL += " \
      packagegroup-qcom-security \
      packagegroup-qcom-utilities-debug-utils \
      packagegroup-qcom-utilities-network-utils \
      packagegroup-qcom-utilities-profile-utils \
      packagegroup-qcom-utilities-support-utils \
   "
   ```
3. Add the `sample-image.bb` file to the `meta-qcom/ci/qcom-distro.yml` CI file, under `target:`:
   ```text theme={null}
   target:
      - qcom-multimedia-image
      - qcom-multimedia-proprietary-image
      - qcom-container-orchestration-image
      - sample-image
   ```
4. Source the environment:
   ```text theme={null}
   kas shell meta-qcom/ci/rb3gen2-core-kit.yml:meta-qcom/ci/qcom-distro.yml
   ```
5. Build using the BitBake command:
   ```text theme={null}
   bitbake sample-image
   ```
   The generated images are as follows:
   ```text theme={null}
   build> $ ls tmp/deploy/images/rb3gen2-core-kit/sample-image.qcomflash/
   aop.mbn     gpt_backup0.bin  gpt_backup5.bin  gpt_main4.bin  kernel-modules.tgz  patch2.xml             prog_firehose_lite.elf  rawprogram2.xml  system.img    xbl_config.elf
   cpucp.elf   gpt_backup1.bin  gpt_main0.bin    gpt_main5.bin  logfs_ufs_8mb.bin   patch3.xml             qdl                     rawprogram3.xml  tz.mbn        xbl.elf
   devcfg.mbn  gpt_backup2.bin  gpt_main1.bin    hypvm.mbn      multi_image.mbn     patch4.xml             qupv3fw.elf             rawprogram4.xml  uefi.elf      XblRamdump.elf
   dtb.bin     gpt_backup3.bin  gpt_main2.bin    Image          patch0.xml          patch5.xml             rawprogram0.xml         rawprogram5.xml  uefi_sec.mbn  zeros_5sectors.bin
   efi.bin     gpt_backup4.bin  gpt_main3.bin    imagefv.elf    patch1.xml          prog_firehose_ddr.elf  rawprogram1.xml         shrm.elf         vmlinux
   ```
