Skip to content

Commit 71a3556

Browse files
committed
fix(display): make overlay_start_weston_drm ShellCheck-clean and safer
- Avoid SC2012 by not using CONTRIBUTING.md LICENSE README.md Runner to locate *EGL_adreno.json (use glob probing) - Support prefixed vendor JSON names (e.g. 10_EGL_adreno.json) - Keep non-destructive behavior: start Weston without tracking/killing PIDs and rely on socket discovery/adoption - Improve logs around vendor override and runtime dir/socket detection Signed-off-by: Srikanth Muppandam <smuppand@qti.qualcomm.com>
1 parent 10f66a3 commit 71a3556

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

Runner/utils/functestlib.sh

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1002,9 +1002,16 @@ weston_start() {
10021002
}
10031003

10041004
overlay_start_weston_drm() {
1005-
EGL_JSON="/usr/share/glvnd/egl_vendor.d/EGL_adreno.json"
1005+
# Pick the first matching EGL vendor JSON without using ls|head (ShellCheck SC2012)
1006+
EGL_JSON=""
1007+
for f in /usr/share/glvnd/egl_vendor.d/*EGL_adreno.json; do
1008+
if [ -f "$f" ]; then
1009+
EGL_JSON="$f"
1010+
break
1011+
fi
1012+
done
10061013

1007-
if [ -f "$EGL_JSON" ]; then
1014+
if [ -n "$EGL_JSON" ]; then
10081015
export __EGL_VENDOR_LIBRARY_FILENAMES="$EGL_JSON"
10091016
log_info "Overlay EGL: using vendor JSON: $EGL_JSON"
10101017
fi
@@ -1049,15 +1056,13 @@ overlay_start_weston_drm() {
10491056

10501057
if [ -n "$sock_found" ]; then
10511058
log_info "Overlay Weston created Wayland socket at $sock_found"
1052-
# We still let the caller discover/adopt the env via
1053-
# discover_wayland_socket_anywhere + adopt_wayland_env_from_socket.
1059+
# Caller can discover/adopt env via discover_wayland_socket_anywhere + adopt_wayland_env_from_socket.
10541060
return 0
10551061
fi
10561062

10571063
log_warn "Overlay Weston did not create a Wayland socket under $XDG_RUNTIME_DIR (see $WESTON_LOG)"
10581064
return 1
10591065
}
1060-
10611066
# Choose a socket (or try to start), adopt env, and echo chosen path.
10621067
wayland_choose_or_start() {
10631068
wayland_debug_snapshot "pre-choose"

0 commit comments

Comments
 (0)