Create "downstreamkernel_package" just like "downstreamkernel_prepare", to have less redundant code in kernel APKBUILDs
Almost every downstreamkernel's package function has this common block:
package() {
# kernel.release
install -D "$builddir/include/config/kernel.release" \
"$pkgdir/usr/share/kernel/$_flavor/kernel.release"
# zImage (find the right one)
cd "$builddir/arch/$_carch/boot"
_target="$pkgdir/boot/vmlinuz-$_flavor"
for _zimg in zImage-dtb Image.gz-dtb *zImage Image; do
[ -e "$_zimg" ] || continue
msg "zImage found: $_zimg"
install -Dm644 "$_zimg" "$_target"
break
done
if ! [ -e "$_target" ]; then
error "Could not find zImage in $PWD!"
return 1
fi
}
We are generating it here.
It would be great if we had a downstreamkernel_package function, just like downstreamkernel_prepare, to save this redundant piece at least in new kernels. That makes code reviews quicker, less room for mistakes, less code to understand for the device porters, better maintainability etc
If somebody wants to take a shot at this and needs more information to do it, don't hesitate to ask.
Related: #1570 devicepkg-dev kernel prepare function
Edited by Administrator