init-flash.sh: Handle missing UDC initialization

This update adds a check for a missing UDC (USB Device Controller) variable to prevent errors related to uninitialized or absent UDCs, stopping the execution of the boot process if none is found.

A missing UDC can result from various issues, such as an incorrect Device Tree Blob (DTB) configuration or misconfigured power regulators. By exiting early with a clear error message, this change helps diagnose and address the root cause more effectively.

Signed-off-by: Pablo Rodriguez Quesada <pablo.aarch64@gmail.com>
This commit is contained in:
Pablo Rodriguez
2024-10-08 19:30:35 +02:00
committed by GitHub
parent 9d75f09744
commit 3fdf6ce5dc

View File

@@ -34,6 +34,10 @@ fi
[ -n "$sernum" ] || sernum="UNKNOWN"
echo "Serial number: $sernum"
UDC=$(ls -1 /sys/class/udc | head -n 1)
if [ -z "$UDC" ]; then
echo "Error: No UDC found in /sys/class/udc" >&2
exit 1
fi
wait_for_storage() {
local file_or_dev="$1"