dtoverlays: Check which overlay names /boot/boot.scr script can actually load.

We will not provide a selection of options that cannot be loaded
by this script.
This commit is contained in:
The-going
2025-06-12 16:08:41 +03:00
committed by Igor
parent 0f4ab0eaf9
commit 4915f6a16d

View File

@@ -33,6 +33,21 @@ function manage_dtoverlays () {
[[ ! -f "${overlayconf}" || ! -d "${overlaydir}" ]] && echo -e "Incompatible OS configuration\nArmbian device tree configuration files not found" | show_message && return 1
# check /boot/boot.scr scenario ${overlay_prefix}-${overlay_name}.dtbo
# or ${overlay_name}.dtbo only
# scenario:
# 00 - The /boot/boot.scr script cannot load the overlays provided by Armbian.
# 01 - It is possible to load only if the full name of the overlay is written.
# 10 - Loading is possible only if the overlay name is written without a prefix.
# 11 - Both spellings will be loaded.
scenario=$(
awk 'BEGIN{p=0;s=0}
/load.*overlay\/\${overlay_prefix}-\${overlay_file}.dtbo/{p=1}
/load.*overlay\/\${overlay_file}.dtbo/{s=1}
END{print p s}
' /boot/boot.scr
)
while true; do
local options=()
j=0