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

Closed
wants to merge 38 commits into from

Commits on Dec 22, 2023

  1. 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
    neelchauhan authored and micky387 committed Dec 22, 2023
    Configuration menu
    Copy the full SHA
    1d37996 View commit details
    Browse the repository at this point in the history
  2. kernel: Halt build process if an external module fails to compile

    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
    PIPIPIG233666 authored and micky387 committed Dec 22, 2023
    Configuration menu
    Copy the full SHA
    f0c41c9 View commit details
    Browse the repository at this point in the history
  3. kernel: Support Qualcomm merge_dtbs script

    Script from clo kernel/build at kernel.lnx.5.10.r1-rel
    
    Change-Id: Ia90975c895644b86d9f861ddd5a18b7cf6ce1470
    webgeek1234 authored and micky387 committed Dec 22, 2023
    Configuration menu
    Copy the full SHA
    ea7e462 View commit details
    Browse the repository at this point in the history
  4. kernel: Include DTBOs from OEM/ODM folder in base DTB

    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
    bgcngm authored and micky387 committed Dec 22, 2023
    Configuration menu
    Copy the full SHA
    7983625 View commit details
    Browse the repository at this point in the history
  5. kernel: Allow to limit the used .dtb files for the final DTB image

    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
    SGCMarkus authored and micky387 committed Dec 22, 2023
    Configuration menu
    Copy the full SHA
    d06e858 View commit details
    Browse the repository at this point in the history

Commits on Dec 26, 2023

  1. kernel.mk: Support kernel modules via kbuild

    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
    webgeek1234 authored and micky387 committed Dec 26, 2023
    Configuration menu
    Copy the full SHA
    d5da494 View commit details
    Browse the repository at this point in the history

