From 419f042f558866cd3283af9817bf180e8e98be26 Mon Sep 17 00:00:00 2001 From: Marc Hartmayer Date: Tue, 11 Nov 2025 09:07:27 +0000 Subject: [PATCH] netboot: Improve error reporting in mk-s390image MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If an input file is not readable return a proper error message indicating this. Before: $ mk-s390image /var/lib/libvirt/images/hades/vmlinux-s390x out.img mk-s390image: Unrecognized file format for /var/lib/libvirt/images/hades/vmlinux-s390x After: $ mk-s390image /var/lib/libvirt/images/hades/vmlinux-s390x out.img mk-s390image: File /var/lib/libvirt/images/hades/vmlinux-s390x cannot be read, no read permission Reviewed-by: Jan Höppner Signed-off-by: Marc Hartmayer Signed-off-by: Jan Höppner --- netboot/mk-s390image | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/netboot/mk-s390image b/netboot/mk-s390image index 19214c0e..de8158c7 100755 --- a/netboot/mk-s390image +++ b/netboot/mk-s390image @@ -123,6 +123,11 @@ dobuild() echo "$cmd: File $i not found" >&2 return 1 fi + if [ ! -r "$i" ] + then + echo "$cmd: File $i cannot be read, no read permission" >&2 + return 1 + fi done if ! file -b -- "$(readlink -f -- "$kernel")" | grep "Linux S390" > /dev/null then