# Reference: # Kernel config based on: arch/arm64/configs/on7xelteswa_00_defconfig pkgname=linux-samsung-on7xelte pkgver=3.18.14 pkgrel=0 pkgdesc="Samsung Galaxy J7 Prime kernel fork" arch="aarch64" _carch="arm64" _flavor="samsung-on7xelte" url="https://kernel.org" license="GPL-2.0-only" options="!strip !check !tracedeps pmb:cross-native" makedepends=" bash bc bison devicepkg-dev dtbtool-exynos findutils flex gcc4 openssl-dev perl " subpackages="$pkgname-nonfree-firmware:nonfree_firmware" # Compiler: GCC 4 (doesn't boot when compiled with newer versions) if [ "${CC:0:5}" != "gcc4-" ]; then CC="gcc4-$CC" HOSTCC="gcc4-gcc" CROSS_COMPILE="gcc4-$CROSS_COMPILE" fi # Source _repository="linux-downstream-on7xelte" _commit="9932b75127e6363e40a00b6bc6f5ec71ac7fea32" _config="config-$_flavor.$arch" source=" $pkgname-$_commit.tar.gz::https://gitlab.com/linuxforexynos/$_repository/-/archive/$_commit/$_repository-$_commit.tar.gz $_config gcc10-extern_YYLOC_global_declaration.patch gcc7-give-up-on-ilog2-const-optimizations.patch gcc8-fix-put-user.patch generate-device-dtbs.patch disable-fimc-is2.patch fix-usb-gadget-random-mac.patch disable-charging-bootmode.patch decon-fb-colors.patch " builddir="$srcdir/$_repository-$_commit" _outdir="out" prepare() { default_prepare . downstreamkernel_prepare } build() { unset LDFLAGS # Samsung's kernels are built in-tree. # Copy some missing files to the output directory. mkdir -p "$_outdir/init/" mkdir -p "$_outdir/firmware/" cp init/vmm.elf "$_outdir/init/vmm.elf" cp firmware/gnss_firmware.bin "$_outdir/firmware/gnss_firmware.bin" make O="$_outdir" ARCH="$_carch" CC="${CC:-gcc}" \ KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-postmarketOS" # Master DTB (deviceinfo_bootimg_qcdt) dtbTool-exynos -o "$_outdir/arch/$_carch/boot"/dt.img \ $(find "$_outdir/arch/$_carch/boot/dts/" -name *exynos7870*.dtb) } package() { downstreamkernel_package "$builddir" "$pkgdir" "$_carch" \ "$_flavor" "$_outdir" install -Dm644 "$_outdir/arch/$_carch/boot"/dt.img \ "$pkgdir"/boot/dt.img } nonfree_firmware() { pkgdesc="Proprietary Firmware Blobs" depends="firmware-samsung-on7xelte" mkdir "$subpkgdir" } sha512sums=" a988ccbd860dfc0147387ca1f2045534d9ccc82d94213abc586b9556c93c99025ed3d7e0658d41ac2bc4803093cd9352f98611c9a08438fae16a2139e799ec47 linux-samsung-on7xelte-9932b75127e6363e40a00b6bc6f5ec71ac7fea32.tar.gz 96360349f21f39ffdfd05d5f8d16daf067941b66e412b4d4366ac5c79746e06d2a4abf68b9b1d4031e78e06f5dcc9d40972dfbb6186dc1d693dd2f607668a422 config-samsung-on7xelte.aarch64 2b48f1bf0e3f70703d2cdafc47d5e615cc7c56c70bec56b2e3297d3fa4a7a1321d649a8679614553dde8fe52ff1051dae38d5990e3744c9ca986d92187dcdbeb gcc10-extern_YYLOC_global_declaration.patch 77eba606a71eafb36c32e9c5fe5e77f5e4746caac292440d9fb720763d766074a964db1c12bc76fe583c5d1a5c864219c59941f5e53adad182dbc70bf2bc14a7 gcc7-give-up-on-ilog2-const-optimizations.patch 197d40a214ada87fcb2dfc0ae4911704b9a93354b75179cd6b4aadbb627a37ec262cf516921c84a8b1806809b70a7b440cdc8310a4a55fca5d2c0baa988e3967 gcc8-fix-put-user.patch ecfdee788bdfd5bf7c6a740f06a0f43b485e6b4d839f821082e5c734b97ca57396498f7467533afb10c2c32f86c217ec23772845d1dfed36c7d05b57b1f9131d generate-device-dtbs.patch f429f40a8195e81d1c3ef86a5736bb29e09f3daaa2f415b9a992fb4dc8011c961c7b48fc97e08c3180ebacf8c2b97a5560022a9340eb44464e8ef98f3758e19e disable-fimc-is2.patch 0d56ba508408dc31961ad688f7fd960b0008851fd5729088658095417781b99962740e0c64d162a26f8389e4b4dc88e291252e7935e896fc70bf73c23150caea fix-usb-gadget-random-mac.patch 32e51c6171bcb72b15f5f11a9c9b3279e03e630f2ea6d14b66fbfdd8a8c1587bdb7e88698197e9a81e05c47dba08d13c1ff4a5e4692d14b042f07dd2006c1cc0 disable-charging-bootmode.patch 5bd204239a5daff9f990757178398707ae5ec64f823ed9ec72a8d50ebe6d5f0a3cc9743e0d775094da4b3a7566f1ccceb56f39f3b0234d08ca05e537d86271ec decon-fb-colors.patch "