-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flatcar SDK: add experimental prefix builds #1151
Flatcar SDK: add experimental prefix builds #1151
Conversation
Flatcar actually lacks the dependencies.
Note that this package may need to be masked in the non-prefix builds.
We need this for a tmpfiles implementation. Gentoo now only supports systemd itself or systemd-utils, and the former is masked for prefix.
opentmpfiles is dead and systemd-tmpfiles is now part of systemd-utils.
We either lack the packages or haven't built the host gcc with openmp support.
We need this in the SDK for building prefix. It's been in upstream's repo for a little while now anyway.
Not committed upstream yet, but we need this now. Not sure if this works with the earlier versions.
It was causing ldconfig to segfault.
This change updates PKGDIR and PORT_LOGDIR in the prefix's make.conf (both staging and final) to /usr/local/microsoft/var/lib/portage/pkgs and /usr/local/microsoft/var/log/portage, respectively. This resolves an issue where emerge in the prefix was interfering with the core SDK's emerge (overwriting packages etc.).
This change introduces softlinks in staging/ and final/ etc directories to the root passwd and group files. This ensures that PORTAGE_USERNAME and PORTAGE_GRPNAME defined in the prefix' make.conf files can use users from the host system. Also, sensible EMERGE_DEFAULT options are added to staging and final make.conf: staging will always build packages, and final will always install rdeps, and only use binpkgs by default.
This change makes prefixes configurable and adds a wrapper script "setup_prefix" to create new prefixes. It also greatly extends the documentation in PREFIX.md.
Signed-off-by: Thilo Fromm <thilofromm@microsoft.com>
This change updates hprexlify in dev-libs/libgpg-error/libgpg-error-1.47.ebuild to use the build root instead of EPREFIX when cross-compiling. This fixes an isse with prefix + cross compilation where, if autogen.sh is hprefixified to (cross) EPREFIX it will return an empty version string when running eautoreconf later. That would reset the libgpg-error version to an empty string, leading to compilation breakage with: ./mkheader \ aarch64-cros-linux-gnu /var/tmp/portage/dev-libs/libgpg-error-1.47/work/libgpg-error-1.47/src/gpg-error.h.in \ ../config.h 0x012f00 >gpg-error.h usage: mkheader host_triplet template.h config.h version version_number mkheader host_triplet make[2]: *** [Makefile:1704: gpg-error.h] Error 1 make[2]: Leaving directory '/var/tmp/portage/dev-libs/libgpg-error-1.47/work/libgpg-error-1.47-.arm64/src' make[1]: *** [Makefile:521: all-recursive] Error 1 make[1]: Leaving directory '/var/tmp/portage/dev-libs/libgpg-error-1.47/work/libgpg-error-1.47-.arm64' make: *** [Makefile:453: all] Error 2 Signed-off-by: Thilo Fromm <thilofromm@microsoft.com>
- Use bash built-ins for samity-checking mandatory args - Remove spurious "installation dir" arg from help Signed-off-by: Thilo Fromm <thilofromm@microsoft.com>
Signed-off-by: Thilo Fromm <thilofromm@microsoft.com>
secureboot.eclass was added while work on the prefix feature fork was ongoing - which also added secureboot.eclass. Move it from prefix-verlay to portage-stable where it belongs. Signed-off-by: Thilo Fromm <thilofromm@microsoft.com>
Signed-off-by: Thilo Fromm <thilofromm@microsoft.com>
Thanks for working on this. To understand, what is the output of |
Build action triggered: https://github.com/flatcar/scripts/actions/runs/6235775790 |
Apparently things broke when I rebased this to the latest main (conflicting glibc and python eboulds). I'll close this, squash and apply a single patch in a branch directly in the scripts repo, and file a new PR. Output of
@pothos let's continue the discussion in the new PR, will close this one. |
Oh, is this what you expect? It seems to use the host libraries which is wrong. |
@pothos It's the output of the host ldd. If I use
|
This PR adds experimental prefix builds to the Flatcar SDK.
Prefix builds use a custom sys prefix path and emerge all binaries and runtime dependencies into that prefix.
This path can then e.g. be shipped as a portable sysext since it includes all dependencies, and has libraries at a custom path so these do not conflict with libraries on target systems.
Prefix uses a staging environment (path) featuring a full-blown development environment, and a "final" environment for installing. Staging and final need to be created using
setup_prefix
first, which will also create an emerge wrapper to emerge ebuilds into staging and subsequently final. The root fs in final may be used to create a distro independent, portable sysext.See the readme at https://github.com/chewi/flatcar-distro/blob/hackathon-prefix-builds-sync-to-upstream/PREFIX.md for more information.
How to use
Prefix requires cross-boss to be available locally.
Testing was done with the latest Alpha SDK, not the nightly build SDK.
The latest development is in the
hackathon-prefix-builds-sync-to-upstream
branch.git clone https://github.com/chewi/flatcar-distro.git cd flatcar-distro git checkout hackathon-prefix-builds-sync-to-upstream git clone https://github.com/chewi/cross-boss ./run_sdk_container -C ghcr.io/flatcar/flatcar-sdk-all:3717.0.0 -n flatcar-sdk-prefix-3717.0.0 -t
In the SDK container, initialise a prefix, then build (for example) python into it:
Prefixes are architecture aware; the same prefix name can be used for multiple archs
"Final" environments will be in
__prefix__/<board>/prefixtest
after the builds conclude.__prefix__/<board>/prefixtest/root
contain the root FS and can be used to create sysexts.Testing done
Built the above (see "How to use") for amd64 and arm64, created a python sysext, tested on Flatcar x86_64 and arm64 QEmu instances.
changelog/
directory (user-facing change, bug fix, security fix, update)/boot
and/usr
size, packages, list files for any missing binaries, kernel modules, config files, kernel modules, etc.