Commit Graph

43 Commits

Author SHA1 Message Date
Alexander Koskovich bf68f29f11
pa: Switch to CAF's kernel build system.
Change-Id: I6aad967b28ed187efaa3f206b3fbc0df6d39d218
2020-09-25 18:14:21 -07:00
Jan Altensen f7c5a44b9a
pa: bacon: Call md5sum directly.
* Fixes "error: MD5SUM is obsolete."

Change-Id: I38e167e24e9eb5596a1e8e2f2d915f648bc1283c
2020-09-18 09:19:52 -07:00
Adithya R a891699f63 kernel: Use correct clang triple for arm
Change-Id: I936cfae2cdd2270c17293c842b6de8263d99d6f9
2020-04-18 20:11:26 +00:00
Adithya R 69611bb6ae kernel: Add 32-bit lib path to clang if available
Change-Id: Ic5624a2847e47b0915e9ecd0ff0ddf084ef1f99e
2020-04-18 20:10:52 +00:00
Kshitij Gupta 0a973bc138 tasks: dtbo: Add support for custom dtbo generation rules
Change-Id: I27fdade5eb177a06795fee7cc19066ec161642d9
2020-03-22 01:00:22 +00:00
Park Ju Hyung 7e90767d7c kernel: use dtc from prebuilt
dtc from OUT_DIR might not be available, so use the prebuilt one instead.

Also, clean-up a little bit and follow the same logic as prebuilt make binary.

Change-Id: I48dd57d7e69a2dbf97c7bd3b225eaf4ec8b41e23
Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
2020-01-06 21:46:31 +09:00
Park Ju Hyung 8bb8f1e5b9 kernel: use the built dtc binary for the kernel
Kernel no longer has to track their own latest dtc with this change

