Description This pull request introduces improvements to the raw_image.py script responsible for building raw disk images in the VyOS build process. Main Changes Added use of kpartx to reliably map EFI and root partitions from the loop device. Introduced disk_details as an attribute on the BuildContext object to pass partition metadata through the image build steps. Improved the __exit__ method for BuildContext to unmount all mount points and clean up kpartx mappings and loop devices, even in failure cases. Fixed a crash in mount_image() when con.disk_details was not set. Added useful debug logs for loop device usage and partition mapping. Motivation The previous implementation assumed partitions like /dev/loopXp3 would appear automatically, which is unreliable across some environments (especially containers or newer systems). This PR makes the process more reliable by explicitly mapping partitions with kpartx, a tool designed for this purpose. It also ensures proper resource cleanup by unmounting and detaching everything cleanly, preventing leaked loop devices or stale mount points. Test Instructions Flavor : cloud-init.toml packages = [ "cloud-init", "qemu-guest-agent" ] image_format = ["qcow2"] disk_size = 10 [boot_settings] console_type = "ttyS0" Run: sudo ./build-vyos-image --architecture amd64 \ --build-by "you@example.com" \ --reuse-iso vyos-1.5-rolling-*.iso \ cloud-init Expected behavior: The build completes without errors. The .qcow2 image file is generated and bootable (e.g., in KVM or Proxmox). Partitions are mounted correctly via /dev/mapper/loopXp*. Signed-off-by: Gabin-CC <gabin.laurent@rte-international.com>
VyOS toplevel build
For the most up-to-date documentation, please read the online build guide at docs.vyos.io.
What is VyOS
VyOS is an open source operating system for network devices (routers, firewalls and so on). If you want to use it in your network, check out download and installation instructions at https://docs.vyos.io/en/latest/installation/index.html
If you want to modify VyOS and/or join its development, read on.
About this repository
VyOS is a GNU/Linux distribution based on Debian. Just like any other distribution, it consists of multiple packages.
Some packages are taken from the upstream, while other are modified or written from scratch by VyOS developers. Every package maintained by the VyOS team has its own git repository. VyOS image build is therefore a multi-step process. Packages are compiled first, then an ISO is built from Debian packages and our own packages.
This is the top level repository that contains links to repositories with VyOS specific packages (organized as Git submodules) and scripts and data that are used for building those packages and the installation image.
Repository Structure
There are several directories with their own purpose:
build/Used for temporary files used for the build and for build artifactsdata/Data required for building the ISO (e.g. boot splash/configs)packages/This directory can hold arbitrary *.deb packages which will be embeded into the resulting ISO. Among other things those packages will be: Linux Kernel, FRR, Netfiler...scripts/Scripts that are used for the build processtools/Scripts that are used for maintainer's tasks automation and other purposes, but not during ISO build process
Building VyOS
In order to have a single manual and not maintining multiple copies the instructions on how to build VyOS either in a Docker container or natively can be found in our Documentation - Build VyOS.
Development Branches
The default branch that contains the most recent VyOS code is called current.
We may or may not eventually switch to main.
All new code goes to the current branch. When a new LTS release is ready for feature freeze, a
new branch is created for the release, and new code from current is backported
to the release branch as needed.
Post-1.2.0 branches are named after constellations sorted by area from smallest to largest. There are 88 of them, here's the complete list.
Existing branches:
- VyOS 1.4:
sagitta(Arrow) [LTS] - VyOS 1.3:
equuleus(Little Horse) [LTS] - VyOS 1.2:
crux(Southern Cross) [Unsupported]
The next LTS release will be VyOS 1.5 circinus (Compasses).