rpi-eeprom-config: Trap errors when deleting previous update files

This commit is contained in:
Tim Gover
2020-09-28 22:03:53 +01:00
parent 5ab94e88f2
commit 6ab4179bae

View File

@@ -631,6 +631,7 @@ removePreviousUpdates()
if [ "$(id -u)" = "0" ]; then if [ "$(id -u)" = "0" ]; then
findBootFS findBootFS
(
# Remove any stale recovery.bin files or EEPROM images # Remove any stale recovery.bin files or EEPROM images
# N.B. recovery.bin is normally ignored by the ROM if is not a valid # N.B. recovery.bin is normally ignored by the ROM if is not a valid
# executable but it's best to not have the file at all. # executable but it's best to not have the file at all.
@@ -639,6 +640,7 @@ removePreviousUpdates()
rm -f "${BOOTFS}/vl805.bin" "${BOOTFS}/vl805.sig" rm -f "${BOOTFS}/vl805.bin" "${BOOTFS}/vl805.sig"
# Case insensitive for FAT bootfs # Case insensitive for FAT bootfs
find "${BOOTFS}" -maxdepth 1 -type f -follow -iname "recovery.*" -regex '.*\.[0-9][0-9][0-9]$' -exec rm -f {} \; find "${BOOTFS}" -maxdepth 1 -type f -follow -iname "recovery.*" -regex '.*\.[0-9][0-9][0-9]$' -exec rm -f {} \;
) || die "Failed to remove previous update files"
fi fi
} }