Skip to content

Commit 2f3754d

Browse files
committed
flash.sh: replace die calls by recovery calls where relevant otherwise returning to caller without being useful
Signed-off-by: Thierry Laurion <[email protected]>
1 parent a4ef189 commit 2f3754d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

initrd/bin/flash.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ flash_rom() {
2626
ROM=$1
2727
if [ "$READ" -eq 1 ]; then
2828
$CONFIG_FLASH_OPTIONS -r "${ROM}" \
29-
|| die "Backup to $ROM failed"
29+
|| recovery "Backup to $ROM failed"
3030
else
3131
cp "$ROM" /tmp/${CONFIG_BOARD}.rom
3232
sha256sum /tmp/${CONFIG_BOARD}.rom
3333
if [ "$CLEAN" -eq 0 ]; then
3434
preserve_rom /tmp/${CONFIG_BOARD}.rom \
35-
|| die "$ROM: Config preservation failed"
35+
|| recovery "$ROM: Config preservation failed"
3636
fi
3737
# persist serial number from CBFS
3838
if cbfs.sh -r serial_number > /tmp/serial 2>/dev/null; then
@@ -51,7 +51,7 @@ flash_rom() {
5151

5252
warn "Do not power off computer. Updating firmware, this will take a few minutes..."
5353
$CONFIG_FLASH_OPTIONS -w /tmp/${CONFIG_BOARD}.rom 2>&1 \
54-
|| die "$ROM: Flash failed"
54+
|| recovery "$ROM: Flash failed"
5555
fi
5656
}
5757

@@ -86,7 +86,7 @@ if [ "$READ" -eq 0 ] && [ "${ROM##*.}" = tgz ]; then
8686

8787
echo "Reading current flash and building an update image"
8888
$CONFIG_FLASH_OPTIONS -r /tmp/flash.sh.bak \
89-
|| die "Read of flash has failed"
89+
|| recovery "Read of flash has failed"
9090

9191
# ROM and bootblock already have ECC
9292
bootblock=$(echo /tmp/verified_rom/*.bootblock)

0 commit comments

Comments
 (0)