rpi-update: Only copy kernel files if they exist

This commit is contained in:
Dom Cobley
2023-01-20 17:16:44 +00:00
parent 24e0eeb75a
commit e28aa80194

View File

@@ -357,13 +357,14 @@ function update_firmware {
fi fi
if [[ ${SKIP_KERNEL} -eq 0 ]]; then if [[ ${SKIP_KERNEL} -eq 0 ]]; then
if [[ ${WANT_32BIT} -eq 1 ]]; then if [[ ${WANT_32BIT} -eq 1 ]]; then
cp "${FW_REPOLOCAL}/"kernel.img "${FW_REPOLOCAL}/"kernel7.img "${FW_PATH}/" [[ -e "${FW_REPOLOCAL}/"kernel.img ]] && cp "${FW_REPOLOCAL}/"kernel.img "${FW_PATH}/"
[[ -e "${FW_REPOLOCAL}/"kernel7.img ]] && cp "${FW_REPOLOCAL}/"kernel7.img "${FW_PATH}/"
if [[ ${WANT_PI4} -eq 1 ]]; then if [[ ${WANT_PI4} -eq 1 ]]; then
cp "${FW_REPOLOCAL}/"kernel7l.img "${FW_PATH}/" [[ -e "${FW_REPOLOCAL}/"kernel7l.img ]] && cp "${FW_REPOLOCAL}/"kernel7l.img "${FW_PATH}/"
fi fi
fi fi
if [[ ${WANT_64BIT} -eq 1 ]]; then if [[ ${WANT_64BIT} -eq 1 ]]; then
cp "${FW_REPOLOCAL}/"kernel8.img "${FW_PATH}/" [[ -e "${FW_REPOLOCAL}/"kernel8.img ]] && cp "${FW_REPOLOCAL}/"kernel8.img "${FW_PATH}/"
fi fi
if [[ -n $(shopt -s nullglob; echo "${FW_REPOLOCAL}/"*.dtb*) ]]; then if [[ -n $(shopt -s nullglob; echo "${FW_REPOLOCAL}/"*.dtb*) ]]; then
cp "${FW_REPOLOCAL}/"*.dtb* "${FW_PATH}/" cp "${FW_REPOLOCAL}/"*.dtb* "${FW_PATH}/"