Commit Graph

30 Commits

Author SHA1 Message Date
Michael Bestas b31b260fe4 kernel: Changes for LLVM binutils
* Remove KERNEL_LD from kernel.mk, we simply set LD in BoardConfigKernel
* Add llvm-ar in path allowlist (used by LTO)

Change-Id: I76addb6f9d8d413edb1832dba23082ffb6d5ebc3
2024-09-07 15:45:38 +02:00
Michael Bestas 68f2960a70 kernel: Always build dtb targets before dtbo.img
Fixes:
error: unable to open output file
'arch/arm64/boot/dts/google/devices/bluejay/google-base/.gs101-b0.dtb.dts.tmp':
'No such file or directory'

Change-Id: I457062e46062fb3553421d196b432de7d06a49ad
2024-09-07 15:45:38 +02:00
Michael Bestas 350e6effbb kernel: Add support for vendor_boot image header version 4
vendor_boot v4 supports packaging multiple "fragmented" vendor ramdisks.
A secondary can be used to store the kernel modules instead of storing
them in the "normal" vendor_ramdisk.

Test: Create a vendor_boot with source built kernel/modules,
      gs101 still boots.
Change-Id: Ic295ccf201c2593e08b9559ae28f80c70a7eb341
2024-09-07 15:45:38 +02:00
Neel Chauhan f5a42b67f9 kernel.mk: Allow building external kernel modules
Here, we introduce the TARGET_EXTERNAL_KERNEL_MODULES variable
for the list of external modules.

Change-Id: I1f8b7a48e66bb0c9efbc396692e5a7159f0b835c
2024-09-07 15:45:38 +02:00
Michael Bestas 80bd054cf2 kernel: Allow overriding dtb target
On some devices we might want to build just the *.dtb files
that we actually need instead of the every dtb that exists.

Change-Id: Id7a152499d4ee1dd08f79d34cc34bfe959313515
2024-09-07 15:45:38 +02:00
Michael Bestas be10f65fc4 kernel: Allow overriding dtbo target name
gs101 kernel uses google/dtbo.img target for dtbo.img

Change-Id: Ib03f35c0035f56d303771de9399bcce3d02c0775
2024-09-07 15:45:38 +02:00
Alexander Koskovich fdf7a64db0 kernel: Move TARGET_KERNEL_ADDITIONAL_FLAGS to kernel task
* Currently, because DTC_EXT make flag is in the
   kernel task the only way to override it is to
   have TARGET_KERNEL_ADDITIONAL_FLAGS come after.

Change-Id: If62ed979581dc07eafd4628ce2b2d799388d3704
2024-09-07 15:45:38 +02:00
Alexander Koskovich b31c846f51 kernel: Switch to AOSP DTC instead of using scripts/dtc
Change-Id: I8faf295dfb84ab7481b80d5b7d2add8ed8ddf6d9
2024-09-07 15:45:38 +02:00
Michael Bestas ef5ddc9220 Revert "kernel: Remove unneeded MKDTIMG dependency"
This reverts commit caa3bddf00129c06f35923e43d5e770645da6b99.

Reason for revert: Breaks pixel dtbo.img build, since kernel depends on
mkdtimg. Add it back so it gets compiled and kernel can pick it up.

Change-Id: I2b9fd0b2b35e0cf2f908516b10f65399780d5c30
2024-09-07 15:45:38 +02:00
Michael Bestas 246aae819d kernel: Remove unneeded MKDTIMG dependency
Change-Id: Icc1923e922adb50b02252883aa6814101837adfc
2024-09-07 15:45:38 +02:00
dianlujitao db348597ca kernel: Ensure dtb(o) always get rebuilt
* AOSP build system is not aware of dtb(o) source update, and thus
   won't rebuild the images, results in outdated artifact.
 * Convert DTB(O)_OUT to make targets and make the images depend on them
   to address the issue. This makes AOSP build system be aware of
   their timestamp changes and re-execute recipes depending on them.
   Finally, it's up to kernel's build system to decide actions to take.

Test: m dtb(o)image and observe dtb(o).img get rebuilt
Change-Id: I197e7d2d3e013ded0e555fc22bb6a1200d40df9c
2024-09-07 15:45:38 +02:00
dianlujitao b3ec81fe9f kernel: Avoid unnecessary savedefconfig
Change-Id: I5400e549a6574208d67c5d107ca56eee402fa7f2
2024-09-07 15:45:38 +02:00
dianlujitao afbd0df8d3 kernel: Clean up kernel copy recipes
ACP and ALL_PREBUILT are dropped years ago and thus have become no-ops.

Change-Id: Ic317cb4a4fa406cce0dc86555fb8da34d21fb2bf
2024-09-07 15:45:38 +02:00
Alexander Koskovich c0130e0358 lineage: build: Wipe DTB/O OBJs before build
* They can linger and cause problems, e.g. mismatching
   kernel and DTBs.

Change-Id: I4adafe140093ff675fc3f55e3233a754d44d5656
2024-09-07 15:45:38 +02:00
Bruno Martins 4436121e3e kernel: Document TARGET_KERNEL_RECOVERY_CONFIG usage
Change-Id: Idefd38dae5e8beac7d7de797f3f792fea25dacef
2024-09-07 15:45:38 +02:00
Bruno Martins 6e990acb91 kernel: Fix building recovery images
Commit 8ac7d31 introduced this issue.

