Ideas for next-generation qubes-builder

Here is a quick overview of the bricks we would need to use ISAR, with the existing ones in blue. I did not include the generation of dom0 packages (not much different from template rpm’s, except for the chroot to use) and installer. PNG included for reader’s convenience, it seems we don’t have the graphviz discourse plugin available.

Building a rootfs is the core task if ISAR, and it is not too hard to build one following the instructions (for now I’ve used this for an uncustomized image, producing both a rootfs partition usable for a PVH and a legacy-bios boot image for HVM):

user@isar-build:~/isar$ . isar-init-build-env ../build
...
user@isar-build:~/build$ cat >> conf/local.conf 
MACHINE = "qemuamd64"
DISTRO = "debian-buster"
DISTRO_ARCH = "amd64"
WKS_FILE = "directdisk-isar.wks"
IMAGER_INSTALL += "${SYSLINUX_BOOTLOADER_INSTALL}"
user@isar-build:~/build$ bitbake mc:qemuamd64-buster:isar-image-base

Basically the next things to do would be to create a chroot generator using mock instead of debootstrap, and a rpm packager to make use of it.

From there we should be able to work on individual tools packaging (including splitting complex CPU-hungry ones like stubdom rootfs generation to make the dev workflow smoother), which would make an ISAR-based Debian template package in reach, and a Fedora template could follow shortly.

[graphviz]
digraph {
DebTemplate → DebRootfs → QubesDebs → DebPackager → DebBuildchrootGenerator;
DebRootfs → DebBuildchrootGenerator;
{ rank=same; QubesDebs → QubesDebPackaging; }
DebTemplate → RpmPackager;
RpmTemplate → RpmRootfs → QubesRpms → RpmPackager → RpmBuildchrootGenerator;
RpmRootfs → RpmBuildchrootGenerator;
{ rank=same; QubesRpms → QubesRpmPackaging; }
RpmTemplate → RpmPackager;

DebBuildchrootGenerator [color=blue];
DebPackager [color=blue];
QubesDebPackaging [color=blue];
QubesRpmPackaging [color=blue];
}
[/graphviz]