Change-Id: I63229b0a070db2f201bcf4597269711655cab410
Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
2020-01-06 02:31:15 +00:00
Rashed Abdel-Tawab c771370035 kernel: Define DTBS_OUT path for dtb.img building
Change-Id: I9fb3943c44c74985d9a4a841338767345a11ded2
2019-11-13 17:05:53 +01:00
Rashed Abdel-Tawab c9bcedd13b kernel: Move our dtb.img logic here
Our build/make changes break incremenetal builds with prebuilt dtb dir
(see discussion here: https://android-review.googlesource.com/c/platform/build/+/1134337/1/core/Makefile )

Instead of using the AOSP recipe, just define our own and use it by not defining
BOARD_PREBUILT_DTBIMAGE_DIR

Change-Id: If579b1670db447557b6f76ca79ecec22661c4080
2019-11-13 17:05:53 +01:00
Rashed Abdel-Tawab 49b6b7a799 kernel: Build dtb.img from compiled dtbs
Change-Id: If419d090740c005357fbd1665f78296d106b4509
2019-11-13 17:05:53 +01:00
Rashed Abdel-Tawab 417d417656 kernel: Make kernel depend on depmod
After moving modules to this target, we need to depend on depmod

Change-Id: I32ac51173db304cc019e45df006c26a2583b8587
2019-11-13 17:05:53 +01:00
Luca Stefani dc5fdd2f82 kernel: Fix specifying custom clang compiler version
* Folder layout name changed in Q

Change-Id: I823867334e87fbb3c240a92e62484b6531dfcd22
2019-11-13 17:05:53 +01:00
Rashed Abdel-Tawab dcdfd1a611 kernel: Don't re-define dtbo.img names
These are already set in BoardConfig, no need to set them again

Change-Id: I30eb44f748d0f427145beb5d6cd53ece14281abd
2019-11-13 17:05:53 +01:00
Simon Shields 37531585aa build: dt_image: support prebuilt DT images
If for whatever reason we need a prebuilt DT image,
it has to end up in target files for the signing slave.
Change BOARD_KERNEL_PREBUILT_DT to hold the path of the
prebuilt DT image, if it's going to be used.

Change-Id: I8042d347d271da5c3963824777d399bbc4229aa9
2019-11-13 17:05:53 +01:00
Harsh Shandilya 36d451394a tasks: bacon: Don't create identical otapackages
Saves space

Change-Id: I9b0472c617d695330614baf8b41afb918cac0dac
Signed-off-by: Harsh Shandilya <harsh@prjkt.io>
2019-09-18 14:07:36 +05:30
André Pinela 147e8101af tasks: enhancement to create pa ota package
- modify for Paranoid Android
- add bacon target
- don't touch aosp otapackage target

Change-Id: Id243c3099b4914ed3b53efc42c0c7dac9d56dea8
Signed-off-by: André Pinela <sheffzor@gmail.com>
2019-09-18 14:07:20 +05:30
dianlujitao b29de9dfc2 kernel: Fix module installation and clean up
* Fold module installation into kernel image recipe.
 * Specify make argument to strip modules on installation instead of
   explicitly invoking the strip tool.
 * Remove support of TARGET_KERNEL_MODULES, it's a phony target thus
   we're not allowed to depend on it per Android 10 restriction. It
   has been useless for years anyway.
 * Apply minor clean-ups.

Change-Id: I288af1b2f741f524c2ef49554e15cb91c3115209
2019-09-18 13:59:16 +05:30
LuK1337 9f626425bb kernel: Consider depmod version when handling kernel modules
* This fixes dirty boot image rebuilding on devices
  with CONFIG_LOCALVERSION_AUTO=y and any driver
  set to =m.
* Basically appending `cat include/config/kernel.release`
  to modules path makes sure that our find does not
  return old modules which would make cp fail with
  'cp: will not overwrite just-created' message.

Change-Id: Ifb79d33b95d7671d8b2d6633644c8b8290d1f442
2019-09-18 13:59:13 +05:30
Rashed Abdel-Tawab 28ee87c3b0 kernel: Set kernel build outdir prefix for depmod too
I missed these in the absolute path killing

Change-Id: Ibd63c36b9bafe264c7e05672838e5e0186ac5314
2019-09-18 13:58:29 +05:30
Rashed Abdel-Tawab a0d74b1477 kernel: Add GCC toolchains to the path
Tools like `as` only exist in the GCC toolchain, so we need that

Change-Id: I025d0d9bdf6eda94a538d2d6ddafbecc8830f471
2019-09-18 13:58:06 +05:30
Rashed Abdel-Tawab 3f832e2498 kernel: Use absolute path for kernel O= argument
The kernel make command is executed in the build root. Without absolute
out paths, kernel out start with "out/" meaning it would be created in
the kernel source. Add BUILD_ROOT to the argument to ensure it's always
made in the actual out/ dir.

Change-Id: I425134a893d4d5c9f31efccaf75e153b5462b76c
2019-09-18 13:53:56 +05:30
dianlujitao 21022e6ebe Fix real file depends on PHONY target
Change-Id: Idd42f4575dfd9fbbff9ab15e20e65d932df0390c
2019-09-18 13:53:47 +05:30
Rashed Abdel-Tawab f08cca6e95 kernel: Use prebuilt binaries
perl, lz4c, and a bunch of other binaries are not allowed anymore.
So we need to provide our own.

Change-Id: Idbc88b76247b3dda7c5d52e5eed2d548c33f6f2d
2019-09-18 13:53:03 +05:30
Rashed Abdel-Tawab 3e3007c6a9 kernel: Use full path to the make command
make is now a dissallowed command so just run the full command

Change-Id: I9390dc5a8bcd17f316354b88bdbc65ac8663b369
2019-09-18 13:53:03 +05:30
Sam Mortimer cd8e6d36a4 vendor/pa: Remove kernel.mk headers generation
*) This has been deprecated by the bp mobule
   generated_kernel_headers.

*) To build with kernel headers, do this:
   LOCAL_HEADER_LIBRARIES += generated_kernel_headers
   Or for soong targets:
   header_libs: [ "generated_kernel_headers" ],

Change-Id: Idad445709f0ee0ec11b41b40123b14976a0052ad
2019-09-18 13:53:03 +05:30
Rashed Abdel-Tawab 326811ca07 kernel: Add TARGET_KERNEL_ADDITIONAL_FLAGS to allow setting extra cflags
Also fix KERNEL_MAKE_FLAGS not being used by the kernel make command

