2019-10-28 17:28:15 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Parse arguments
|
|
|
|
builddir=$1
|
|
|
|
pkgdir=$2
|
|
|
|
_carch=$3
|
|
|
|
_flavor=$4
|
2020-03-08 15:58:05 +00:00
|
|
|
_outdir=$5
|
2019-10-28 17:28:15 +00:00
|
|
|
|
|
|
|
if [ -z "$builddir" ] || [ -z "$pkgdir" ] || [ -z "$_carch" ] ||
|
|
|
|
[ -z "$_flavor" ]; then
|
|
|
|
echo "ERROR: missing argument!"
|
|
|
|
echo "Please call downstreamkernel_package() with \$builddir, \$pkgdir,"
|
2020-03-08 15:58:05 +00:00
|
|
|
echo "\$_carch, \$_flavor (and optionally \$_outdir) as arguments."
|
2019-10-28 17:28:15 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
# kernel.release
|
2020-03-08 15:58:05 +00:00
|
|
|
install -D "$builddir/$_outdir/include/config/kernel.release" \
|
2019-10-28 17:28:15 +00:00
|
|
|
"$pkgdir/usr/share/kernel/$_flavor/kernel.release"
|
|
|
|
|
|
|
|
# zImage (find the right one)
|
|
|
|
# shellcheck disable=SC2164
|
2020-03-08 15:58:05 +00:00
|
|
|
cd "$builddir/$_outdir/arch/$_carch/boot"
|
2019-10-28 17:28:15 +00:00
|
|
|
_target="$pkgdir/boot/vmlinuz-$_flavor"
|
2020-03-05 12:26:23 +00:00
|
|
|
|
|
|
|
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
|
2019-10-28 17:28:15 +00:00
|
|
|
fi
|