Fix a missing mkdir of /sysroot/etc/flatcar/sysext from the initrd before
attempting to move sysext files there. Also explicitly omit dracut zfs module
from initrd generation.
Signed-off-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>
emerge-gitclone was never GPL-2.0, it was BSD-3. We're switching it to
Apache-2.0 with this commit.
Signed-off-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>
This commit is part of the effort to decrease the initrd size:
Partially-Fixes: https://github.com/flatcar/Flatcar/issues/1381
Signed-off-by: Adrian Vladu <avladu@cloudbasesolutions.com>
'norecovery' was deprecated and has been removed in kernel v6.8 so switch to
the new way of doing things.
This pulls in https://github.com/flatcar/update_engine/pull/40.
Signed-off-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>
Putting things in a sysexts subdir results in the same layout on
bincache and does not follow the expected url schema for fetching the
sysext.
Signed-off-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>
Gentoo's linux-info.eclass tries to check the kernel version by
including /lib/modules/.../source/Makefile and printing $(VERSION). It
unsets ARCH= before doing this (no clue why) which works with a full
source tree but not with our minimized one. To fix this we need to
archive arch/x86/Makefile also for arm64.
Signed-off-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>
This allows it to be sourced from other scripts and used e.g. in
generating an image changes summary.
Signed-off-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>
There are two challenges with the sysext: it needs config files in /etc
and it needs udev rules for mounting during boot to work. The etc files
are placed in the standard flatcar etc overlay path but the overlay is
mounted from the initrd. So instead, we create a tmpfiles.d rule that
symlinks the best important files over. For the udev issue, we create a
drop-in in /etc that ensures udev runs after systemd-sysext.
We also can't rely on systemd presets to work, so instead parse the
preset file and statically create the service dependencies. For the
primary zfs.target we rely on an Upholds entry. Users can still disabled
unwanted services if they want.
We also removed unnecessary files:
- development files
- initramfs related scripts
Signed-off-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>
The zfs-kmod ebuild needs KERNEL_DIR to point to the correct
/lib/modules directory.
The zfs ebuild installs two systemd unit masks to /usr/lib/systemd which
result in "dangling symlink" errors during the image build. These
systemd unit masks are only necessary for old Ubuntu systems that have
sysv-init-systemd compat wrappers.
Signed-off-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>
We explicitly install gawk but our profile explicitly forces the gawk
useflag for app-alternatives/awk. Some packages, like zfs, depend on
app-alternatives/awk and it also installs the awk -> gawk that the gawk
ebuild creates through pkg_postinst. So switch to app-alternatives/awk
to make the implementation cleaner.
Signed-off-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>
build/source, which is accidentally an empty directory, needs to be a
symlink so that Gentoo kmod ebuilds can build when setting
KERNEL_DIR=/lib/modules/.../build. They detect the proper layout with
the symlink.
The other issue is building the Nvidia driver with
SYSSRC=/lib/modules/.../build. This works on Ubuntu but fails on
Flatcar. Ubuntus build directory contains symlinks to includes from the
source tree so recreate the same layout.
Signed-off-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>
by skipping the check for an existing image directory if we're not
building an image. This makes './build_image sysext' work.
Signed-off-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>
This function is meant to prebuild certain sysexts to be released along
with each release. These will not be built into the image, but instead
can be fetched by the user on demand.
The command to build sysexts would be:
./build_image prod sysext
Signed-off-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>
It looks like 'norecovery' is deprecated and has been removed in the v6.8-rc1
kernel. Replace it with 'rescue=nologreplay', which is a replacement
implemented since v5.9. The standalone 'nologreplay' option is also deprecated.
Signed-off-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>