armbian-next: add (trap) cleanup handler to reset ./tmp and ./output to original pre-sudo UID before exiting, even with failure/abort

This commit is contained in:
Ricardo Pardini
2023-01-03 17:44:11 +01:00
parent 9973010972
commit 690ca4df7c
4 changed files with 24 additions and 14 deletions

View File

@@ -121,7 +121,6 @@ create_image_from_sdcard_rootfs() {
[[ -n $compression_type ]] && run_host_command_logged rm -v "${DESTIMG}/${version}.img"
run_host_command_logged rsync -av --no-owner --no-group --remove-source-files "${DESTIMG}/${version}"* "${FINALDEST}"
run_host_command_logged rm -rfv --one-file-system "${DESTIMG}"
reset_uid_owner "${FINALDEST}" # Fix owner of files in the final destination
# write image to SD card
write_image_to_device "${FINALDEST}/${version}.img" "${CARD_DEVICE}"