We push a commit with the nightly SDK tag to the main branch if the
SDK was built from the main branch. Which is what happens when we
build the nightly intermediate SDK. The final nightly SDK is not built
from the main branch, but rather from the nightly intermediate SDK
tag. Both of them point to the exactly same commit, but the difference
is in what `git rev-parse --abbrev-ref HEAD` returns for each of
those. When the main branch is checked out, the command will return
"main". When the nightly intermediate SDK tag is checked out, the
command will return "HEAD". So when nightly final SDK is being built,
the command returns a string different than "main" and thus decides
not to push the commit with the final nightly SDK tag to the main
branch. Rework it to assume that if `git rev-parse HEAD` and `git
rev-parse origin/main` return the same commit hash (and it's the
nightly build and all that) then the commit should be pushed.
We use "origin/main" instead of just "main" just in case the main
branch was not checked out before, for some reason (may come up in
testing with different names for the main branch when testing).
Build fails in >= 6.1.55 like below, because upstream stable Kernels
deleted the Kernel configs CONFIG_NET_CLS_RSVP*.
```
* ERROR: sys-kernel/coreos-modules-6.1.55::coreos failed (configure
phase):
* Requested options not enabled in build:
* CONFIG_NET_CLS_RSVP
* CONFIG_NET_CLS_RSVP6
```
Fix that by deleting the Kernel configs.
Previously the sys-apps/gentoo-functions package was pulled in into
the GCE image by the sys-libs/glibc package. After the sys-libs/glibc
package update, the dependency disappeared. This resulted in
gentoo-functions not being installed and the build to fail a check for
dangling symlinks:
broken link: b'/etc/init.d/functions.sh' -> b'../../lib/gentoo/functions.sh'
ERROR build_oem_aci: test_image_content: Failed symlink check
The `/etc/init.d/functions.sh` symlink is installed by
sys-apps/baselayout in postinst phase. The package also has a
dependency on sys-apps/gentoo-functions, but it is not pulled in into
the image, because baselayout is installed specially - without
dependencies.
It would probably be better to just drop the symlink, but it's here
for compatibility purposes. We also can't remove the symlink in the
manglefs script, as it gets executed after the filesystem checks.
The `localedef` tool expects `/usr/lib/locale` directory to
exist. This directory used to be created by the `sys-libs/glibc`
package (with the `keepdir` directive), but after the update of the
package, the locale generation stuff (and the `keepdir` directive )was
moved to the `sys-libs/locale-gen` package. This package is not
installed in the production images, so the `/usr/lib/locale` directory
was not created. In such a situation, calling localedef to generate
C.UTF-8 locale resulted in an error like:
cannot create temporary file: ${SOME_ROOTFS}/usr/lib/locale/locale-archive.ufpG15: No such file or directory
Create the directory before calling localedef to fix the problem.
It normally is enabled by default, but during bootstrap USE flags that
are not force-enabled are disabled. And we need to it avoid bindist
issues that pop up during stage 1 of the SDK build.