$ show ventoy/Ventoy
Ventoy is a production-grade tool for creating multi-boot USB drives that can boot ISO, WIM, IMG, VHD(x), and EFI files without reformatting the drive. The system operates by installing a custom bootloader stack onto a USB drive, then at boot time using a modified GRUB2 bootloader to present a menu of available images. When an image is selected, a custom initramfs (cpio archive) containing BusyBox and device-mapper tools is loaded, which creates a virtual block device mapping the image's sectors to the physical disk, allowing the OS to boot as if from a real CD/DVD. The architecture spans multiple layers: a UEFI/BIOS boot chain (GRUB2, iPXE, wimboot, EDK2), a runtime initramfs environment, and host-side installation/configuration tools (Windows GUI, Linux Qt/GTK/WebUI, CLI). It supports x86, x86_64, ARM64, and MIPS64EL architectures, and includes per-distro initramfs hooks for over 100 Linux distributions, Windows, and Unix variants (FreeBSD, DragonFly). External dependencies include heavily modified versions of GRUB2 2.04, EDK2 (stable201911), iPXE, wimboot, squashfs-tools, exfat, and embedded libraries like fat_io_lib and xz-embedded. The project is actively maintained with frequent releases and a large community.
The LLM identified 5 files worth highlighting for reuse:
A self-contained, portable FAT12/16/32 filesystem library with pluggable disk I/O callbacks. Used across Ventoy2Disk, Plugson, vtoycli, and vtoyjump. Demonstrates clean abstraction of disk access and supports long filenames, timestamps, and formatting. Could be extracted for any project needing FAT filesystem access without OS dependencies.
A minimal, standalone XZ decompressor (LZMA2) derived from the Linux kernel's xz-embedded. Used in multiple Ventoy components for decompressing kernel images and initramfs. Demonstrates careful memory management and stream handling. Reusable in any embedded or bootloader context requiring XZ decompression without external dependencies.
A custom JSON builder and parser implemented in C with a macro-based API. Used by Ventoy's plugin system and configuration handling. Demonstrates non-obvious skill in writing a compact, memory-efficient JSON implementation suitable for bootloader environments where standard libraries are unavailable. Could be reused in any resource-constrained system.
A UEFI application that creates a virtual disk from a Ventoy image map, hooks EFI runtime services (GetVariable, ExitBootServices) to bypass Secure Boot and fix memory maps, then loads and boots the target OS. Demonstrates deep understanding of UEFI internals, protocol wrapping, and virtual block device creation. Reusable as a reference for any UEFI-based virtual disk or boot shim.
A shell library used in initramfs hooks to detect the Ventoy disk, load device-mapper modules, create udev rules, and set up the virtual block device. Demonstrates a robust pattern for injecting custom logic into Linux initramfs across many distributions. The parameterized design and fallback mechanisms make it adaptable to other boot-time disk virtualization scenarios.