netboot: Ignore the removal of nonexistent file in mk-s390image

Ignore the removal of nonexistent $image file. This removes the
following error message:

$ mk-s390image /var/lib/libvirt/images/hades/vmlinux-s390x out.img
...
rm: cannot remove 'out.img': No such file or directory

Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Marc Hartmayer
2025-11-11 09:11:27 +00:00
committed by Jan Höppner
parent 419f042f55
commit 339b69cf3b

View File

@@ -44,7 +44,7 @@ cleanup()
fi
if [ -n "$image" ] && [ "$success" = no ]
then
rm -- "$image"
rm -f -- "$image"
fi
}
trap cleanup EXIT