forked from Manuel/meeting-assistant
ci: qualify supported macOS emulation before Recovery download
This commit is contained in:
@@ -120,10 +120,10 @@ read_product_version() {
|
||||
|
||||
# END successful sw_vers version parser
|
||||
# BEGIN disk IPC diagnostic
|
||||
# Optional observations have their own child/timer ownership. No service is
|
||||
# loaded, restarted or changed, and samples target only this probe's diskutil.
|
||||
# Optional observations have their own child/timer ownership. Thread state/time
|
||||
# targets only this probe's diskutil and does not request stack symbolication.
|
||||
observe_disk_query() {
|
||||
local disk_process="$1" output="$2" sample_output="$3" observation_child="" observation_timer=""
|
||||
local disk_process="$1" output="$2" observation_child="" observation_timer=""
|
||||
cancel_observation() {
|
||||
trap '' TERM INT
|
||||
if [ -n "$observation_child" ]; then
|
||||
@@ -161,14 +161,14 @@ observe_disk_query() {
|
||||
}
|
||||
trap cancel_observation TERM INT
|
||||
printf '[disk-observation] owned-diskutil-child=%s parent-shell=%s\n' "$disk_process" "$$" >> "$output"
|
||||
if [ -x /usr/bin/sample ]; then
|
||||
if [ -x /bin/ps ]; then
|
||||
if kill -0 "$disk_process" 2>/dev/null; then
|
||||
observe_command diskutil-sample /usr/bin/sample "$disk_process" 3 100 -file "$sample_output"
|
||||
observe_command diskutil-threads /bin/ps -M -p "$disk_process"
|
||||
else
|
||||
printf '[disk-observation-unavailable] diskutil already exited before sample\n' >> "$output"
|
||||
printf '[disk-observation-unavailable] diskutil already exited before thread observation\n' >> "$output"
|
||||
fi
|
||||
else
|
||||
printf '[disk-observation-unavailable] /usr/bin/sample is unavailable\n' >> "$output"
|
||||
printf '[disk-observation-unavailable] /bin/ps is unavailable\n' >> "$output"
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -229,13 +229,11 @@ run_command() {
|
||||
# BEGIN disk IPC diagnostic
|
||||
if [[ "$name" == disks && "$attempt" == 1 ]]; then
|
||||
local observation_output="/tmp/native-diagnostic-disk-observation.out"
|
||||
local sample_output="/tmp/native-diagnostic-disk-sample.out"
|
||||
: > "$observation_output"
|
||||
: > "$sample_output"
|
||||
observe_disk_query "$process" "$observation_output" "$sample_output" &
|
||||
observe_disk_query "$process" "$observation_output" &
|
||||
ACTIVE_OBSERVER=$!
|
||||
printf '[disk-observation-start] observer=%s owned-diskutil-child=%s\n' "$ACTIVE_OBSERVER" "$process" >&3
|
||||
PENDING_OUTPUTS+=("$observation_output" "$sample_output")
|
||||
PENDING_OUTPUTS+=("$observation_output")
|
||||
fi
|
||||
# END disk IPC diagnostic
|
||||
wait "$process"
|
||||
@@ -305,7 +303,7 @@ read_product_version || fail_probe product_version_invalid
|
||||
# END successful sw_vers version extraction
|
||||
os_version="$SCALAR"
|
||||
[[ "$os_version" =~ ^[0-9]+\.[0-9]+(\.[0-9]+)?$ ]] || fail_probe product_version_invalid
|
||||
(( ${os_version%%.*} >= 13 )) || fail_probe unsupported_macos_version
|
||||
(( ${os_version%%.*} >= 14 )) || fail_probe unsupported_macos_version
|
||||
flush_outputs || finish false diagnostic_log_budget_exceeded
|
||||
|
||||
# BEGIN disk IPC diagnostic
|
||||
|
||||
Reference in New Issue
Block a user