Move kernel overlays setup to init

When running kernel-overlays-setup as a systemd service we have
a short window where /lib/firmware isn't available.

This causes drm edid override to occasionally fail if the edid file
is requested between switching to sysroot and completion of the
kernel-overlays-setup script.

Setting up firmware and module overlays in init, before switching
to sysroot, closes the gap and also has the benefit that we no longer
need to care about the rather tedious systemd unit ordering.

Signed-off-by: Matthias Reichl <hias@horus.com>
This commit is contained in:
Matthias Reichl 2021-02-03 12:28:48 +01:00
parent cf763e204f
commit 8f1344f6fd
8 changed files with 9 additions and 19 deletions

View File

@ -1,6 +1,5 @@
[Unit]
Description=Broadcom SDIO Firmware Symlink Service
After=kernel-overlays.service
Before=kodi.service
[Service]

View File

@ -136,6 +136,9 @@ makeinstall_target() {
cp ${PKG_DIR}/scripts/pastebinit ${INSTALL}/usr/bin/
ln -sf pastebinit ${INSTALL}/usr/bin/paste
mkdir -p ${INSTALL}/usr/sbin
cp ${PKG_DIR}/scripts/kernel-overlays-setup ${INSTALL}/usr/sbin
mkdir -p ${INSTALL}/usr/lib/libreelec
cp ${PKG_DIR}/scripts/functions ${INSTALL}/usr/lib/libreelec
cp ${PKG_DIR}/scripts/fs-resize ${INSTALL}/usr/lib/libreelec

View File

@ -1113,8 +1113,12 @@ done
/usr/bin/busybox mount --move /dev /sysroot/dev
/usr/bin/busybox mount --move /proc /sysroot/proc
/usr/bin/busybox mount --move /sys /sysroot/sys
/usr/bin/busybox mount --move /run /sysroot/run
/usr/bin/busybox rm -fr /tmp
# setup kernel overlays
/usr/bin/busybox chroot /sysroot /usr/sbin/kernel-overlays-setup
# tell OE settings addon to disable updates
if [ "$UPDATE_DISABLED" = "yes" ]; then
echo "" > /sysroot/dev/.update_disabled

View File

@ -1,7 +1,7 @@
[Unit]
Description=RPi Flash Firmware
Requires=tmp.mount var.mount sys-kernel-config.mount kernel-overlays.service
After=tmp.mount var.mount sys-kernel-config.mount kernel-overlays.service
Requires=tmp.mount var.mount sys-kernel-config.mount
After=tmp.mount var.mount sys-kernel-config.mount
DefaultDependencies=no
[Service]

View File

@ -214,7 +214,6 @@ post_makeinstall_target() {
find_file_path scripts/cpufreq && cp -PRv ${FOUND_PATH} ${INSTALL}/usr/bin
mkdir -p ${INSTALL}/usr/sbin
cp ${PKG_DIR}/scripts/kernel-overlays-setup ${INSTALL}/usr/sbin
cp ${PKG_DIR}/scripts/network-base-setup ${INSTALL}/usr/sbin
cp ${PKG_DIR}/scripts/systemd-timesyncd-setup ${INSTALL}/usr/sbin
@ -282,7 +281,6 @@ post_install() {
enable_service userconfig.service
enable_service usercache.service
enable_service envconfig.service
enable_service kernel-overlays.service
enable_service hwdb.service
enable_service cpufreq.service
enable_service network-base.service

View File

@ -1,12 +0,0 @@
[Unit]
Description=Create kernel modules tree from overlays
DefaultDependencies=no
Before=systemd-udevd.service systemd-udev-trigger.service systemd-modules-load.service systemd-remount-fs.service swap.service machine-id.service kmod-static-nodes.service
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/sbin/kernel-overlays-setup
[Install]
WantedBy=local-fs.target

View File

@ -1,2 +0,0 @@
[Unit]
After=kernel-overlays.service