Change-Id: I8786d6c1de6652f87a02c990c4b56f62b0cc0203
2019-09-06 14:03:05 +05:30
Rashed Abdel-Tawab 6d3f244ad4 pa: Rework DTBO image generation
Currently we handle the DTBO images from start to finish, including
AVB footers, and just drop them in $(PRODUCT_OUT)/dtbo.img when done.
While this works for the most part, we are limited in what we can do
with the DTBO images. For example non-A/B device recovery images must
have a copy of the DTBO image appended to recovery (see AOSP docs:
https://source.android.com/devices/bootloader/recovery-image ). This
means that we need to pass the pre-AVB dtbo image into
BOARD_PREBUILT_DTBOIMAGE in order to let the AOSP build system handle it.

This commit reworks the way the DTBO images are built, placing them at
$(PRODUCT_OUT)/dtbo-pre.img instead and setting BOARD_PREBUILT_DTBOIMAGE
to that path so the AOSP build system can pick the images up and sign
them and append to recovery (for applicable devices).

Change-Id: I8819d7cd92ba298de67dbc7f6b321917ba8524f1
2019-09-06 14:03:05 +05:30
Thor Lee befde58fde kernel: Fix modules path generated in modules.dep
This patch fixes the error generated path of modules in modules.dep.

Tested on Redmi Note 5(whyred).

Before:
/vendorlib/modules/test-iosched.ko:
/vendorlib/modules/mpq-adapter.ko:
/vendorlib/modules/ufs_test.ko: /vendorlib/modules/test-iosched.ko
/vendorlib/modules/rdbg.ko:
/vendorlib/modules/br_netfilter.ko:
/vendorlib/modules/gspca_main.ko:
/vendorlib/modules/mpq-dmx-hw-plugin.ko: /vendorlib/modules/mpq-adapter.ko

After:
/vendor/lib/modules/test-iosched.ko:
/vendor/lib/modules/mpq-adapter.ko:
/vendor/lib/modules/ufs_test.ko: /vendor/lib/modules/test-iosched.ko
/vendor/lib/modules/rdbg.ko:
/vendor/lib/modules/br_netfilter.ko:
/vendor/lib/modules/gspca_main.ko:
/vendor/lib/modules/mpq-dmx-hw-plugin.ko: /vendor/lib/modules/mpq-adapter.ko

Change-Id: I84d51f4c418fda0d99890db0fd5d976c42f54295
2019-09-06 14:03:05 +05:30
Ethan Chen 2f7c5ff61d kernel: Use build-image-kernel-modules instead of copying it
* Call the build system's build-image-kernel-modules function instead of
  redefining all of it inline ourselves.

Change-Id: Ifc4bd3c452393389a14174f4cc29a8f7ef064b93
2019-09-06 14:03:05 +05:30
Ethan Chen bc5eaf7edb kernel: Use a macro for kernel build targets
Change-Id: Idb61ddbfd630401da09a0c3207aaab7e25bc4b14
2019-09-06 14:03:05 +05:30
Ethan Chen 15c9ffdade kernel: Detect kernel module usage better
* Check for any actual kernel modules, rather than just the presence of
  kernel modules being enabled as a kernel feature.

Change-Id: I6b7e82d5c59dd57621d9f9e2d1fd606997790d1c
2019-09-06 14:03:04 +05:30
Ethan Chen 928a28d0ad kernel: Move kernel module dir cleanup/creation to module install target
* The directories used by the kernel module install rules are performed
  as part of the rules in the kernel build itself. This is likely a
  leftover from before kernel module install was separated.

Change-Id: Iee2f73a0f8e0f274b1c2931ba57277ff14d7f5cc
2019-09-06 14:03:04 +05:30
Ethan Chen e6d9d6fd24 kernel: Move full kernel build guard flag below all targets
* The Pixel DTBO generation step should also be guarded by the full
  kernel build flag.

Change-Id: I06d230b1b32ad9d974f90bfe6ae82008f4454d83
2019-09-06 14:03:04 +05:30
Nathan Chancellor 06c42d63bf kernel.mk: Support kernels that use LTO
Google added support for LTO + CFI in the Pixel 3 kernel, which requires
not only Clang but a couple of additional binaries, namely llvm-ar and
llvm-dis for IR generation. Google expects these binaries to be in PATH
according to their definitions and the build.config.common file:

https://android.googlesource.com/kernel/msm/+/android-9.0.0_r0.31/Makefile#637
https://android.googlesource.com/kernel/msm/+/android-9.0.0_r0.31/build.config.common

However, kernel.mk does not add the LLVM bin directory to PATH so the
build fails because the binaries can't be found. We could add LLVM_AR
and LLVM_DIS to the make commands like CC and CROSS_COMPILE; however,
adding the bin directory to PATH is a more sustainable solution as
Google might require new binaries in the future.

Additionally, LTO needs access to the LLVMgold library so it needs to be
available in LD_LIBRARY_PATH.

Add a PATH_OVERRIDE variable that will set up PATH and LD_LIBRARY_PATH
with the bin and lib64 folders from the requested LLVM toolchain
respectively when building with Clang. This won't affect kernels that
don't use LTO like Wahoo.

Change-Id: Ib16fa0d3180de2f96accb2f7648b07a017f8f98b
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
2019-09-06 14:03:04 +05:30
Michael Bestas 65fad612a6 kernel: Remove kernel{x}config
* They haven't been working since ninja build was introduced

Change-Id: Icb51412b7a70cdec7f077a6d3d56f7720188bcb0
2019-09-06 14:03:04 +05:30
Michael Bestas b3dc012b65 kernel: Remove deprecated flag errors
* All devices should have migrated by now

Change-Id: Iecef58a1193b87ecb084eccda27a3b4e89f42219
2019-09-06 14:02:55 +05:30
Rashed Abdel-Tawab fd307eb0d0 pa: Move some kernel definitions to BoardConfigKernel
Kernel source settings should always come at BoardConfig population
time so things that use the variable later don't end up pointing to
an empty or wrong variable.

The following is also squashed in:

Author: Christopher N. Hesse <raymanfx@gmail.com>
Date:   Fri Aug 10 00:23:54 2018 +0200
    tasks: kernel: Honor prebuilt kernel flag
    For devices that want to use a prebuilt kernel, TARGET_KERNEL_SOURCE
    would still be set to TARGET_AUTO_KDIR, meaning the build system would
    still try to build the kernel if TARGET_AUTO_KDIR was present.
    Setting TARGET_PREBUILT_KERNEL indicates this is not wanted, so don't
    attempt to do it.
    Change-Id: Ic79b3ac1b9c946fd258ada43dce2b08bb74ea0d9

Change-Id: If046b86ff0d18c76898e90295be873a8379f678a
2019-09-06 13:50:50 +05:30
Michael Bestas b9ee68c3fb kernel: Correct CROSS_COMPILE_ARM32 toolchain
* Missed in the original commit that switched to
  androidkernel toochain

Change-Id: I9b6d2e7216b48d22bcb7eec62c4fd9c05a895d18
2019-09-06 13:18:19 +05:30
Jake Weinstein 54901d12cf vendor: import DT image building script from LineageOS
Change-Id: Ia9d1f72d324f9efdfc79f241ed33f429bd6faec0
2019-08-04 11:53:06 -05:00
Anay Wadhera ea9f5cf0dc kernel: Don't error on use of KERNEL_HEADERS_INSTALL_DIR
- Many of the CAF modules still use this,
   we stick to this for now.

Change-Id: I68ac5628e22840569eae967f4a98a7b76bf9753a
2019-01-04 14:22:02 +05:30
Josh Choo fa2e938ee8 build: Ignore kernel.mk if target provides its own kernel makefile
Builds that use the stock CAF device/qcom/common
generate_extra_images.mk may want to ignore this kernel.mk.

Set TARGET_PROVIDES_KERNEL_MAKEFILE to true to ignore kernel.mk.

Test: make bootimage. Build succeeds.
Change-Id: Ieb2718636170f86600d44d8a99434a57826a5309
Signed-off-by: Josh Choo <dev@joshchoo.com>
2018-12-26 14:31:28 +05:30
Jake Weinstein f01910f890 Import kernel building script from Lineage OS
Change-Id: I2cf68cef5205ca32ba745761ae2f06b12cd194d7
2018-10-06 17:21:16 +00:00
Luca Stefani 064d1de9f7 build: Add dtbo task
Change-Id: I1101cb204ab583a204447d63e6a031a17179dfe7
(cherry picked from commit 8bffb053db418022c7cba5d67234412edd675862)
2018-10-06 17:18:29 +00:00