This commit is contained in:
2025-11-05 12:43:00 +02:00
parent e4f7445ec1
commit 2a6bb4a8c3

View File

@@ -156,7 +156,8 @@
echo "$p"; return 0
fi
fi
endfor=false
done
return 1
}
pick
register: pick_port
@@ -622,13 +623,29 @@
ansible.builtin.set_fact:
expected_fw_core_early: "{{ (image_filename | regex_search('[0-9]+\\.[0-9]+\\.[0-9]+-r[0-9]+')) | default('', true) }}"
# >>> CHANGE 1: Robust parse/normalize current firmware core from firmux <<<
- name: Parse current firmware core from DEV2 firmux (early, normalize 'rev' → '-r')
- name: Parse current firmware core from DEV2 firmux (early, '-rNNNN' form)
when: dev2_firmux is defined
delegate_to: localhost
ansible.builtin.set_fact:
_firmux_norm: "{{ (dev2_firmux.stdout | default('') | trim | lower | regex_replace('\\s*rev\\s*','-r')) }}"
current_fw_core: "{{ (_firmux_norm | regex_search('[0-9]+\\.[0-9]+\\.[0-9]+-r[0-9]+')) | default('', true) }}"
current_fw_core_dash: "{{ (dev2_firmux.stdout | default('') | regex_search('[0-9]+\\.[0-9]+\\.[0-9]+-r[0-9]+')) | default('', true) }}"
- name: Parse current firmware core from DEV2 firmux (alt 'X.Y.Z rev NNNN' → 'X.Y.Z-rNNNN')
when: dev2_firmux is defined and (current_fw_core_dash | length) == 0
delegate_to: localhost
ansible.builtin.set_fact:
current_fw_core_rev_parts: "{{ (dev2_firmux.stdout | default('') | regex_search('([0-9]+\\.[0-9]+\\.[0-9]+)\\s+rev\\s+([0-9]+)')) | default('', true) }}"
- name: Normalize current firmware core (prefer '-r' form; else build from 'rev')
delegate_to: localhost
ansible.builtin.set_fact:
current_fw_core: >-
{% if (current_fw_core_dash | default('') | length) > 0 -%}
{{ current_fw_core_dash }}
{%- elif (current_fw_core_rev_parts | default('') | length) > 0 -%}
{{ (dev2_firmux.stdout | regex_replace('.*([0-9]+\\.[0-9]+\\.[0-9]+)\\s+rev\\s+([0-9]+).*','\\1-r\\2')) }}
{%- else -%}
{{ '' }}
{%- endif %}
- name: Soft-block if current firmware already matches target (skip staging/write/flip)
when:
@@ -758,12 +775,12 @@
register: local_md5
changed_when: false
# >>> CHANGE 2: Local md5 mismatch is a SOFT-BLOCK, not a hard assert <<<
# **** CHANGE: MD5 mismatch becomes SOFT-BLOCK (no assert) ****
- name: Soft-block if local md5 does not match expected
when: local_img.stat.exists and ((local_md5.stdout | trim) != image_md5)
ansible.builtin.set_fact:
_prep_blocked: true
_blocked: true
_prep_blocked: true
_journal: "{{ _journal + [ 'Local md5 mismatch: have=' ~ (local_md5.stdout | trim) ~ ' expected=' ~ image_md5 ] }}"
# Optional SHA256 local