You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
This patch makes some incremental improvements to the process
of building ZFS images. However, the main driving force here is
to support building and running ZFS images with the kernel built
with most symbols hidden.
The key missing part to support the above is adding libstdc++.so
to the image so that it can be loaded as needed by cpiod.so and mkfs.so.
However, this would make the loader.elf even larger than the non-hidden
version of it. So instead this patch adds new artifact - zfs_builder.elf
- which is intended to be used by upload_manifest.py only to build ZFS-images.
In essence this patch modifies the main makefile to build new zfs_builder.elf
with bootfs populated with all artifacts necessary to build and load ZFS filesystem
(cpiod.so, mkfs.so, etc). At the same time we drop support of building
kernel.elf which became obsolete in favor of standard loader.elf which
now is even leaner - it does not carry the bootfs footprint with ZFS
building tools. On top of that we optimise the build time of ZFS image
by making it run zfs_builder.elf in QEMU kernel direct mode and VGA
console off that cuts boot time to around 20ms.
At the end of the day we come close to satisfying #1068 - "Building a
full OSv image without running it" - we use new OSv-based build tool zfs_builder.elf
to build final ZFS image - usr.img.
Another benefit of this approach is that we can use some "old"
pre-existing version of zfs_builder.elf (possibly retrieved from github)
to build ZFS image that includes new version of kernel (loader.elf).
Refs #1068
Refs #1186
Signed-off-by: Waldemar Kozaczuk <[email protected]>
Building an OSv image - one including the OSv kernel and an application - currently requires running OSv. Both
scripts/build
andCapstan
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
andusr.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.
The text was updated successfully, but these errors were encountered: