mirror of
https://github.com/libretro/Lakka-LibreELEC.git
synced 2025-01-19 03:42:09 +00:00
765323df23
Lakka 5.x Switch changes (#1853) Lakka v5.x switchroot 5.1.2 (#1871) Fix Switch Issue's in upstream 5.x (#1888) Minor Switch Changes (#1893) Lakka v5.x switch 3 (#1895) Lakka v5.x switch 4 (#1898) L4T: Xorg-server: Fix build issue (#1924) Switch: remove ra patch Lakka v5.x switch 6 (#1926) Cleanups, More LibreELEC Stuff, more permission fixes, Misc switch stuff. (#1930) Switch: U-Boot: bump version to 2024-NX02 (#1946) L4T/Ayn post-upstreaming fixes - retroarch_joypad_autoconfig: remove spaces from file names - retroarch: remove Switch specific patch merged upstream - libXv: move to L4T packages folder (package removed in upstream) - bring some packages from v5.x to L4T packages - ffmpeg: remove vulkan - remove stella core from Switch build (missing C++ headers) - Ayn/Odin: use proper kernel arg to not hide kernel messages in console - connman: add wpa_supplicant support back
86 lines
2.1 KiB
Bash
Executable File
86 lines
2.1 KiB
Bash
Executable File
#!/bin/sh
|
|
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
# Copyright (C) 2017-present Team LibreELEC (https://libreelec.tv)
|
|
|
|
SYSTEM_OVERLAYS_DIR=/usr/lib/kernel-overlays
|
|
OVERLAY_CONFIG_DIR=/storage/.cache/kernel-overlays
|
|
KVER=$(uname -r)
|
|
RUNTIME_DIR="/run/kernel-overlays"
|
|
MODULES_DIR="${RUNTIME_DIR}/modules/${KVER}"
|
|
FIRMWARE_DIR="${RUNTIME_DIR}/firmware"
|
|
USER_FIRMWARE_DIR="/storage/.config/firmware"
|
|
|
|
mkdir -p "${MODULES_DIR}"
|
|
mkdir -p "${FIRMWARE_DIR}"
|
|
|
|
log() {
|
|
echo "kernel-overlays-setup: $@" > /dev/kmsg
|
|
}
|
|
|
|
apply_overlay() {
|
|
case "$1" in
|
|
/*)
|
|
modules_overlay_dir="${1}/lib/modules/${KVER}"
|
|
firmware_overlay_dir="${1}/lib/firmware"
|
|
;;
|
|
*)
|
|
modules_overlay_dir="${SYSTEM_OVERLAYS_DIR}/${1}/lib/modules/${KVER}"
|
|
firmware_overlay_dir="${SYSTEM_OVERLAYS_DIR}/${1}/lib/firmware"
|
|
;;
|
|
esac
|
|
|
|
if [ -d "${modules_overlay_dir}" ] ; then
|
|
GOT_MODULE_OVERLAY="yes"
|
|
|
|
if cp -rfs "${modules_overlay_dir}"/* "${MODULES_DIR}" ; then
|
|
log "added modules from $modules_overlay_dir"
|
|
else
|
|
log "failed to add modules from $modules_overlay_dir"
|
|
fi
|
|
fi
|
|
|
|
if [ -d "${firmware_overlay_dir}" ] ; then
|
|
if cp -rfs "${firmware_overlay_dir}"/* "${FIRMWARE_DIR}" ; then
|
|
log "added firmware from $firmware_overlay_dir"
|
|
else
|
|
log "failed to add firmware from $firmware_overlay_dir"
|
|
fi
|
|
fi
|
|
}
|
|
|
|
# setup system base modules
|
|
|
|
log "setup base modules"
|
|
apply_overlay base
|
|
|
|
# apply user-configured module overlays
|
|
|
|
if [ -d "${OVERLAY_CONFIG_DIR}" ] ; then
|
|
log "adding overlays from ${OVERLAY_CONFIG_DIR}"
|
|
GOT_MODULE_OVERLAY="no"
|
|
|
|
for conf in "${OVERLAY_CONFIG_DIR}/"*.conf ; do
|
|
if [ -e "$conf" ] ; then
|
|
log "processing conf $conf"
|
|
overlay=$(cat "$conf")
|
|
[ -n "$overlay" ] && apply_overlay "$overlay"
|
|
fi
|
|
done
|
|
|
|
if [ "yes" = "$GOT_MODULE_OVERLAY" ] ; then
|
|
log "running depmod"
|
|
/usr/sbin/depmod -a >/dev/kmsg 2>&1
|
|
fi
|
|
fi
|
|
|
|
if [ -d "${USER_FIRMWARE_DIR}" ] && [ -n "$(ls ${USER_FIRMWARE_DIR})" ] ; then
|
|
if cp -rfs "${USER_FIRMWARE_DIR}"/* "${FIRMWARE_DIR}" ; then
|
|
log "added firmware from ${USER_FIRMWARE_DIR}"
|
|
else
|
|
log "failed to add firmware from ${USER_FIRMWARE_DIR}"
|
|
fi
|
|
fi
|
|
|
|
log "done"
|