diff --git a/main/devicepkg-dev/APKBUILD b/main/devicepkg-dev/APKBUILD index 08d4d7a50..47c33a3b1 100644 --- a/main/devicepkg-dev/APKBUILD +++ b/main/devicepkg-dev/APKBUILD @@ -1,5 +1,5 @@ pkgname="devicepkg-dev" -pkgver=0.12.0 +pkgver=0.12.1 pkgrel=0 pkgdesc="Provides default device package functions" url="https://postmarketos.org" @@ -63,8 +63,8 @@ package() { sha512sums="d69930dd790b00fb39760a37d95a10899f0d167e10e2804feb05d9ce04f94185dc32d36edc90214aba2ea2aa09bf18f7dab93f1d2eff23f67beb2cc83be30e7c compiler-gcc.h 332f693abfb3260ad6c1ef5d245062af8cc8eedba7db360d54db5a7fcf7b301a37a299a0004e9ff4de80b5dfcd260d0cd0f99f96ed6d56080bb4dea81116cc82 devicepkg_build.sh 10bda1a999891d6234bcfa3eb277b125c02361a031c5ff8445dabaae11e289321a6227f9f0973c7aa143a3df0512399bd0e3b2aa5a8ee560b28e1b135bad8635 devicepkg_package.sh -69dad4bde05377ec235d72789c80cdfbdaa5a19b97defe9d4c19e0e12aa2c081d6dcf19fb80ebe33c2d6539ce8a39d36d98413404852d6bb2d56cc75d2f1ee95 downstreamkernel_prepare.sh -8a6a0afa6e499b59c5433194298d13eb07712c4344e1dd4f71fdc34a2836950a12247c61aa7563bd646efff6118b377ceb387f09170282896809a160b3d9cd04 downstreamkernel_package.sh +f7583b92a27b39d79762700a48853b8d641845cdd45eb875d6fddc236f4d70598927d4dfc7d237870617b77b42820686692a68220f610dbc01c76402d9edfb2e downstreamkernel_prepare.sh +776d7c36afc7bedbd531641abe90fa4bf06a519ad9e300dedf67b6d3b4997b57a398938dd528d5eeda6d17e0d34644472702a4fdd8ff41e0a4a7ad0671f4a216 downstreamkernel_package.sh cf5ee240cd1c1e9d30cdec833b4a007fd2e00f9a32ba3f265f99aa2e3dd3601cf43c08d3f3e01bade1d5b2648a6754b2f236e5cb4a9945e18e5c4e97aa2ed7c8 devicepkg_subpackage_kernel.sh 9bb7f2a0930f397a713e9f4b6d5b83a426d9a2a3f692dcc42ac30717bf26ead869d8823a38f3ad388af12b2b9a02e8ec4d4418e9c2062389ed06d2b891a49ff3 deviceinfo 136247a16ec91dc0c7241eeddb28c2196ae3b29946a9bc7e9566f848491ef1c53b12d05bf2dbc1cc352986712fd76f25c1510bcc8f301af540a2f01c33b299e1 expected-deviceinfo-downstream diff --git a/main/devicepkg-dev/downstreamkernel_package.sh b/main/devicepkg-dev/downstreamkernel_package.sh index ef589a446..23577cedb 100644 --- a/main/devicepkg-dev/downstreamkernel_package.sh +++ b/main/devicepkg-dev/downstreamkernel_package.sh @@ -5,22 +5,23 @@ builddir=$1 pkgdir=$2 _carch=$3 _flavor=$4 +_outdir=$5 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." + echo "\$_carch, \$_flavor (and optionally \$_outdir) as arguments." exit 1 fi # kernel.release -install -D "$builddir/include/config/kernel.release" \ +install -D "$builddir/$_outdir/include/config/kernel.release" \ "$pkgdir/usr/share/kernel/$_flavor/kernel.release" # zImage (find the right one) # shellcheck disable=SC2164 -cd "$builddir/arch/$_carch/boot" +cd "$builddir/$_outdir/arch/$_carch/boot" _target="$pkgdir/boot/vmlinuz-$_flavor" if [ -n "$KERNEL_IMAGE_NAME" ]; then diff --git a/main/devicepkg-dev/downstreamkernel_prepare.sh b/main/devicepkg-dev/downstreamkernel_prepare.sh index 30d51205a..46593989c 100644 --- a/main/devicepkg-dev/downstreamkernel_prepare.sh +++ b/main/devicepkg-dev/downstreamkernel_prepare.sh @@ -3,6 +3,7 @@ # Replace compiler-gcc.h with one that works with newer GCC versions. # Set REPLACE_GCCH=0 to avoid replacing an existing compiler-gcc.h file. install_gcc_h() { + # shellcheck disable=SC2154 _gcch="$builddir/include/linux/compiler-gcc.h" if [ -f "$_gcch" ]; then if [ "$REPLACE_GCCH" = "0" ]; then @@ -21,23 +22,19 @@ install_gcc_h() { cp -v "/usr/share/devicepkg-dev/compiler-gcc.h" "$_gcch" } -# Parse arguments -srcdir=$1 -builddir=$2 -_config=$3 -_carch=$4 -HOSTCC=$5 - -if [ -z "$srcdir" ] || [ -z "$builddir" ] || [ -z "$_config" ] || - [ -z "$_carch" ]; then - echo "ERROR: missing argument!" - echo "Please call downstreamkernel_prepare() with \$srcdir, \$builddir," - echo "\$_config, \$_carch (and optionally \$HOSTCC) as arguments." +if [ "$#" -ne 0 ]; then + echo "ERROR: downstreamkernel_prepare should be sourced in APKBUILDs." + echo "Related: https://postmarketos.org/downstreamkernel-prepare" exit 1 fi -# Only override HOSTCC if set (to force use of an old gcc) -[ -z "$HOSTCC" ] || HOSTCC="HOSTCC=$HOSTCC" +# Set _outdir to "." if not set +if [ -z "$_outdir" ]; then + _outdir="." +fi + +# Set _hostcc when HOSTCC is set +[ -z "$HOSTCC" ] || _hostcc="HOSTCC=$HOSTCC" # Support newer GCC versions install_gcc_h @@ -52,6 +49,9 @@ for i in $makefiles; do done # Prepare kernel config ('yes ""' for kernels lacking olddefconfig) -cp "$srcdir/$_config" "$builddir"/.config -# shellcheck disable=SC2086 -yes "" | make -C "$builddir" ARCH="$_carch" $HOSTCC oldconfig +mkdir -p "$builddir/$_outdir" +# shellcheck disable=SC2154 +cp "$srcdir/$_config" "$builddir"/"$_outdir"/.config +# shellcheck disable=SC2086,SC2154 +yes "" | make -C "$builddir" ARCH="$_carch" O="$_outdir" \ + $_hostcc oldconfig