Last updated:

genpack-install CLI Reference

Overview

genpack-install is a tool for deploying SquashFS system images generated by genpack to physical disks, ISO images, and ZIP archives.

genpack-install [options] [system_image]

Root privileges are required.

Options

Positional Arguments

ArgumentRequiredDescription
system_imageDepends on modeSystem image file (SquashFS)

Required in self-update mode. Optional in --disk, --cdrom, and --zip modes — when omitted, the currently installed system image is used.

Named Options

OptionTypeDefaultDescription
--disk <PATH>String(none)Disk device path. Specify list to show installable disks
--cdrom <PATH>String(none)Path of ISO9660 image to create
--zip <PATH>String(none)Path of ZIP archive to create
--system-cfg <PATH>Path(none)Install specified system.cfg file
--system-ini <PATH>Path(none)Install specified system.ini file
--label <NAME>String(none)Volume label for boot partition or ISO image
--gptFlagfalseAlways use GPT instead of MBR
--superfloppyFlagfalseUse whole disk instead of partitioning
--no-espFlagfalseDon’t mark boot partition as ESP
--additional-boot-files <PATH>Path(none)ZIP archive containing additional boot files
-yFlagfalseSkip confirmation prompts
--debugFlagfalseShow debug messages

Operation Modes

genpack-install has 4 operation modes depending on the combination of arguments.

Self-Update (arguments only, no mode options)

genpack-install <system_image>

Atomically updates the system image of a running system. This mode is used when none of --disk, --cdrom, or --zip are specified.

Update procedure:

  1. Locate the current system image path (boot partition’s system.img or data partition’s system)
  2. Validate the new system image
  3. Update boot files (kernel, initramfs, bootloader)
  4. Atomic rename swap:

On failure, automatic recovery from system.cur is attempted.

Disk Installation (--disk)

genpack-install --disk=<device path> [options] [system_image]
genpack-install --disk=list

Installs a system image to a physical disk.

Specifying --disk=list shows a list of installable disks. Read-only devices, mounted devices, and devices smaller than 4GiB are excluded.

Partitioning:

Normal mode (with partitioning) layout:

  1. Boot partition (FAT32): Stores kernel, initramfs, bootloader, and system images under 4GiB
  2. Data partition (Btrfs): Stores system images 4GiB or larger. Labeled data-{boot partition UUID}

Specifying --no-esp prevents the boot partition from being marked as ESP (EFI System Partition). Use this when certain bootloaders dislike the ESP flag (only effective with MBR).

A confirmation prompt is shown before installation. Use -y to skip.

ISO Image Creation (--cdrom)

genpack-install --cdrom=<output path> [--label=<label>] [system_image]

Creates a bootable ISO9660 image. Requires xorriso (libisoburn) to be installed.

When --label is omitted, the volume label defaults to GENPACK.

ZIP Archive Creation (--zip)

genpack-install --zip=<output path> [system_image]

Creates a ZIP archive containing the system image and boot files.

Files included in the ZIP:

Bootloader

genpack-install uses GRUB as the bootloader. Bootloader files are searched in the following order:

  1. /usr/lib/genpack-install/ inside the system image
  2. /usr/local/lib/genpack-install/ on the host
  3. /usr/lib/genpack-install/ on the host

Installed files:

Supported architectures:

ArchitectureBIOSUEFI
x86_64boot.img + core.imgbootx64.efi
i386boot.img + core.imgbootia32.efi
aarch64bootaa64.efi
riscv64bootriscv64.efi

Raspberry Pi support:

When the system image contains boot/bootcode.bin, it is treated as a Raspberry Pi image. All files under the boot/ directory are copied to the boot partition, and the root= parameter in cmdline.txt is rewritten to root=systemimg:auto.

grub.cfg system.img search logic:

  1. If system.img exists on the boot partition, use it
  2. Otherwise, search for a partition labeled data-{boot partition UUID}
  3. Then search for label d-{boot partition UUID}
  4. As a last resort, infer from boot partition number (partition 1 → try partition 2)

Partition Layout

Boot Partition (FAT32)

Boot partition size is max(4, image_size_gib * 3 + 1) GiB when the system image is under 4GiB, or 1 GiB when 4GiB or larger.

Data Partition (Btrfs)

System Image Validation

genpack-install validates system images before installation:

  1. A .genpack/ directory must exist
  2. One of the following must be satisfied:

Upon passing validation, the contents of .genpack/artifact and .genpack/variant are displayed.

Source References

This document was written based on the following repository snapshots:

Update History