Commits on Dec 29, 2023

  1. kernel: Fix vdso32 building for 4.19+ kernels

    This flag has been renamed in 4.19 kernels
    https://android.googlesource.com/kernel/common/+/refs/heads/android-4.19-stable/arch/arm64/kernel/vdso32/Makefile#13
    
    Change-Id: I92db29aa124da7c9fc63454d9443373bdc2e16e7
    libxzr authored and micky387 committed Dec 29, 2023
    Configuration menu
    Copy the full SHA
    526ff1f View commit details
    Browse the repository at this point in the history
  2. 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
    ZVNexus authored and micky387 committed Dec 29, 2023
    Configuration menu
    Copy the full SHA
    5dca2ce View commit details
    Browse the repository at this point in the history
  3. kernel: Use LLVM's substitutes for GNU binutils if possible

    Co-authored-by: LuK1337 <priv.luk@gmail.com>
    Change-Id: I06884fb774b6548aad68942f1ce659384521c62a
    2 people authored and micky387 committed Dec 29, 2023
    Configuration menu
    Copy the full SHA
    8c422ea View commit details
    Browse the repository at this point in the history
  4. kernel: Don't print grep error messages when checking version

    Avoids:
    $ lunch lineage_sdk_phone_x86
    grep: build/make/target/board/emulator_x86/Makefile: No such file or directory (x4)
    
    Change-Id: Ie803d5ca93e6e7ae94625e7ee3ab0bf337e0515d
    chirayudesai authored and micky387 committed Dec 29, 2023
    Configuration menu
    Copy the full SHA
    9094c0a View commit details
    Browse the repository at this point in the history
  5. lineage: config: Don't pass CFLAGS_MODULE="-fno-pic" if using LLVM

     * Seemingly not an issue for kernels compiled with
       LLVM, tested with kernel versions 4.4 -> 5.4.
    
    Change-Id: I00adee2e10e99a540099b5e1a6a1ab9be0b99050
    ZVNexus authored and micky387 committed Dec 29, 2023
    Configuration menu
    Copy the full SHA
    43a67c2 View commit details
    Browse the repository at this point in the history
  6. lineage: config: Use $(abspath .) instead of $(shell pwd)

    Change-Id: I7fec28b7cb507918b1b55dd368a74c927a8fc1d2
    Jason Wojcik authored and micky387 committed Dec 29, 2023
    Configuration menu
    Copy the full SHA
    b0676f9 View commit details
    Browse the repository at this point in the history
  7. config: Use LLVM binutils for 5.10 as well

    Change-Id: I14afa17d710778403cd7fecf842c952c569c0c35
    mikeNG authored and micky387 committed Dec 29, 2023
    Configuration menu
    Copy the full SHA
    1d327dd View commit details
    Browse the repository at this point in the history
  8. kernel: Allow overriding dtbo target name

    gs101 kernel uses google/dtbo.img target for dtbo.img
    
    Change-Id: Ib03f35c0035f56d303771de9399bcce3d02c0775
    mikeNG authored and micky387 committed Dec 29, 2023
    Configuration menu
    Copy the full SHA
    7e617aa View commit details
    Browse the repository at this point in the history
  9. kernel: Allow setting dtbo target path prefix

    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
    mikeNG authored and micky387 committed Dec 29, 2023
    Configuration menu
    Copy the full SHA
    9b558c9 View commit details
    Browse the repository at this point in the history
  10. 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
    mikeNG authored and micky387 committed Dec 29, 2023
    Configuration menu
    Copy the full SHA
    de31806 View commit details
    Browse the repository at this point in the history
  11. 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
    mikeNG authored and micky387 committed Dec 29, 2023
    Configuration menu
    Copy the full SHA
    2802740 View commit details
    Browse the repository at this point in the history
  12. kernel: Use LLVM binutils by default

    * 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
    mikeNG authored and micky387 committed Dec 29, 2023
    Configuration menu
    Copy the full SHA
    8591f37 View commit details
    Browse the repository at this point in the history
  13. kernel: Use consistent spacing

    Change-Id: Ia01336f14599ec8d767d88ad3b76f7bb97153848
    mikeNG authored and micky387 committed Dec 29, 2023
    Configuration menu
    Copy the full SHA
    2019d50 View commit details
    Browse the repository at this point in the history
  14. kernel: Slightly reorder config

    Prepare for 5.10 kernel build changes
    
    Change-Id: I79ecf0655f9adc894091c4f26de337ebe03e3ca2
    mikeNG authored and micky387 committed Dec 29, 2023
    Configuration menu
    Copy the full SHA
    cbd387e View commit details
    Browse the repository at this point in the history
  15. kernel: Changes for 5.10 build without GCC

    Change-Id: Id6e09467937e60e6b00a30a246ba0a4a8d71687b
    mikeNG authored and micky387 committed Dec 29, 2023
    Configuration menu
    Copy the full SHA
    1b0a6ab View commit details
    Browse the repository at this point in the history
  16. omni: kernel: Use getconf instead of nproc

    Change-Id: Id8215f290a88ddf3a6bc1764d9ef9a09f6aa810d
    ZVNexus authored and micky387 committed Dec 29, 2023
    Configuration menu
    Copy the full SHA
    95b52b0 View commit details
    Browse the repository at this point in the history
  17. kernel: Fix clang version override

    Change-Id: I18fceeeeab5426f55a73d0cb8d72abd5f40c67ec
    mikeNG authored and micky387 committed Dec 29, 2023
    Configuration menu
    Copy the full SHA
    56d0f39 View commit details
    Browse the repository at this point in the history
  18. kernel: Remove darwin support

    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
    mikeNG authored and micky387 committed Dec 29, 2023
    Configuration menu
    Copy the full SHA
    5979fd6 View commit details
    Browse the repository at this point in the history
  19. kernel: Only add GCC to PATH when using GNU binutils

    Change-Id: Ia842ed409145a81a92077dde5d6e9749a057f047
    mikeNG authored and micky387 committed Dec 29, 2023
    Configuration menu
    Copy the full SHA
    88a8d93 View commit details
    Browse the repository at this point in the history
  20. kernel: Override LD_LIBRARY_PATH only on <5.10

    5.10 doesn't need LD_LIBRARY_PATH set
    
    Change-Id: I5f6e732610f947d50b47e238d6a42365396b18ad
    mikeNG authored and micky387 committed Dec 29, 2023
    Configuration menu
    Copy the full SHA
    b11839f View commit details
    Browse the repository at this point in the history
  21. kernel: Allow devices to opt-in for full LLVM build

    android11-5.4 kernel can fully compile with LLVM with a few cherrypicks
    from android12-5.4 and android12-5.10
    
    Change-Id: Ib71935d284ad78f1c23d039c15bfc5e0314a19eb
    mikeNG authored and micky387 committed Dec 29, 2023
    Configuration menu
    Copy the full SHA
    918f394 View commit details
    Browse the repository at this point in the history
  22. kernel: Go full LLVM build on 5.10+ kernels

    Make the conditions accurately reflect the comment:
    "5.10+ can fully compile without GCC by default".
    
    Change-Id: Ia9070871c23a710ba5b461ad522db241183e34d1
    bgcngm authored and micky387 committed Dec 29, 2023
    Configuration menu
    Copy the full SHA
    b4ddb3c View commit details
    Browse the repository at this point in the history
  23. kernel: Restore TARGET_KERNEL_VERSION

    This is used in a bunch of QCOM HALs
    
    Change-Id: I5bb76c47ad33e9fb1b81d1d23f78b2dbf390473a
    mikeNG authored and micky387 committed Dec 29, 2023
    Configuration menu
    Copy the full SHA
    21c055b View commit details
    Browse the repository at this point in the history
  24. kernel: Don't try to do math on empty kernel version

    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
    luk1337 authored and micky387 committed Dec 29, 2023
    Configuration menu
    Copy the full SHA
    6aec27a View commit details
    Browse the repository at this point in the history
  25. kernel: Use pahole from Google prebuilts

    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
    bgcngm authored and micky387 committed Dec 29, 2023
    Configuration menu
    Copy the full SHA
    2e1c508 View commit details
    Browse the repository at this point in the history
  26. kernel: Use lz4 from Google prebuilts

    Fixes: "lz4" is not allowed to be used.
    
    Test: breakfast tangorpro && m bootimage
    Change-Id: I62cfe131f457117cb3745b91f5e43c085e87b611
    luk1337 authored and micky387 committed Dec 29, 2023
    Configuration menu
    Copy the full SHA
    21459c3 View commit details
    Browse the repository at this point in the history

