cp (and potentially mkdir -p) are not atomic, and we have seen situations where two packages
concurrently copying the same file (eg. the udev rule for xf86-video-nvidia and
xf86-video-nvidia-legacy) will succeed for one package but the other package fails with
a "file exists" error (as the file didn't exist when it checked, but does exist when it
actually copies the file). Not even cp -f will avoid this issue.
There are several workarounds, but the most practical (and general) solution is to ensure
sequential updates of the image and shared sysroot directories.
Create the module and firmware symlink trees in /run/kernel-overlays
instead of /var/lib as recommended by FHS 3.0. This also allows us
to drop the After=var.mount ordering in the systemd service.
Signed-off-by: Matthias Reichl <hias@horus.com>
Instead of cluttering $BUILD we now have
- $BUILD/build sources and builds of packages
- $BUILD/install_pkg installed packages
- $BUILD/install_init installed packages for initramfs
Install the files required by $SCRIPTS/image to a hidden directory. That
way, the files won't get copied to the system filesystem, but the script
can access them without requiring access to the build directory,
Some addon dependencies do this locally on their own. With this, these
packages can now use the standard makeinstall() functions and access build
artifacts using get_install_dir() without polluting the sysroot folder.
With the upcoming usage of the standard install_pkg folder for addon
dependencies, the devel files need to be accessible, e.g. ffmpegx for
tvheadend.
So don't wipe them from the package install folder, just skip copying
them to the image.
Now with the dependencies in initramfs:init, we can include it in the
build plan to parallalize it. But just build them there, the kernel package
keeps installing them.
- meson needs a host environment for cross-compile
- allow setup_toolchain to setup toolchain based on used build-system
- adjust creation of meson.conf