kbuild, deb-pkg: Check if KBUILD_IMAGE exists before copying it

Avoid an error when doing cp over the image when it does not contain
the full path to the file.

Signed-off-by: Guillem Jover <guillem@hadrons.org>
Signed-off-by: Michal Marek <mmarek@suse.cz>

authored by Guillem Jover and committed by Michal Marek 242c5ab0 aa42abed

+3 -1
+3 -1
scripts/package/builddeb
··· 66 66 cp System.map "$tmpdir/boot/System.map-$version" 67 67 cp .config "$tmpdir/boot/config-$version" 68 68 # Not all arches include the boot path in KBUILD_IMAGE 69 - if ! cp $KBUILD_IMAGE "$tmpdir/boot/vmlinuz-$version"; then 69 + if [ -e $KBUILD_IMAGE ]; then 70 + cp $KBUILD_IMAGE "$tmpdir/boot/vmlinuz-$version" 71 + else 70 72 cp arch/$ARCH/boot/$KBUILD_IMAGE "$tmpdir/boot/vmlinuz-$version" 71 73 fi 72 74 fi