Yep that is the main problem.
At the beginning I tried to make runit services for everything. But that ended up not working very well. In particular Runit does not allow "oneshots". This can be sort of bypassed in void as it has
"/ets/runit/core-services/99-00-whatever"
This is however executed before any of the regular services start. These are not really services.
Then there's /etc/sv/someservice/run
That's the place for a service. Runit uses supervision. It doesn't really allow forking. Nor does it allow dependencies. There's a fork-wrapper that can help with forking processes. There's also a "check" command that will start another service first and wait up to 7 seconds or timeout of the other one. But there's no real way to do "before XY" and/or "after XY".
I also had to put some things into /etc/rc.local as it did not really work as a runit service.
After all I managed to get it work but it's a mess. And I'm not sure if I got the order right. I could post it for a short review.
> Actually, vmm-xen might be optional, if Void linux have needed stuff packaged. Especially libxenvchan library. There are some Qubes-specific patches, but very few of them are even touching code used outside of dom0 and most important patches are already in upstream version.
I'm not sure anymore why exactly I packaged it but I know it had a reason or there was at least a problem with the xen package in the repository. I guess it was somehow related to libxenvchan.
> If there will be a template without systemd, it will be much easier to
> keep non-systemd scripts up to date.
Runit doesn't use this kind of init scripts. It's much more lightweight. I'm not sure why these scripts would benefit from that.
> From my side, I think that it worth to look at how to proceed in the Qubes way to build a template. A step would be to create a "builder-void" and to implement inside each component the mechanism of building the package. Like I did to create a builder-gentoo (not currently available sorry because not yet finished), inspiration can be taken from builder-archlinux (https://github.com/QubesOS/qubes-builder-archlinux) because there is no so much particular cases to handle like in builder-rpm or builder-debian.
> Globally, the first step for creating a builder is to have a way of creating a minimal chroot of Void Linux where packages will be built inside. Then, inside the components needed for a template, a specific target must be done when the distro is Void Linux. For example, have a look at Makefile.builder inside vmm xen (https://github.com/QubesOS/qubes-vmm-xen/blob/xen-4.8/Makefile.builder).
I already answered to this but I guess it ended up not here. I'm not very familiar with mailing lists and google groups.
The builder at first looked to complicated to start with it, so I went with the manual installation and made the packages for this method.
If I'm able to chroot into the install directory of the void template during the build process with the builder, download, use and remove xbps-src there, then it will be very straightforward. It's their build environment that allows to build the packages in any repository from source and then install them locally from the build folder. For this it downloads the required build dependencies into a chroot directory and builds the packages there. Xbps-src can be removed after that by a simple rm -rf command. If I'm not able to use it then it might take me too long.