main/devicepkg-dev: allow specifying kernel image in downstreamkernel_prepare (!1026)

This commit is contained in:
Dolphin von Chips 2020-03-05 17:26:23 +05:00 committed by Oliver Smith
parent e38738d1ee
commit 2ec1db16b5
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
2 changed files with 22 additions and 11 deletions

View file

@ -22,13 +22,24 @@ install -D "$builddir/include/config/kernel.release" \
# shellcheck disable=SC2164
cd "$builddir/arch/$_carch/boot"
_target="$pkgdir/boot/vmlinuz-$_flavor"
for _zimg in zImage-dtb Image.gz-dtb *zImage Image; do
[ -e "$_zimg" ] || continue
echo "zImage found: $_zimg"
install -Dm644 "$_zimg" "$_target"
break
done
if ! [ -e "$_target" ]; then
echo "Could not find zImage in $PWD!"
exit 1
if [ -n "$KERNEL_IMAGE_NAME" ]; then
if ! [ -e "$KERNEL_IMAGE_NAME" ]; then
echo "Could not find \$KERNEL_IMAGE_NAME in $PWD!"
exit 1
else
echo "NOTE: using $KERNEL_IMAGE_NAME as kernel image."
install -Dm644 "$KERNEL_IMAGE_NAME" "$_target"
fi
else
for _zimg in zImage-dtb Image.gz-dtb *zImage Image; do
[ -e "$_zimg" ] || continue
echo "zImage found: $_zimg"
install -Dm644 "$_zimg" "$_target"
break
done
if ! [ -e "$_target" ]; then
echo "Could not find zImage in $PWD!"
exit 1
fi
fi