Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Sepolicy + Rm SimpleDeviceConfig + OmniRom Platform library #22

Open
wants to merge 38 commits into
base: android-14.0
Choose a base branch
from

Conversation

micky387
Copy link
Contributor

No description provided.

neelchauhan and others added 29 commits December 22, 2023 17:48
Here, we introduce the TARGET_EXTERNAL_KERNEL_MODULES variable
for the list of external modules.

Change-Id: I1f8b7a48e66bb0c9efbc396692e5a7159f0b835c
Before:
    mka bootimage
    qcacld failed to compile, but boot.img is generated

After:
    mka bootimage
    qcacld failed to compile and no boot.img is generated

Commit fadfdbf introduced the idea of building external modules,
but it didn't account for the scenario where compilation could fail
while the boot.img is still being built.

Fix this by properly stopping the build process as soon as the external
module fails to compile.

Change-Id: Ifed28825f8e4b78d304fe62a47908e208edfb886
Script from clo kernel/build at kernel.lnx.5.10.r1-rel

Change-Id: Ia90975c895644b86d9f861ddd5a18b7cf6ce1470
It can be the case where OEM/ODM decided to put the main DTBOs
outside vendor/qcom (e.g. vendor/oplus). Support such usecase
by generically allowing all .dtbo files found in all first-level
subdirs to be moved to base DTB folder.

Change-Id: I154d401b560535d1fa8cd7ed4965dd34a4cf75f2
On some devices too many .dtb files are generated. Instead of taking
all of them, allow to only take selected .dtb files for the final
DTB image.

Example: Motorola Edge 40 Pro (rtwo, sm8550) generates the following:
obj/DTB_OBJ/out/kaka-rumi.dtb
obj/DTB_OBJ/out/kalama-rtwo-base-kalama-rtwo-evb1-overlay.dtb
obj/DTB_OBJ/out/kalama-rtwo-base-kalama-rtwo-evt1-overlay.dtb
obj/DTB_OBJ/out/kalama-rtwo-base-kalama-rtwo-na-vzw-evt2-overlay.dtb
obj/DTB_OBJ/out/kalama-rtwo-base-kalama-rtwo-prc-dvt1b-overlay.dtb
obj/DTB_OBJ/out/kalama-rtwo-base-kalama-rtwo-prc-pvt-overlay.dtb
obj/DTB_OBJ/out/kalama-rtwo-base-kalama-rtwo-row-dvt1b-overlay.dtb
obj/DTB_OBJ/out/kalama-rtwo-base.dtb
obj/DTB_OBJ/out/kalama-v2-rtwo-base-kalama-rtwo-evb1-overlay.dtb
obj/DTB_OBJ/out/kalama-v2-rtwo-base-kalama-rtwo-evt1-overlay.dtb
obj/DTB_OBJ/out/kalama-v2-rtwo-base-kalama-rtwo-na-vzw-evt2-overlay.dtb
obj/DTB_OBJ/out/kalama-v2-rtwo-base-kalama-rtwo-prc-dvt1b-overlay.dtb
obj/DTB_OBJ/out/kalama-v2-rtwo-base-kalama-rtwo-prc-pvt-overlay.dtb
obj/DTB_OBJ/out/kalama-v2-rtwo-base-kalama-rtwo-row-dvt1b-overlay.dtb
obj/DTB_OBJ/out/kalama-v2-rtwo-base.dtb

with only kalama-rtwo-base.dtb and kalama-v2-rtwo-base.dtb needed.
Disabling compilation of the other kalama.dtb isn't possible, as this
would also disable the compilation of the needed .dtbo files.
Because they are earlier in alphabetical order, and the matching
board ids, the bootloader ends up selecting those, instead of the
correct ones. This results in USB (and possible other things) to
not work.

Change-Id: I486b6ec538a3e4906b5b8aa5ecb355b480b60de7
TARGET_EXTERNAL_KERNEL_MODULES variable is used for the list of modules,
same as the existing functionality, but is invoked if ':kbuild' is
appended to a module name

Existing external module build calls make in the module directory, which
is a standalone module build. The module makefile may chain to kbuild,
but that depends on the module. This addition invokes the kernel build
system, passing the module directory via the M= param, which is the
kernel standard for building out of tree modules.

Change-Id: I38a582952f79f7155cdbf8a5975cf23074bbdab0
 * 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
Co-authored-by: LuK1337 <priv.luk@gmail.com>
Change-Id: I06884fb774b6548aad68942f1ce659384521c62a
Avoids:
$ lunch lineage_sdk_phone_x86
grep: build/make/target/board/emulator_x86/Makefile: No such file or directory (x4)

Change-Id: Ie803d5ca93e6e7ae94625e7ee3ab0bf337e0515d
 * Seemingly not an issue for kernels compiled with
   LLVM, tested with kernel versions 4.4 -> 5.4.

Change-Id: I00adee2e10e99a540099b5e1a6a1ab9be0b99050
Change-Id: I7fec28b7cb507918b1b55dd368a74c927a8fc1d2
Change-Id: I14afa17d710778403cd7fecf842c952c569c0c35
gs101 kernel uses google/dtbo.img target for dtbo.img

Change-Id: Ib03f35c0035f56d303771de9399bcce3d02c0775
gs101 uses DTBO_OBJ/arch/arm64/boot/dts/google/dtbo.img
vs DTBO_OBJ/arch/arm/boot/dtbo.img on previous devices.

Change-Id: I945d31cb093fae97385cf84c273088ee7a4edf0b
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
* Remove KERNEL_LD from kernel.mk, we simply set LD in BoardConfigKernel
* Add llvm-ar in path allowlist (used by LTO)

