Without this, official builds are failing:
```
This is a dev rebuild of an official release tag: No BUILD ID set in '/mnt/host/source/.repo/manifests/version.txt'. Will use base squasfs BUILD ID for version check.
Repo root FLATCAR_VERSION is '4081.0.0', squashfs build ID is '2024-09-03-2245'
Setting FLATCAR_VERSION to '4081.0.0+2024-09-03-2245'
Base squashfs version: 4081.0.0
SDK board packages version: 4081.0.0+2024-09-03-2245
Version mismatch between board flatcar release and SDK container flatcar release.
```
The "base squashfs version" is the actual version for official release builds.
Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
The docker and containerd copy files from the repository, which are owned by
the sdk user. This ownership leaks into the final image, which means the first
created user could edit systemd files. This is bad.
Modify the cp invocation to copy files without preserving ownership. The
sysext-mangle script is called by build_sysext, which is executed using sudo.
Signed-off-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>
This change sets SKIP_KERNEL_BINPKG_ENV_RESET in the zfs-kmod env so
linux-info.eclass keeps kernel env variables. This resolves an issue
with installing zfs-kmod as a binpkg when the kernel was not yet
installed. In a pure binpkg install the zfs-kmod package might be
installed before the kernel, leading to the kmod's kernel version
detection to fail.
Signed-off-by: Thilo Fromm <thilofromm@microsoft.com>
build_sysext uses a base squashfs (basically a full snapshot of the
Flatcar OS image) to build custom sysexts on top. Before building it
ensures the base image actualy matches the OS version in the repository
root.
The version string includes a BUILD_ID which might be auto-generated (by
including common.sh) if it is not present in the version file - e.g.
when the version is an official release (tag). This build ID
auto-generation causes issues with the version check when image build
and sysext build scripts run independently - each will generate its own
build ID, and this will cause build_sysext's version check to fail.
build_sysext will now use the build id from the base squashfs when it is
not set in the source tree's version.txt to work around that issue. This
is a more general solution than 361eda220b368c3c3a959357c54db10d4c2f1d1a
(which this patch reverts) as it directly addresses the issue in
build_sysext instead of working around it in sysext_prod_builder.
Signed-off-by: Thilo Fromm <thilofromm@microsoft.com>
This has been raised on Slack:
```
Aug 08 19:03:33 shoot-79548-jlptk bash[1678]: 2024/08/08 19:03:33 Checking availability of "packet-metadata-service"
Aug 08 19:04:03 shoot-79548-jlptk bash[1678]: 2024/08/08 19:04:03 Checking availability of "packet-metadata-service"
Aug 08 19:04:33 shoot-79548-jlptk bash[1678]: 2024/08/08 19:04:33 Checking availability of "packet-metadata-service"
Aug 08 19:05:03 shoot-79548-jlptk bash[1678]: 2024/08/08 19:05:03 Checking availability of "packet-metadata-service"
Aug 08 19:05:33 shoot-79548-jlptk bash[1678]: 2024/08/08 19:05:33 Checking availability of "packet-metadata-service"
Aug 08 19:06:03 shoot-79548-jlptk bash[1678]: 2024/08/08 19:06:03 Checking availability of "packet-metadata-service"
Aug 08 19:06:09 shoot-79548-jlptk bash[1678]: 2024/08/08 19:06:09 No datasources available in time
Aug 08 19:06:09 shoot-79548-jlptk systemd[1]: oem-cloudinit.service: Main process exited, code=exited, status=1/FAILURE
Aug 08 19:06:09 shoot-79548-jlptk systemd[1]: oem-cloudinit.service: Failed with result 'exit-code'.
Aug 08 19:06:09 shoot-79548-jlptk systemd[1]: Failed to start oem-cloudinit.service - Run cloudinit.
```
The check for metadata endpoint availability (`curl https://metadata.packet.net/`) returns a 404 so it fails.
Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
Signed-off-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>