main/devicepkg-dev: add downstreamkernel_package helper (!976)
This commit is contained in:
parent
1526bdc0ea
commit
6fee64ccd9
2 changed files with 39 additions and 1 deletions
34
main/devicepkg-dev/downstreamkernel_package.sh
Normal file
34
main/devicepkg-dev/downstreamkernel_package.sh
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Parse arguments
|
||||
builddir=$1
|
||||
pkgdir=$2
|
||||
_carch=$3
|
||||
_flavor=$4
|
||||
|
||||
if [ -z "$builddir" ] || [ -z "$pkgdir" ] || [ -z "$_carch" ] ||
|
||||
[ -z "$_flavor" ]; then
|
||||
echo "ERROR: missing argument!"
|
||||
echo "Please call downstreamkernel_package() with \$builddir, \$pkgdir,"
|
||||
echo "\$_carch and \$_flavor as arguments."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# kernel.release
|
||||
install -D "$builddir/include/config/kernel.release" \
|
||||
"$pkgdir/usr/share/kernel/$_flavor/kernel.release"
|
||||
|
||||
# zImage (find the right one)
|
||||
# shellcheck disable=SC2164
|
||||
cd "$builddir/arch/$_carch/boot"
|
||||
_target="$pkgdir/boot/vmlinuz-$_flavor"
|
||||
for _zimg in zImage-dtb Image.gz-dtb Image.gz *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
|
||||
Loading…
Add table
Add a link
Reference in a new issue