Skip to content

Build Testing and Troubleshooting

buntatoes edited this page Nov 28, 2026 · 1 revision

Build, Testing, and Troubleshooting

Cinderboot builds from source using only Go 1.24+ with CGO_ENABLED=0 and zero external dependencies. All unit tests run completely offline against temporary virtual disk images — no physical USB hardware is required.


Building from Source

Prerequisites

  • Go 1.24+ (go.mod specifies go 1.24 with zero require entries)
  • make (optional; standard go commands work directly on both Linux and Windows)

Makefile Targets

Target Command Output / Effect
make test CGO_ENABLED=0 go test -v ./... Runs all unit tests across all packages
make vet CGO_ENABLED=0 go vet ./... Runs Go static analysis
make build-linux CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -trimpath -ldflags="..." -o dist/cinderboot ./cmd/cinderboot Builds stripped static Linux amd64 binary
make build-windows CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -trimpath -ldflags="..." -o dist/cinderboot-v<VERSION>-win64.exe ./cmd/cinderboot Cross-compiles stripped static Windows amd64 portable .exe (automatically links cmd/cinderboot/rsrc_windows_amd64.syso icon resource)
make package Runs build-linux + build-windows and packs dist/cinderboot-linux-x86_64.tar.gz Produces both release artifacts in dist/
make clean rm -rf dist Removes build outputs

Cross-Platform Verification Commands

Before opening a pull request, verify static analysis for both Linux and Windows along with the race detector:

go vet ./...
GOOS=windows GOARCH=amd64 go vet ./...
go test -v -race ./...
make package

Continuous Integration (.github/workflows/ci.yml)

Every push and pull request targeting main runs two GitHub Actions jobs on Go 1.24:

  • test-linux (ubuntu-latest): go vet ./..., go test -v -race ./..., static Linux amd64 build + ./cinderboot --version, and cross-compiled static Windows amd64 build.
  • test-windows (windows-latest): go vet ./..., go test -v ./..., and native Windows amd64 build + .\cinderboot.exe --version.

Unit Test Suite Overview

Cinderboot's test suite constructs synthetic virtual USB disks, UDF 1.02 Windows ISOs, Rock Ridge + GPT/ESP Linux ISOs, and synthetic MSWIM archives inside t.TempDir():

Test File Coverage
internal/device/device_test.go TestValidateTargetSafety (valid USB, internal NVMe block, Linux / block, Windows C: block, fixed USB default block & override), TestFormatBytes
internal/fs/fs_test.go TestGPTAndFAT32FormatAndWrite (1 MiB alignment, Primary/Backup GPT CRC32, FAT32 boot/FSInfo/LFN/nested writes), TestWipeAndRelocateUbuntuStyleGPT (stale backup wipe, 248-entry Ubuntu xorriso-style GPT relocation, Protective MBR & CRC updates, idempotent second run)
internal/image/image_test.go TestOpenRawStreamCompressed (.gz and .zip), TestSyntheticUDFWindowsISOInspect (UDF 1.02 AVDP/PVD/LVD/FSD/FID/FE parsing + OpenReaderAt), TestISO9660UUIDPrefersModificationTimestamp, TestDetectPopOSFromEFILoaderAndCustomCasperDir, TestDetectPopOSFromIsolinuxInclude
internal/wim/split_test.go TestSplitWIMRoundTrip (multi-part .swm splitting, FLAG_HEADER_SPANNED, lookup table offsets, per-resource SHA-1 round-trip verification, PartFileName naming)
internal/unattend/unattend_test.go TestGenerateAutoUnattend (disabled no-op, LabConfig keys, BypassNRO, PreventDeviceEncryption, ProtectYourPC, local account XML validation)
internal/flash/flash_test.go TestWriteRawStreamTransientRecovery (2 simulated write stalls recovered + SHA-256 verified), TestWriteRawStreamAndVerifyReadBack (.img.gz stream, verify pass, 1-byte corruption detection), TestWriteRawStreamCancellation, TestWriteMultibootEndToEnd (Ubuntu + Void GPT/ESP/GRUB menu + raw partition byte verification), TestWriteMultibootWithPopOSRockRidge (Ubuntu + Pop!_OS Rock Ridge + systemd-boot ESP + NVIDIA flags)

