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

# Prerequisites & host setup

Set up your host computer before building or modifying the Qualcomm<sup>®</sup> Linux kernel.
The requirements below apply to both the Yocto-based and standalone build workflows.

## Host computer requirements

**Table: Minimum host requirements**

| Requirement | Value |
| - | - |
| Architecture | x86\_64 |
| CPU | Quad-core (Intel i7-2600 at 3.4 GHz or equivalent) |
| RAM | 16 GB |
| Free disk space | 300 GB (swap partition > 32 GB recommended for Yocto builds) |
| Operating system | Ubuntu 22.04 LTS |

<Note>
  Building on a virtual machine is supported but significantly slower. For VM
  setup instructions, see the [Qualcomm Linux Virtual Machine Setup Guide](https://dragonwingdocs.qualcomm.com/Key-Documents/Virtual-Machine-Setup/virtual-machine-setup-overview).
</Note>

## Required tools

**Table: Required tool versions**

| Tool | Minimum version |
| - | - |
| Git | 1.8.3.1 |
| Python | 3.10.2 |
| GCC | 10.1 |
| GNU Make | 4.0 |
| Kas | 4.8 |

### Install host packages

Run the following commands to install the required packages and the `kas` build tool:

```bash theme={null}
sudo apt update
sudo apt install build-essential chrpath cpio debianutils diffstat \
    file gawk gcc git iputils-ping libacl1 locales python3 \
    python3-git python3-jinja2 python3-pexpect python3-pip \
    python3-subunit socat texinfo unzip wget xz-utils zstd

sudo apt install pipx
pipx ensurepath
```

Restart your shell (or run `source ~/.bashrc`) so that the `pipx` binary is on
your PATH, then install `kas`:

```bash theme={null}
# kas 4.8 or later is required
pipx install kas
```

Optionally, download the `kas-container` script to run builds inside a Docker
container on any Linux distribution:

```bash theme={null}
wget -qO kas-container \
    https://raw.githubusercontent.com/siemens/kas/refs/tags/5.1/kas-container
chmod +x kas-container
```

### Configure locales

```bash theme={null}
sudo locale-gen en_US.UTF-8
sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
```

### Configure git

```bash theme={null}
git config --global user.email <your-email>
git config --global user.name "Your Name"

# Recommended settings to handle large repositories
git config --global http.postBuffer 1048576000
git config --global http.maxRequestBuffer 1048576000
git config --global http.lowSpeedLimit 0
git config --global http.lowSpeedTime 999999
```

## Standalone kernel development prerequisites

The standalone build workflow uses the `kmake-image` Docker container to provide
the cross-compilation toolchain, `systemd ukify`, and image-packaging scripts.
Docker must be installed on the host before running a standalone build.

### Install Docker CE

To install Docker on Ubuntu, follow the instructions in the [Docker installation guide](https://docs.docker.com/engine/install/ubuntu/#install-using-the-repository).

```bash theme={null}
sudo apt update
sudo apt install ca-certificates curl gnupg

sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg \
    | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg

echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] \
https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" \
    | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io
```

### Add your user to the docker group

```bash theme={null}
getent group docker > /dev/null || sudo groupadd docker
id -nG "$USER" | grep -qw docker || sudo usermod -aG docker "$USER"
newgrp docker
```

<Note>
  Restart the terminal, or log out and log back in, to apply the updated docker group membership.
</Note>

### Verify the installation

```bash theme={null}
docker run --rm hello-world
```

### Pull the kmake-image Docker image

The primary approach is to pull the pre-built `kmake-image` from the registry:

```bash theme={null}
docker pull artifacts.codelinaro.org/clo-420-qli-registry/kmake-image:ver.1.0
```

<Note>
  Pull the hosted image, and then build the image locally only if you need to develop or customize it.
  The `kmake-image` container build and shell alias setup are covered in
  [Build the kernel without Yocto](./build-kernel-standalone).
</Note>

## Repository access

The Qualcomm Linux kernel and `meta-qcom` layer are publicly hosted on GitHub and
require no special credentials:

* Kernel source: [https://github.com/qualcomm-linux/kernel](https://github.com/qualcomm-linux/kernel)
* meta-qcom layer: [https://github.com/qualcomm-linux/meta-qcom](https://github.com/qualcomm-linux/meta-qcom)
