From ee14ec3272e812544ba565ae66c5fa02e93e3f97 Mon Sep 17 00:00:00 2001 From: Luca Weiss Date: Mon, 16 Nov 2020 14:16:16 +0100 Subject: [PATCH] linux-samsung-n7100: use devicepkg-dev (MR 1751) --- device/testing/linux-samsung-n7100/APKBUILD | 110 +++++------------- .../linux-samsung-n7100/compiler-gcc6.h | 69 ----------- 2 files changed, 30 insertions(+), 149 deletions(-) delete mode 100644 device/testing/linux-samsung-n7100/compiler-gcc6.h diff --git a/device/testing/linux-samsung-n7100/APKBUILD b/device/testing/linux-samsung-n7100/APKBUILD index 573c1c0d2..cdb4614c4 100644 --- a/device/testing/linux-samsung-n7100/APKBUILD +++ b/device/testing/linux-samsung-n7100/APKBUILD @@ -1,47 +1,17 @@ -# APKBUILD based on linux-vanilla aport. Changes: -# - disabled module installation -# - add !check !tracedeps -# - package: just install zimage and kernel.release, because the kernel config -# does not generate modules or dtb files -# - do not create -dev subpackage (makes no sense without module support) -# +# Reference: # Kernel config based on: arch/arm/configs/cyanogenmod_n7100_defconfig -# Changes: -# - enable devtmpfs (needed for udev -> touch support in weston) -# Patches: -# extdsp_inline.patch: Fix for extern and inline errors on compile -# fimc_lite.patch: Fix for inline error -# timeconst_fix.patch: Removed condition for deprecated feature in Perl (bug present in Linux 3.9 and under) -# - disable ANDROID_PARANOID_NETWORK (removes network restrictions) -_flavor=samsung-n7100 -_hash="5790cd7defee9cb6f9b392af4e3569e51230917a" -_config="config-$_flavor.armhf" - -pkgname=linux-$_flavor +pkgname=linux-samsung-n7100 pkgver=3.0.64 -case $pkgver in - *.*.*) _kernver=${pkgver%.*};; - *.*) _kernver=$pkgver;; -esac -pkgrel=9 +pkgrel=10 +pkgdesc="Samsung Galaxy Note II kernel fork" arch="armhf" -pkgdesc="Samsung Galaxy Note II (GSM) Kernel from ParanoidNote" -url="https://github.com/bigbiff/android_kernel_samsung_smdk4412" -makedepends="perl sed installkernel bash gmp-dev bc linux-headers elfutils-dev gcc6" -options="!strip !check !tracedeps pmb:cross-native" -source=" - $pkgname-$_hash.tar.gz::https://github.com/bigbiff/android_kernel_samsung_smdk4412/archive/$_hash.tar.gz - $_config - compiler-gcc6.h - timeconst.pl-Eliminate-Perl-warning.patch - fimc_lite.patch - extdsp_inline.patch -" -license="GPL2" - -_abi_release=$pkgver _carch="arm" +_flavor="samsung-n7100" +url="https://kernel.org" +license="GPL-2.0-only" +options="!strip !check !tracedeps pmb:cross-native" +makedepends="bash bc bison devicepkg-dev flex openssl-dev perl gcc6" # Compiler: this kernel was only tested with GCC6. Feel free to make a merge # request if you find out that it is booting working with newer GCCs as @@ -52,57 +22,37 @@ if [ "${CC:0:5}" != "gcc6-" ]; then CROSS_COMPILE="gcc6-$CROSS_COMPILE" fi -ksrcdir="$srcdir/android_kernel_samsung_smdk4412-$_hash" +# Source +_repository="android_kernel_samsung_smdk4412" +_commit="5790cd7defee9cb6f9b392af4e3569e51230917a" +_config="config-$_flavor.$arch" +source=" + $pkgname-$_commit.tar.gz::https://github.com/bigbiff/$_repository/archive/$_commit.tar.gz + $_config + timeconst.pl-Eliminate-Perl-warning.patch + extdsp_inline.patch + fimc_lite.patch +" +builddir="$srcdir/$_repository-$_commit" +_outdir="out" prepare() { - local _patch_failed= - cd "$ksrcdir" - - # first apply patches in specified order - for i in $source; do - case $i in - *.patch) - msg "Applying $i..." - if ! patch -s -p1 -N -i "$srcdir"/$i; then - echo $i >>failed - _patch_failed=1 - fi - ;; - esac - done - - if ! [ -z "$_patch_failed" ]; then - error "The following patches failed:" - cat failed - return 1 - fi - - # gcc6 support - cp -v "$srcdir/compiler-gcc6.h" "$ksrcdir/include/linux/" - - mkdir -p "$srcdir"/build - cp "$srcdir"/$_config "$srcdir"/build/.config - make -k -C "$ksrcdir" O="$srcdir"/build ARCH="$_carch" HOSTCC="$HOSTCC" \ - silentoldconfig + default_prepare + . downstreamkernel_prepare } build() { - cd "$srcdir"/build unset LDFLAGS - make ARCH="$_carch" CC="${CC:-gcc}" \ - KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-Alpine" + make O="$_outdir" ARCH="$_carch" CC="${CC:-gcc}" \ + KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-postmarketOS" } package() { - install -Dm644 "$srcdir/build/arch/arm/boot/zImage" \ - "$pkgdir/boot/vmlinuz-$_flavor" - - install -D "$srcdir/build/include/config/kernel.release" \ - "$pkgdir/usr/share/kernel/$_flavor/kernel.release" + downstreamkernel_package "$builddir" "$pkgdir" "$_carch" "$_flavor" "$_outdir" } + sha512sums="02dc37618cee9366ad34ca3e435253323d19cc687d6f25dc15fef1ba8ef9b637f96231ce05991979ff250b8f547fde6c54d64eaa8a9d3369d4a896339524bb98 linux-samsung-n7100-5790cd7defee9cb6f9b392af4e3569e51230917a.tar.gz 05e40dc9d1d0c27a73a8c30fd5dfef82baf7a0b6612b79d792d8857e9fae8c58c234ae93ce75eb7e57ba69ef0a630159730dc980046a5a026597e161b1eebacc config-samsung-n7100.armhf -d80980e9474c82ba0ef1a6903b434d8bd1b092c40367ba543e72d2c119301c8b2d05265740e4104ca1ac5d15f6c4aa49e8776cb44264a9a28dc551e0d1850dcc compiler-gcc6.h 1fcfb5f06a2bfdcc55d53054ca80d1b989599a39a5379d057a0724fc405187d74da4309a650e70b9c79d39444e81923cfc5c9199ed8c0a77c83dcd7998446bb7 timeconst.pl-Eliminate-Perl-warning.patch -fe682960d8d8534e14712a4d2bf9e41abed34ec3a29dcaace0fc1115cda08f6bc4c83cd130413d92cda2091be711e3ded91767c30f080a6d9cf7952f068f052c fimc_lite.patch -54b345e988b20078260c859d047fc67eec4de0a82cc4c7a19537dac3a797cfc7adbcd41f2af51814d7a6b5d93c5825078381aa7207b5db0cc2b671e495682140 extdsp_inline.patch" +54b345e988b20078260c859d047fc67eec4de0a82cc4c7a19537dac3a797cfc7adbcd41f2af51814d7a6b5d93c5825078381aa7207b5db0cc2b671e495682140 extdsp_inline.patch +fe682960d8d8534e14712a4d2bf9e41abed34ec3a29dcaace0fc1115cda08f6bc4c83cd130413d92cda2091be711e3ded91767c30f080a6d9cf7952f068f052c fimc_lite.patch" diff --git a/device/testing/linux-samsung-n7100/compiler-gcc6.h b/device/testing/linux-samsung-n7100/compiler-gcc6.h deleted file mode 100644 index 844706318..000000000 --- a/device/testing/linux-samsung-n7100/compiler-gcc6.h +++ /dev/null @@ -1,69 +0,0 @@ -// SOURCE: -// https://github.com/NextThingCo/CHIP-u-boot/issues/10#issuecomment-287515505 - -#ifndef __LINUX_COMPILER_H -#error "Please don't include directly, include instead." -#endif - -#define __used __attribute__((__used__)) -#define __must_check __attribute__((warn_unused_result)) -#define __compiler_offsetof(a, b) __builtin_offsetof(a, b) - -/* Mark functions as cold. gcc will assume any path leading to a call - to them will be unlikely. This means a lot of manual unlikely()s - are unnecessary now for any paths leading to the usual suspects - like BUG(), printk(), panic() etc. [but let's keep them for now for - older compilers] - - Early snapshots of gcc 4.3 don't support this and we can't detect this - in the preprocessor, but we can live with this because they're unreleased. - Maketime probing would be overkill here. - - gcc also has a __attribute__((__hot__)) to move hot functions into - a special section, but I don't see any sense in this right now in - the kernel context */ -#define __cold __attribute__((__cold__)) - -#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__) - -#ifndef __CHECKER__ -# define __compiletime_warning(message) __attribute__((warning(message))) -# define __compiletime_error(message) __attribute__((error(message))) -#endif /* __CHECKER__ */ - -/* - * Mark a position in code as unreachable. This can be used to - * suppress control flow warnings after asm blocks that transfer - * control elsewhere. - * - * Early snapshots of gcc 4.5 don't support this and we can't detect - * this in the preprocessor, but we can live with this because they're - * unreleased. Really, we need to have autoconf for the kernel. - */ -#define unreachable() __builtin_unreachable() - -/* Mark a function definition as prohibited from being cloned. */ -#define __noclone __attribute__((__noclone__)) - -/* - * Tell the optimizer that something else uses this function or variable. - */ -#define __visible __attribute__((externally_visible)) - -/* - * GCC 'asm goto' miscompiles certain code sequences: - * - * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670 - * - * Work it around via a compiler barrier quirk suggested by Jakub Jelinek. - * - * (asm goto is automatically volatile - the naming reflects this.) - */ -#define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0) - -#ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP -#define __HAVE_BUILTIN_BSWAP32__ -#define __HAVE_BUILTIN_BSWAP64__ -#define __HAVE_BUILTIN_BSWAP16__ -#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */ -