Core Kernel modules are now installed to
/usr/lib/kernel-overlays/base/lib/modules instead of /usr/lib/modules
Firmware files are installed to
/usr/lib/kernel-overlays/base/lib/firmware instead of /usr/lib/firmware
Packages can choose to install their modules and/or firmwareinto a
different overlay directory than base so they are not automatically enabled.
A new systemd service kernel-overlays, which is run before any modules
are loaded, adds overlays enabled via /storage/.cache/kernel-overlays/*.conf
These conf files must either contain the name of a system overlay,
which will then be searched for in /usr/lib/kernel-overlays/, or an
absolute path starting with '/'.
Overlaying is implemented by symlinking files from the overlays
to /usr/lib/modules and /usr/lib/firmware as not all platforms
support overlayfs.
This overlaying system can also be used by addons to provide optional
kernel modules and/or firmware by storing the absolute path to the addon
directory in the conf file and shipping kernel modules in
<addondir>/lib/modules/<KERNELVER>.
To save space only symlinks for modules matching the currently
running kernel version are created as addons may want to ship
modules for older kernel versions as well to be backward-compatible
to older LibreELEC versions.
Changes since v1:
- fixup kernel-overlays-service: add before kmod-static-nodes.service
Fix static device nodes for module autoloading not being created.
- fixup kernel-overlays-service: fail if /usr/lib/modules exists
- squash kernel overlays: use get_kernel_overlay_dir in linux/package.mk
- Add support for firmware files via kernel overlays
- config/functions: include kernel overlays in addon installation
Signed-off-by: Matthias Reichl <hias@horus.com>
fixes unneeded console messages (mostly for first boot):
[FAILED] Failed to start Create Static Device Nodes in /dev.
See 'systemctl status systemd-tmpfiles-setup-dev.service' for details.
[ OK ] Reached target Local File Systems (Pre).
[ OK ] Mounted Debug File System.
[ OK ] Mounted POSIX Message Queue File System.
[ OK ] Mounted Variable Directory.
[ OK ] Mounted Temporary Directory.
[ OK ] Started Setup machine-id.
[ OK Starting Journal Service...
[ OK ] Reached target Local File Systems.
Starting Setup Timezone data...
[ OK ] Started Setup Timezone data.
This fixes journal truncation on time jumps (eg when ntp
set the correct date on systems without an RTC).
Signed-off-by: Matthias Reichl <hias@horus.com>