rpi-eeprom-update: Set file permissions on the EEPROM update files

Normally BOOTFS is a local FAT partition but with NFS it's possible
that the NFS mount of /boot is not setup to have the equivalent
permissions as /boot. Set the .upd,.sig files to be readable by
all users to to avoid the case where the file is visible to root on the
Pi but is not readable by the TFTP daemon on the server.
This commit is contained in:
Tim Gover
2020-07-21 16:06:10 +01:00
parent bb2fcf63f8
commit a5794dde78

View File

@@ -164,12 +164,18 @@ applyRecoveryUpdate()
cp -f "${TMP_EEPROM_IMAGE}" "${BOOTFS}/pieeprom.upd" \
|| die "Failed to copy ${TMP_EEPROM_IMAGE} to ${BOOTFS}"
# For NFS mounts ensure that the files are readable to the TFTP user
chmod -f go+r "${BOOTFS}/pieeprom.upd" "${BOOTFS}/pieeprom.sig"
fi
if [ -n "${VL805_UPDATE_IMAGE}" ]; then
sha256sum "${VL805_UPDATE_IMAGE}" | awk '{print $1}' > "${BOOTFS}/vl805.sig" \
|| die "Failed to create ${BOOTFS}/vl805.sig"
cp -f "${VL805_UPDATE_IMAGE}" "${BOOTFS}/vl805.bin"
# For NFS mounts ensure that the files are readable to the TFTP user
chmod -f go+r "${BOOTFS}/vl805.bin" "${BOOTFS}/vl805.sig"
fi
cp -f "${RECOVERY_BIN}" "${BOOTFS}/recovery.bin" \