Swiss army knife to manipulate operating system images for single-board computers โ the engine behind every distro on this site
xsysroot mounts, modifies, snapshots and repacks whole OS images for SBCs โ Raspberry PIs, Beaglebones and friends โ right from your x86 laptop or a tiny VPS. It binds image files through NBD, layers all changes into an incremental qcow2 file (your original image is never touched), and chroots into the result using QEMU user-mode ARM emulation, so apt-get, debuild and full installers run natively for the target architecture.
1. Blank image: xsysroot --geometry "raspbian.img fat32:40 ext4:800" โ 40MB FAT32 boot + 800MB ext4 root.
2. Write a JSON profile (nbdev, sysroot, backing_image, qcow_image...).
3. Bind and mount: xsysroot --profile raspbian --renew โ the qcow overlay is created from the pristine backing image; mount points appear on the host. Docs' own words: "wow... how scary!" โ three things happened, all fine.
4. Install Debian in two stages:
$ sudo debootstrap --foreign --variant=minbase --arch=armhf jessie \
$(xsysroot --query sysroot) http://mirror/raspbian/
$ sudo cp $(which qemu-arm-static) $(xsysroot -q sysroot)/usr/bin
$ xsysroot -x "/debootstrap/debootstrap --second-stage"5. Firmware: xsysroot --chroot, point apt at Raspbian, install curl + binutils, run rpi-update, write cmdline.txt, set root password.
6. Bake and burn: qemu-img convert $(xsysroot --query qcow_image) raspbian-bootable.img then dd to the SD card. A one-gigabyte image with ~200MB free, tested on real hardware. No SD-card shuffling during the build.
Every image served on this site โ pipaOS builds, KivyPie 0.3 to 1.0, PiCute, PiLove, KanoUbuntu, even the weekly RaspiMirror builds โ came out of xsysroot. It abstracted mount-image, chroot, build, snapshot, ship into one modest Python script and was later packaged for ArchLinux. Not bad for a tool named after its own quest.
xsysroot is free software. The complete documentation PDF โ including the famous wow... how scary! debootstrap step and the QCow chapter โ lives on GitHub.