Commits on Dec 30, 2023

  1. kernel: Implement build time LTO choice

    Change-Id: I898eb50fadb6bde5beebf46f443c5de7e6acc907
    chirayudesai authored and micky387 committed Dec 30, 2023
    Configuration menu
    Copy the full SHA
    ef7c6a8 View commit details
    Browse the repository at this point in the history

Commits on Jan 2, 2024

  1. kernel: Handle GKI modules

    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
    bgcngm authored and micky387 committed Jan 2, 2024
    Configuration menu
    Copy the full SHA
    eac24db View commit details
    Browse the repository at this point in the history
  2. kernel: Make system/vendor images depend on modules

    * 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
    mikeNG authored and micky387 committed Jan 2, 2024
    Configuration menu
    Copy the full SHA
    87f5b23 View commit details
    Browse the repository at this point in the history
  3. kernel: Make INTERNAL_VENDOR_RAMDISK_TARGET depend on kernel

    This lets us package kernel modules into recovery ramdisk inside
    vendor_boot.
    
    Change-Id: I274bc95ce8682e2f13a595174ab279c129866f6a
    luk1337 authored and micky387 committed Jan 2, 2024
    Configuration menu
    Copy the full SHA
    8de567c View commit details
    Browse the repository at this point in the history
  4. kernel: Replace BOARD_SYSTEM_KERNEL_MODULES with SYSTEM_KERNEL_MODULES

    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
    bgcngm authored and micky387 committed Jan 2, 2024
    Configuration menu
    Copy the full SHA
    4553693 View commit details
    Browse the repository at this point in the history
  5. kernel: Ensure that module load lists are properly formed

    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
    bgcngm authored and micky387 committed Jan 2, 2024
    Configuration menu
    Copy the full SHA
    272fdba View commit details
    Browse the repository at this point in the history