Description
Building an OSv image - one including the OSv kernel and an application - currently requires running OSv. Both scripts/build
and Capstan
run the OSv kernel, and utilities stored on its ramdisk - namely /tools/mkfs.so
(to create a ZFS filesystem) and /tools/cpiod.so
- to create a ZFS filesystem on the image and upload files onto it.
In the back of our minds, we always considered the idea of doing the last step - creating the ZFS filesystem and copying files into it - on the Linux build host, without running an OSv guest at all. But this never worked properly, as demonstrated by issue #918. But now that this issue was fixed, we can return to this idea.
Not running the guest to build the filesystem has several advantages. One is making the image smaller - cpiod.so is no longer as big as it was (see #980) but it's still is over 200KB and we put it twice on each image, and some of the other ZFS stuff in bootfs.manifest.skel
and usr.manifest.skel
might not be needed any more as well.
The second benefit is speeding up the build of OSv images on machines where running a guest is very slow (e.g., VMs with no support for nested virtualization) or not possible at all (e.g., cross-compilation).
I'm marking this issue as "low priority" because the current approach of scripts/build - i.e., running the guest to uploads files onto it - has been working quite well for years, so we're are in no real rush to replace it.