Contributing Rules

Per CONTRIBUTING.md:

  1. Zero External Dependencies: Keep go.mod strictly on the Go standard library (CGO_ENABLED=0) — no third-party Go modules, web/Electron runtimes, prebuilt bootloader blobs, or external CLI tool dependencies.
  2. SPDX License Header: Begin every new .go file with // SPDX-License-Identifier: GPL-3.0-only.
  3. Linux & Windows Parity: Changes must compile cleanly and pass go vet for both linux/amd64 and windows/amd64.
  4. Hardware Safety First: Never weaken removable-USB filtering, OS-disk detection, or destructive-write confirmation guards.
  5. Branding & Trademarks: Source code is licensed under GNU GPL-3.0; the Cinderboot name, flame-USB logo, icons, and visual identity remain All Rights Reserved by Buntato.

Troubleshooting & FAQ

My external USB SSD / HDD enclosure does not appear in the drive list

Many USB-to-NVMe or USB-to-SATA bridges report Removable = false to the OS. Enable Show fixed USB HDDs in the desktop UI or pass --include-fixed to cinderboot list / cinderboot flash. Note that internal NVMe/SATA drives and OS-mounted disks remain strictly blocked even with this option enabled.

Browse... reports no native file dialog (kdialog/zenity) found on Linux

Cinderboot uses kdialog (KDE) or zenity (GNOME/GTK) for the graphical file picker on Linux to avoid linking GUI toolkits. You can either install zenity or kdialog, or simply paste the full path to your .iso/.img file into the input field and click Inspect.

neither pkexec nor sudo was found on Linux

When running unprivileged on a minimal Linux environment without Polkit (pkexec) or sudo, run cinderboot flash directly as root. When os.Geteuid() == 0, internal/elevate skips spawning a worker and executes flash.Execute directly.

Windows ISO fails with solid ESD archive exceeds 4 GiB and cannot be losslessly split without recompression

Standard Microsoft Windows 10/11 ISOs downloaded directly from Microsoft contain a sources/install.wim archive (or an install.esd smaller than 4 GiB). If a custom/repacked ISO contains a solid-compressed install.esd larger than 4 GiB (wimVersionSolid = 0x00000E00), it cannot be split into .swm parts without recompressing. Use an official Microsoft ISO with install.wim or a <4 GiB install.esd.

Multiboot fails with none of the selected Linux ISOs contain a UEFI GRUB2 bootloader

Because Cinderboot bundles zero third-party bootloader binaries, Multi-Distro USB mode extracts a signed UEFI GRUB2 bootloader directly from one of the selected Linux ISOs. Include at least one GRUB2-based ISO in your multiboot set (such as Ubuntu, Fedora, Debian, Linux Mint, Manjaro, Void, or openSUSE) alongside systemd-boot-only ISOs like Pop!_OS or Arch.

Why did Cinderboot say Relocated Backup GPT to end of USB drive after flashing Ubuntu?

Hybrid GPT ISOs (such as Ubuntu 22.04/24.04+) embed a GPT header whose AlternateLBA points to the end of the ISO file rather than the physical end of your larger USB drive. After raw-flashing and verifying SHA-256, Cinderboot automatically relocates the Backup GPT to the physical tail of the USB drive and updates the Protective MBR and CRCs so strict UEFI motherboards recognize the EFI System Partition reliably.

Why is SHA-256 verification only listed for Raw mode?

In Raw mode (ModeRaw), the exact byte stream written to the USB drive matches the source image (or decompressed stream), allowing an exact byte-for-byte SHA-256 read-back comparison. In windows-fat32, iso-fat32, and multiboot modes, Cinderboot constructs a new GPT + FAT32 filesystem (and optionally splits .wim files or injects autounattend.xml), so the raw disk bytes differ from the source ISO file.

Clone this wiki locally