Change-Id: I76addb6f9d8d413edb1832dba23082ffb6d5ebc3
* GCC has been completely removed in AOSP but we keep it
  for compatibility reasons with older kernels until they
  are adapted to remove all the dependencies to GCC.
* Most updated 4.19+ kernels should be able to use LLVM
  binutils out of the box. 4.14 is possible with a few patches
  and 4.9 with even more patches.
* Make this the default and allow devices opting out by using
  TARGET_KERNEL_LLVM_BINUTILS := false

Change-Id: I569cf290b41aaf2dc16ff9cc4cc6dc461f0d504e
Change-Id: Ia01336f14599ec8d767d88ad3b76f7bb97153848
Prepare for 5.10 kernel build changes

Change-Id: I79ecf0655f9adc894091c4f26de337ebe03e3ca2
Change-Id: Id6e09467937e60e6b00a30a246ba0a4a8d71687b
Change-Id: Id8215f290a88ddf3a6bc1764d9ef9a09f6aa810d
Change-Id: I18fceeeeab5426f55a73d0cb8d72abd5f40c67ec
Darwin kernel build is not supported for >=5.10
and non-standard clang versions.
Another side effect is that it causes LD_LIBRARY_PATH
to get overwritten, which breaks certain configurations.
Let's just get rid of it since AOSP darwin build is no longer supported.

Change-Id: I9ac642996b90937bd9c52138fb06bf1eff901c8b
Change-Id: Ia842ed409145a81a92077dde5d6e9749a057f047
5.10 doesn't need LD_LIBRARY_PATH set

Change-Id: I5f6e732610f947d50b47e238d6a42365396b18ad
android11-5.4 kernel can fully compile with LLVM with a few cherrypicks
from android12-5.4 and android12-5.10

Change-Id: Ib71935d284ad78f1c23d039c15bfc5e0314a19eb
Make the conditions accurately reflect the comment:
"5.10+ can fully compile without GCC by default".

Change-Id: Ia9070871c23a710ba5b461ad522db241183e34d1
This is used in a bunch of QCOM HALs

Change-Id: I5bb76c47ad33e9fb1b81d1d23f78b2dbf390473a
luk1337 and others added 4 commits December 29, 2023 22:57
Fixes the following error message when compiling target w/o kernel src:
expr: syntax error: unexpected argument ‘5’

Test: lunch lineage_sdk_phone_x86_64-eng
Change-Id: Ib3ec41d9dc2b59ddc9ee3c0c8e3813c4defcfc3e
This fixes the following warnings:

  13:04:54 Disallowed PATH tool "pahole" used: []string{"pahole", "--version"}
  13:04:54 See https://android.googlesource.com/platform/build/+/master/Changes.md#PATH_Tools for more information.
  "pahole" is not allowed to be used. See https://android.googlesource.com/platform/build/+/master/Changes.md#PATH_Tools for more information.
  /home/bgcngm/android/lineage/kernel/oneplus/sm8550/scripts/pahole-flags.sh: 12: [: Illegal number:
  /home/bgcngm/android/lineage/kernel/oneplus/sm8550/scripts/pahole-flags.sh: 16: [: Illegal number:
  /home/bgcngm/android/lineage/kernel/oneplus/sm8550/scripts/pahole-flags.sh: 20: [: Illegal number:

Change-Id: Ice2a3753301a7b7782037fd35544e2831b258650
Fixes: "lz4" is not allowed to be used.

Test: breakfast tangorpro && m bootimage
Change-Id: I62cfe131f457117cb3745b91f5e43c085e87b611
Change-Id: I898eb50fadb6bde5beebf46f443c5de7e6acc907
bgcngm and others added 5 commits January 2, 2024 15:39
All devices lauching with Android 13 (and above) must include
a system_dlkm partition, where GKI modules should reside.

Android 13 build system only supports providing prebuilt modules,
by pointing BOARD_SYSTEM_DLKM_SRC to the modules source folder.
Google will introduce BOARD_SYSTEM_KERNEL_MODULES for Android 14,
so take a step forward and use that macro to exclude the listed
modules from the usual vendor DLKM partition and place them into
the GKI module partition.

Note that the GKI modules are placed into lib/modules/androidX-Y.Z,
as defined by Google and observed in system_dlkm_modprobe script.

Change-Id: I2b1644479788cb5c9568cac738202b1d55fc28d7
* We're having a race with the kernel module build and vendor.img
  generation, and sometimes when vendor.img wins it won't include
  any modules in the image, which leads to all sorts of breakage

Change-Id: I2cdde96530aa8e47351cace76352788cde631058
This lets us package kernel modules into recovery ramdisk inside
vendor_boot.

Change-Id: I274bc95ce8682e2f13a595174ab279c129866f6a
Commit 47931c1 introduced GKI modules handling with the assumption
that using BOARD_SYSTEM_KERNEL_MODULES would still work in Android 14,
but turns out that it conflicts with build/make/core rules.

Change-Id: I9167940c08b8420be254c52698f1faa2e3e7f793
Do not allow module load lists to contain unexistent kernel modules
and bail out if that's the case, informing that the list must be
corrected.

The lists can be formed including the full module path and with or
without the file extension, like shown below:

  kernel/drivers/watchdog/softdog.ko
  kernel/net/wireless/cfg80211.ko
  kernel/net/mac80211/mac80211.ko

or simply:

  softdog.ko
  cfg80211.ko
  mac80211.ko

or ultimately:

  softdog
  cfg80211
  mac80211

Either way, the newly generated modules.load file will now only
contain the module name without the extension, which is inline with
modules.alias and modules.blocklist.

Change-Id: I969274f7edf249c98ca241e37b6e41a921d36908
@omnigerrit omnigerrit force-pushed the android-14.0 branch 4 times, most recently from c0bcef9 to fab9574 Compare January 20, 2024 23:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet