|
| 1 | +# Building CuOS Image Files |
| 2 | + |
| 3 | +This guide explains how to build CuOS system images for different platforms (from Docker images). |
| 4 | + |
| 5 | +"Image" means, that it copies the OS directly on the target. To install it using a secondary media (e.g., USB stich or virtual cdrom device) see [Installer](./installation.md). |
| 6 | + |
| 7 | +## Prerequisites |
| 8 | + |
| 9 | + * A `system.json` configuration file (see [under the variants](../development-guide.md)) |
| 10 | + * A Docker environment to build the installation media ON the same machine architecture as the target system. Note: Building ARM64 images on x86_64 hosts (or vice versa) is not supported |
| 11 | + * Access to a container registry |
| 12 | + |
| 13 | +## Image Factory |
| 14 | + |
| 15 | +The image-factory creates bootable images with the CuOS partition scheme. |
| 16 | + |
| 17 | +### Configuration |
| 18 | + |
| 19 | +Create a `system.json` file with your image configuration: |
| 20 | + |
| 21 | +```json |
| 22 | +{ |
| 23 | + "os_image": "your-registry/your-os-image", |
| 24 | + "os_image_version": "1.0.0", |
| 25 | + "os_image_digest": "", |
| 26 | + "updater_image": "ghcr.io/cuos-dev/cuos-updater", |
| 27 | + "updater_image_version": "latest", |
| 28 | + "updater_image_digest": "" |
| 29 | +} |
| 30 | +``` |
| 31 | + |
| 32 | +### Creating Images |
| 33 | + |
| 34 | +```bash |
| 35 | +./image-factory/start.sh path/to/system.json |
| 36 | +``` |
| 37 | + |
| 38 | +The created image will be available at `./output/image.img`. |
| 39 | + |
| 40 | +### Image Structure |
| 41 | + |
| 42 | +The created image includes: |
| 43 | +1. BIOS boot partition |
| 44 | +2. EFI System Partition (ESP) |
| 45 | +3. Root filesystem partition |
| 46 | + - BTRFS filesystem |
| 47 | + - Automatic snapshot management |
| 48 | + |
| 49 | +For more details, see [BTRFS Usage Guide](./btrfs-usage.md). |
| 50 | + |
| 51 | + |
| 52 | +## Platform-Specific Images |
| 53 | + |
| 54 | +### x86_64 Systems |
| 55 | +Standard image creation process as described above. |
| 56 | + |
| 57 | +### Raspberry Pi (ARM64) |
| 58 | +Use the Raspberry Pi specific image configuration: |
| 59 | +```json |
| 60 | +{ |
| 61 | + "rpi-arm64_image": "your-registry/your-rpi-image", |
| 62 | + "rpi-arm64_image_version": "1.0.0", |
| 63 | + "rpi-arm64_image_digest": "" |
| 64 | +} |
| 65 | +``` |
| 66 | + |
| 67 | +## Image Formats and Conversion |
| 68 | + |
| 69 | +Convert between formats using qemu-img: |
| 70 | +```bash |
| 71 | +# Convert to QCOW2 |
| 72 | +qemu-img convert -f raw -O qcow2 image.img image.qcow2 |
| 73 | + |
| 74 | +# Convert to VHD |
| 75 | +qemu-img convert -f raw -O vpc image.img image.vhd |
| 76 | +``` |
| 77 | + |
| 78 | +## Using the Image on Physical disks: |
| 79 | + |
| 80 | +1. Write the image to a physical device (e.g., USB drive): |
| 81 | + ```bash |
| 82 | + dd if=image.img of=/dev/sdX bs=1M status=progress |
| 83 | + ``` |
| 84 | +2. Boot from the device and follow on-screen instructions. |
| 85 | + |
| 86 | +Note: The first boot may take longer as the system resizes partitions and sets up the filesystem. |
| 87 | + |
| 88 | +## Using the image on Proxmox VE |
| 89 | + |
| 90 | +1. Upload the `image.img` to your Proxmox server. |
| 91 | +2. Convert the raw image to a Proxmox-compatible format (e.g., QCOW2): |
| 92 | + ```bash |
| 93 | + qemu-img convert -f raw -O qcow2 image.img image.qcow2 |
| 94 | + ``` |
| 95 | +3. Create a new VM in Proxmox without a disk. |
| 96 | +4. Upload the converted image to the VM's disk storage: |
| 97 | + ```bash |
| 98 | + qm importdisk <VMID> image.qcow2 <STORAGE> |
| 99 | + ``` |
| 100 | +5. Attach the disk to the VM and configure boot options. |
0 commit comments