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