Skip to main content
Azure Linux’s build system is a sophisticated, multi-stage architecture built on Make and Go tools that transforms source specifications into bootable images. This page provides a high-level understanding of how the system operates.

Architecture Components

The build system consists of three primary components:

Tooling

Makefiles, Go programs, Docker bootstrap environment, and chroot build environment

Package Generation

SRPM creation, dependency resolution, and RPM building

Image Generation

Filesystem composition, package installation, and image formatting

Build Flow Overview

The complete build process follows this high-level flow:
The flowcharts throughout this documentation use consistent color coding:
  • Blue: Input/output files and collections
  • Brown: Process steps
  • Purple: Decision points
  • Green: Success states
  • Red: Error states

RPM Package Flow

Azure Linux is an RPM-based distribution. Each package is built from sources, patches, and a spec file, with signatures verifying source integrity:

Make-Based System

The build system is based on Make, which tracks file dependencies and modification times to determine what needs rebuilding. This approach:
  • Rebuilds targets only when dependencies change
  • Works hierarchically with file-based dependencies
  • Uses advanced patterns for folder dependencies and configuration tracking
  • Splits logic across multiple *.mk files under ./scripts
Key Advantage: Make’s dependency tracking ensures efficient rebuilds—only changed components are recompiled, saving significant build time in iterative development.

Build Targets

You can control the build process at different stages:
TargetDescription
make toolchainBuild or download the toolchain RPMs
make input-srpmsCreate source RPMs from local specs
make build-packagesBuild all required packages
make imageGenerate final disk images
make isoCreate bootable ISO installers

Build Modes

The system supports multiple build modes via Make variables:
make image
Downloads pre-built toolchain RPMs from remote servers (default, fastest)

Clean Build Environment

All packages are built in isolated chroot environments populated with toolchain RPMs. This ensures:
  • Reproducible builds across different host systems
  • No interference from host system tools or libraries
  • Consistent build environment matching the target OS
  • Safe package building with automatic cleanup on errors
The chroot worker is an archive containing all toolchain RPMs installed into a minimal filesystem. Each package build extracts this archive into a fresh directory, providing complete isolation.

Architecture Deep Dive

For detailed information about each component, see:

Initial Preparation

Makefiles, Go tooling, toolchain, and chroot environments

Local Packages

SPEC files, source management, and SRPM creation

Package Building

Dependency graphing, fetching, and parallel building

Image Generation

Image composition, package installation, and format conversion

Build Logs

Understanding and troubleshooting build errors

Next Steps

Initial Preparation Phase

Learn about the toolchain, Go tools, and build environment setup

Build docs developers (and LLMs) love