File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -451,6 +451,7 @@ if [[ $ACTIVATE_FLOW -eq 1 || $CANCEL_FLOW -eq 1 || $COMPATIBILITY_FLOW -eq 1 ||
451451 if [ $RC -ne 0 ]; then
452452 log " ERR $0 flow failed with RC: $RC "
453453 ilog " Removing BFB directory: $BFB_DIR "
454+ set_status $FAILED
454455 fi
455456 cd ${WDIR}
456457 /bin/rm -rf dump-*
Original file line number Diff line number Diff line change @@ -5,6 +5,9 @@ write_RshimSP2_path=/sys/firmware/efi/efivars/RshimSP2W-f3ce977e-c17f-493e-a3cd-
55status_clear_mask=$(( ~( (1 << 11) | (1 << 12) ) ))
66progress_clear_mask=$(( ~( (1 << 13) | (1 << 14) | (1 << 15)) ))
77
8+ IN_PROGRESS=0x1
9+ COMPLETED=0x2
10+ FAILED=0x3
811
912# Function to read 8 bytes from a specific offset and convert to UINT64 little-endian
1013read_SP2() {
@@ -79,10 +82,12 @@ is_mode_cancel() {
7982 fi
8083}
8184
82- set_status_idle () {
85+ set_status () {
8386 # SP2.BIT11-12
8487 local result=$(( SP2 & status_clear_mask ))
85- ilog "set_status_idle: $result"
88+ result=$(( result | ($1 << 11) ))
89+
90+ ilog "set_status: $result"
8691 write_uint64_with_prefix "$result"
8792}
8893
@@ -92,11 +97,14 @@ set_upgrade_progress() {
9297 local percent
9398 SP2=$(read_SP2)
9499 local result=$(( SP2 & progress_clear_mask ))
100+ result=$(( result & status_clear_mask ))
95101 if [ $1 -lt 100 ]; then
96102 percent=$(( $1 / 20 ))
97103 [ $percent -lt 0 ] && percent=0
104+ result=$(( result | (IN_PROGRESS << 11) ))
98105 else
99106 percent=5
107+ result=$(( result | (COMPLETED << 11) ))
100108 fi
101109
102110 result=$(( result | (percent << 13) ))
You can’t perform that action at this time.
0 commit comments