When pkgbuilder.py is terminated with SIGINT (ie. ctrl-c), or exits
immediately due to a failed job, it is sometimes possible for child
subprocesses (ie. build tasks) to remain alive and continue running
in the background.
To fix this, assign each subprocess a new process group identifier,
and capture the pid of each child subprocess so that on shutdown we
can kill the entire child process group (ie. kill the child subprocess,
and all subprocesses the child subprocess may have created) for any
builder processes that are still running.
commit c468820ba9 "scripts/build: cleanup"
started to silently remove *.o files from the installation without
giving an explanation why this should be needed.
Drop that as it prevents packages from including *.o files in the
image, which eg is needed to include IR BPF decoders in LibreELEC.
Packages which install *.o files that should not end up in the image
should manually remove these in post_makeinstall_target.
Signed-off-by: Matthias Reichl <hias@horus.com>
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.