Test: run `m recoveryimage` and verify that recovery
image is now built.

Change-Id: Iffdd8112db2ba1baff28db7ee4c340dbb5ebd917
2024-09-07 15:45:38 +02:00
Bruno Martins c9cdb563ff kernel: Fix kernel rebuilding
Commit 8ac7d31 introduced this issue.

Test: run `m installclean && m bootimage` and observe that
kernel image is built.

Change-Id: I41eb7cd2e5108bae8f4c40c0f9a300a8a3cc95a7
2024-09-07 15:45:38 +02:00
Sebastiano Barezzi d7dd18649a build: tasks: kernel: Rework kernel fragments handling
* Since some time you can specify multiple configs when you prepare .config and they'll get merged to main one
* To use it inline:
TARGET_KERNEL_CONFIG := main_defconfig fragment1.config fragment2.config ...
* TARGET_KERNEL_ADDITIONAL_CONFIG has been nuked since it's superseed by this new logic
* kernelsavedefconfig will only use the base defconfig

Change-Id: I479c762a9235ed0ef6fcdc79b53e084d5e2d78a6
2024-09-07 15:45:38 +02:00
marcost2 903f535772 Add support for separate kernels for boot and recovery [1/2]
* Either as prebuilts, or with separate defconfigs

Change-Id: Iad877a5fbef095e3e5d792aebb240c230a829552
2024-09-07 15:45:38 +02:00
LuK1337 da4c725f81 kernel: Pass absolute path for KCONFIG_ALLCONFIG
It fails to read relative one, at least on QCOM 4.19 kernel base.

Change-Id: Iacbcadfabfcebb80a7f5934825123fdfa913c63c
2024-09-07 15:45:38 +02:00
Michael Bestas ca1004e860 build: Fix kernelsavedefconfig target
Change-Id: Ie3d9a187693f2435f2555658c833de666848e48e
2024-09-07 15:45:38 +02:00
Tim Schumacher 0e721b6a4e kernel: Fix the check for official builds
The check for official builds now only affects the case where a prebuilt
kernel was actually used, not the case where a device builds a kernel
from source as normal.

The check has also been turned around so that it only fails the build if
it's actually an official build, not an unofficial one.

Change-Id: I1280b16b90589742c2abe7f3f6f5975a3aaeea03
2022-07-30 14:25:10 +00:00
Sebastiano Barezzi 9d4bb8e43c kernel: Add TARGET_FORCE_PREBUILT_KERNEL flag
* TARGET_FORCE_PREBUILT_KERNEL should be useful when you don't have ready kernel sources (OEM releasing broken sources or releasing them lately)
* It lets you use kernel sources for userspace generated headers (generated_kernel_headers) while keeping using prebuilt kernel
* Keep in mind that generated kernel headers may not align with the ABI of kernel you're including
* This commit also partially revert commit a836d79, where TARGET_KERNEL_SOURCE would have been unset if TARGET_PREBUILT_KERNEL was defined (we already check in kernel.mk if kernel sources are present anyway)

Change-Id: I84acae890dabb5b9dbd48143ad58f6420c0cef75
2022-07-30 14:24:30 +00:00
Alessandro Astone c84395eada Revert "Revert "kernel: fix KERNEL_TOOLCHAIN_PATH_gcc and usage""
The fix was correct...

This reverts commit 168fd231b65f3bd575529984f552354f4c5e3e8b.

Change-Id: If550fd44f32b801553b8ac23cb2a91d3f29df557
2022-07-30 14:24:09 +00:00
Alexander Koskovich ea442ffb45 lineage: config: Make LLVM kernel compile the default
* GCC was deprecated awhile ago, the large majority
   of devices should now be using this. Clang should
   be opt out as opposed to opt in.

Change-Id: Ie388aff8eca189663f2f615f7d059e47eaf2dce3
2022-07-30 14:23:42 +00:00
Captain Throwback 5a109b76f3 twrp-depmod: only run when TW_LOAD_VENDOR_MODULES is set (2/2)
Change-Id: Id9519c8fb38c7033eb1b34b70f97051e04cb5647
2022-05-28 17:47:57 +00:00
bigbiff 484390ec9c depmod: generate module information for prebuilt ramdisk modules
Change-Id: Id89ae77a3951fb6d05cf54b10a821f4744085aed
2021-09-29 20:46:45 +00:00
Captain Throwback 88ffc5784c Remove prebuilt kernel warning
We actually prefer it.

Change-Id: I9b3cbc04d8083e5c1041d3ca9bead14e42a6b7b9
2021-08-30 23:00:39 -04:00
nebrassy a667d6f30e Kernel: allow outputting kernel modules to recovery
Change-Id: I6d23f2d21a4406f6838de5c951741bf673a5423d
2021-06-16 11:34:35 +02:00
Captain Throwback 6e472d3adc twrp: setup custom vendor for TWRP-only tree
- Based on vendor_omni, renamed & cleaned up

Change-Id: I4661f7cca770a4c55cfd428e60d29f994725033e
2021-05-01 18:06:03 +02:00