Commit Graph

760 Commits

Author SHA1 Message Date
Aaron Kling
7cd90ecd34 kernel: Support building from kernel platform
This expects a few build variables to be set:

* TARGET_KERNEL_PLATFORM_TARGET: The base target name. For example,
  'tegra' will indicate that the dist target is tegra_dist, abi is
  tegra_abi, etc.
* TARGET_KERNEL_VERSION: Used to determine the kernel checkout path. For
  example, a value of 6.6 will expect the kernel platform repo to be
  checked out to $BUILD_TOP/../kernel-6.6.
* TARGET_KERNEL_SOURCE: Relative to the top of the kernel platform
  checkout, the path to the kernel build rules. For example,
  vendor/nvidia/tegra.
* BOARD_KERNEL_IMAGE_NAME: The kernel image to use. For example, Image.

Using the examples above, this will run bazel in the kernel-6.6
directory on the target //vendor/nvidia/tegra:tegra_dist, then source
the output from $OUT/tegra/dist, with the prebuilt kernel image being
Image.

Change-Id: If96e96dffa2c0bfd9bd824bb3d8064eb861c9d00
2025-09-10 18:37:57 +00:00
inferno0230
e9f9f3902d merge_dtbs: Use DeviceTreeInfo's hash in get_name()
Fixes duplicate output filename collision:

INFO: Saving to: benz-23871-crow-overlay-DVT1-camera-0x46232744d57254d9.dtbo
Merging overlay blob out/target/product/benz/obj/DTB_OBJ/arch/arm64/boot/dts/vendor/qcom/camera/oplus/benz-camera-overlay.dtbo
Reloading overlay blob out/target/product/benz/obj/DTB_OBJ/arch/arm64/boot/dts/vendor/qcom/camera/oplus/benz-camera-overlay.dtbo
Merging overlay blob out/target/product/benz/obj/DTB_OBJ/arch/arm64/boot/dts/vendor/qcom/camera/oplus/benz-camera-overlay.dtbo
INFO: Saving to: benz-23871-crow-overlay-DVT1-23061-audio-23061-display-camera-0x46232744d57254d9.dtbo
Merging overlay blob out/target/product/benz/obj/DTB_OBJ/arch/arm64/boot/dts/vendor/qcom/audio/oplus/benz-23061-audio-crow-overlay.dtbo
Reloading overlay blob out/target/product/benz/obj/DTB_OBJ/arch/arm64/boot/dts/vendor/qcom/audio/oplus/benz-23061-audio-crow-overlay.dtbo
Merging overlay blob out/target/product/benz/obj/DTB_OBJ/arch/arm64/boot/dts/vendor/qcom/audio/oplus/benz-23061-audio-crow-overlay.dtbo
Merging overlay blob out/target/product/benz/obj/DTB_OBJ/arch/arm64/boot/dts/vendor/qcom/display/oplus/benz-23061-display-crow-overlay.dtbo
Reloading overlay blob out/target/product/benz/obj/DTB_OBJ/arch/arm64/boot/dts/vendor/qcom/display/oplus/benz-23061-display-crow-overlay.dtbo
Merging overlay blob out/target/product/benz/obj/DTB_OBJ/arch/arm64/boot/dts/vendor/qcom/display/oplus/benz-23061-display-crow-overlay.dtbo
Merging overlay blob out/target/product/benz/obj/DTB_OBJ/arch/arm64/boot/dts/vendor/qcom/camera/oplus/benz-camera-overlay.dtbo
Reloading overlay blob out/target/product/benz/obj/DTB_OBJ/arch/arm64/boot/dts/vendor/qcom/camera/oplus/benz-camera-overlay.dtbo
Merging overlay blob out/target/product/benz/obj/DTB_OBJ/arch/arm64/boot/dts/vendor/qcom/camera/oplus/benz-camera-overlay.dtbo
INFO: Saving to: benz-23871-crow-overlay-DVT1-23061-audio-23061-display-camera-0x46232744d57254d9.dtbo
Traceback (most recent call last):
  File "/sauce/los/vendor/lineage/build/tools/merge_dtbs.py", line 567, in
    main()
    ~~~~^^
  File "/sauce/los/vendor/lineage/build/tools/merge_dtbs.py", line 551, in main
    created.extend(dt.save(args.out))
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
  File "/sauce/los/vendor/lineage/build/tools/merge_dtbs.py", line 469, in save
    yield mdt.save(name, out_dir)
          ~~~~~~~~^^^^^^^^^^^^^^^
  File "/sauce/los/vendor/lineage/build/tools/merge_dtbs.py", line 361, in save
    assert not os.path.exists(out_file), "Cannot overwrite: {}".format(out_file)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: Cannot overwrite: out/target/product/benz/obj/DTB_OBJ/out/benz-23871-crow-overlay-DVT1-23061-audio-23061-display-camera-0x46232744d57254d9.dtbo

Change-Id: Ia7817e91da7bde1e3a4d577c3b45d5805b0b9938
Signed-off-by: inferno0230 <mail@inferno0230.in>
2025-09-09 10:00:51 +02:00
Nick Reuter
03fac07fe7 build: Update rust toolchain dynamically
Change-Id: Iedcc0ebc7f42f65bd1b9578d92bf101f642dec7e
2025-09-06 15:10:53 -05:00
Yumi Yukimura
309e9e54f5 lineage: Move build-manifest.xml build rule into build/tasks
* For Android.mk deprecation

Change-Id: I4aba949ae0af7674955d7a2c439d191348b41f3c
2025-08-25 15:12:04 +00:00
Yumi Yukimura
f6a79e8749 lineage: Restore Android.mk based build-manifest.xml build rule
Users don't like the increased delay during `. build/envsetup.sh` or `lunch`...

Change-Id: I1a92a171f2e2ec1ba2453d6c666cefcd9884b39b
2025-08-24 20:51:55 -04:00
Yumi Yukimura
b72f886b0c lineage: Move build-manifest.xml generation to a separate script
Change-Id: I68a13fdb47a034157a54ff5781c13b3fa17371d2
2025-08-20 21:07:33 +08:00
LuK1337
b9bca14083 kernel: Introduce macros for comparing versions and make use of them
Change-Id: Ie7debfea218117987f7e9588a71447061db08416
2025-08-17 17:45:37 +02:00
LuK1337
fd1f593ac8 build: Make {aosp,clo}remote work when not in the root dir of the repo
Change-Id: I59dcfb7a7c50ad5ae70b3823cea50b3cbf4671d6
2025-07-30 21:46:20 +00:00
Michael Bestas
fa5799928e build: Drop VARIANT_DEFCONFIG/SELINUX_DEFCONFIG support
This has been unused for a long time and any users that mistakenly use
this should migrate to defconfig fragments.

Change-Id: I70f1aa82e3adcbf85b11e8685f188d0eadfff2e3
2025-07-30 14:03:05 +00:00
Michael Bestas
46fea3f955 build: Drop separate recovery kernel support
Last users were in lineage-18.1, build side is no longer being ported.

Change-Id: I091498ab3536eeb050511d71cc37373f6a77486d
2025-07-30 14:03:05 +00:00
LuK1337
090431803b Revert "soong: Make mkdir install dir optional"
This reverts commit ff19773ea4.

Change-Id: Ia701f07eaabbf33098434ea2e4851d9ba5cdaff6
2025-07-26 10:51:22 +02:00
Yumi Yukimura
e41ae16190 kernel: Fix building x86 kernel with GCC
Change-Id: Ib1097d604776adc63c31b90cec9a0d13729248be
2025-07-22 20:27:25 +00:00
Yumi Yukimura
c8ecd22e78 kernel: Sign kernel modules only if CONFIG_MODULE_SIG_FORMAT=y
Change-Id: If8ef12f2b751390fc1689edb551379ca2e4e78be
2025-07-22 20:27:25 +00:00
Yumi Yukimura
8c6507739f kernel: Fix build when device does not set BOARD_SYSTEM_KERNEL_MODULES_LOAD
... but sets SYSTEM_KERNEL_MODULES

build/make lets BOARD_SYSTEM_KERNEL_MODULES_LOAD default to false
when it's unset.

Change-Id: I581da33bf0321f171aa6a20bdb023e1ee824cb18
2025-07-22 20:27:25 +00:00
Yumi Yukimura
56ed3854d0 kernel: Support installing kernel modules to system
* Example usecase: Installing zram.ko on devices without system_dlkm

Change-Id: I3afe358bcd444f7c3724e5682d4056fe52cfeea9
2025-07-22 20:27:25 +00:00
Yumi Yukimura
2bd07a47f9 kernel: Add support for external kernel configs (v2)
For targets that uses mainline kernel, the kernel tree usually only
contains configs on top of the upstream repository.

In such case, if we put the configs in elsewhere, we can simply just
track the upstream kernel repo, without needing to import configs.

Example usage:

TARGET_KERNEL_CONFIG_EXT := \
    $(COMMON_PATH)/kconfig/platform_defconfig \
    $(COMMON_PATH)/kconfig/common-addons.config

TARGET_KERNEL_CONFIG_EXT += \
    $(DEVICE_PATH)/kconfig/device.config

Change-Id: Ibafd0afa7ec06df643ba290a6149a4f0781d67fb
2025-07-22 20:27:25 +00:00
Yumi Yukimura
751388dd9f kernel: Enhancements to searching DTBs during non-QCOM DTB image generation
* Allow wildcard pattern
* Support searching in specified directory
* Add variable that accepts a list of such patterns

Change-Id: I35da8ed19447b4ab69142152d7dc8e60bc55bf14
2025-07-22 20:27:25 +00:00
Michael Bestas
a356ad6920 build: Move qti_kernel_headers to hardware/qcom-caf/common
Change-Id: I09403ac6799adce970a289136dcbab4703f20b84
2025-07-20 19:42:46 +03:00
Cosmin Tanislav
7d2705e2e7 merge_dtbs: allow one overlay to depend on multiple others
Some overlays might depend on multiple other overlays, remove this check
to allow it to happen.

Change-Id: Ib60c194fb4c0cfef02233da6539da61fa387f428
2025-07-07 11:30:05 +00:00
dianlujitao
74d4aec321 kernel: Automatically adapt path suffix for GKI modules
It has been noticed that sm8750 no longer puts GKI modules in the
subdirectory. Moreover, this seems to be something specific to QCOM,
so guard it as such.

Change-Id: Iac9c895c9c1eef06b2e4ce75bd7c5c2aa356fbb1
2025-07-06 00:39:44 +00:00
Julian Veit
426b8a4d19 repopick: Fix showing help when no arguments given the correct way
Previous solution broke picking from topic/hashtag/query.

Change-Id: I087de693e3a8e16d62f318d59287e53ea3fc2430
2025-07-05 12:10:29 +02:00
SpiritCroc
16b1b5f8c0 repopick: Fix showing help when no arguments given
Change-Id: I7a996a95a057dc70b1e8b54ea35326ec44ee81f4
2025-07-02 22:32:59 +00:00
Michael W
230d1dca1c repopick: Paginate queries properly
Currently there is a limit of 500 changes per page, giving us only
those when repopicking a query. By observing the "_more_changes" field
in the response and adding the "start" parameter to the query we can
do pagination and return all changes

Test: repopick -p -Q "branch:lineage-23.0"
Result before: 500 changes
Result after: 1094 changes (correct count as of time of commit)

Change-Id: I00304bc2c87b75cef89a26838da3dd1b1f0e65db
2025-06-27 15:07:55 +00:00
micky387
a8b479083d envsetup.sh: Export LLVM_AOSP_PREBUILTS_VERSION with the current clang version from soong
Needed for KERNEL_CLANG_VERSION if TARGET_KERNEL_CLANG_VERSION hasn't been set by the device config

It's boring to change it on each Google change ...

Change-Id: I1d682611cbf6c60d7ae6227b0b5afde591adf471
2025-06-26 22:04:16 +01:00
Alexander Koskovich
40161df056 merge_dtbs: Add qcom,oem-id to EXTRA_KEYS
This is used by Nothing to differentiate between the base & pro models
on the Phone (3a).

Change-Id: I56f7e58f134571ea35a6dafef54e2b30ba20b5f0
2025-06-14 18:24:24 +00:00
Cosmin Tanislav
49cbf625f2 merge_dtbs: ignore not matching DTBOs when finding symbols for a fixup
Change-Id: I1705341d9ec68b46ac6f6c1007c6ea28f9c4e95d
2025-06-11 05:53:44 +00:00
Yumi Yukimura
101451f332 lineage: products: Add Cuttlefish products
How-to:
1. Build and install cuttlefish packages by following [1]
2. Build LineageOS image and hosttar
    ```
    source build/envsetup.sh
    breakfast cf_phone_x86_64
    m hosttar updatepackage
    ```
3. Extract LineageOS image and hosttar
    ```
    mkdir lineage-cvd
    cd lineage-cvd
    unzip <LineageOS tree>/out/target/product/vsoc_x86_64/lineage_cf_phone_x86_64-img.zip
    tar xzvf <LineageOS tree>/out/host/linux-x86/cvd-host_package.tar.gz
    ```
4. Run it
    ```
    HOME=$PWD ./bin/launch_cvd
    ```
5. Open https://127.0.0.1:8443 in browser, and enjoy

[1]: https://github.com/google/android-cuttlefish?tab=readme-ov-file#debian-packages

Change-Id: I7d69db7be99d250f02d7e76fd398ebf5c2ca7c5f
2025-06-10 01:47:16 +08:00
Cosmin Tanislav
0ea2a44fbc merge_dtbs: Sort DTBOs based on needed symbols
Some DTBOs might use symbols from other DTBOs and require them to be
applied before them.

Sort them based on the __symbols__ and __fixups__ nodes, by creating a
dependency graph.

Change-Id: I40acf5da6b673b636a91f75ae3f3c634f2b5c505
2025-06-08 18:34:54 +03:00
Nikita Savchenko
722d1ce1be kernel: Report all modules not found at once
Change-Id: Ic46f72989b2dd5de574cc33b7e9f7499323d9bb0
2025-06-07 17:12:21 +00:00
Aaron Kling
67bbe4a32d kernel: Stop warnings for prebuilt kernel platform
If both prebuilt kernel and prebuilt kernel headers are provided, assume
that they match.

Change-Id: I8818659bd4642aa20260ff638d4a0c3f2b56a463
2025-05-31 19:24:17 +00:00
Aaron Kling
cae9b362a9 soong: Support prebuilt_kernel_headers
This depends on a kernel headers tarball path being passed in
TARGET_PREBUILT_KERNEL_HEADERS, in the style that the kleaf kernel
platform build generates.

Change-Id: Ib82659fa44ef221e73d0d129daafbaae6bad87a2
2025-05-31 19:24:17 +00:00
Michael Bestas
e1e121bea4 Revert "Add product_launched_with_j{,_mr1,mr2}.mk"
This reverts commit c756f6051f.

Reason for revert: Dead.

Change-Id: Ia4f1e45d18459004625c38754440c018333a3452
2025-05-27 18:19:07 +03:00
Michael Bestas
c9cf7884ba config: Move additional gralloc 10 usage bits to select()
Change-Id: If1542af472e74cd953d9ca093dd225dbba028aea
2025-04-30 01:08:39 +01:00
Michael Bestas
93ebcc2fa2 config: Move camera override format from reserved to select()
Change-Id: Ic8453eb9ef5fcd5b9bbfe22a8bb8100be2644e2d
2025-04-30 01:08:39 +01:00
Michael Bestas
2d041eca9e config: Move bootloader message offset to select()
Change-Id: Ic97af638005c299963d0aaa39e04227dcbca8751
2025-04-30 01:08:39 +01:00
Michael Bestas
2bd35f62c1 config: Move USB restrictions to select()
Change-Id: I0dd6ccca2493ac50019d7d077c25302d62ea4ab3
2025-04-30 01:07:53 +01:00
Michael Bestas
712c75560f config: Move vendor_init lib to select()
Change-Id: Iccda5ad6d1c37a63ff7959bd3887e120ad403d5c
2025-04-30 00:12:46 +01:00
Michael Bestas
f12b53506a config: Move libperfmgr mode extension lib to select()
Change-Id: I81ff7c05e9918a6f52f8b1bb7bcf179d3a76d078
2025-04-30 00:11:48 +01:00
Michael Bestas
92164a2390 config: Move Lineage PowerShare HAL to select()
Change-Id: If687bda38370e8dc664cef26fbb907202444d049
2025-04-26 11:58:21 +01:00
Michael Bestas
1c1551858c config: Move Lineage Health HAL to select()
Change-Id: Ie7f29e75d812fff0faf27f9c82ca432a78c199fb
2025-04-26 11:58:21 +01:00
Michael Bestas
20a2227caf config: Move surfaceflinger UDFPS lib to select()
Change-Id: Iecf818e3f45811760a2e51156014e4ef6ec6afa7
2025-04-26 11:58:21 +01:00
Michael Bestas
695e44e1ba soong: Move QTI gralloc configs to select()
Change-Id: Icb28d5c2aa5d51860799b87b7b9b04c48014f7f4
2025-04-26 10:18:05 +00:00
Michael Bestas
d690c9eb9f build: Remove reference to deprecated VR HAL
Change-Id: Ia2319ca64e85a64d4c8b0ab4972c78e97cebc76b
2025-04-24 20:25:01 +03:00
Nolen Johnson
2130319a7f Revert "kernel: Add support for external kernel configs"
This reverts commit 1b1687b456.

Reason: Breaks variant defconfigs.
Change-Id: Ie81301eb5a3376ab969430eed54a432d7d300408
2025-04-22 15:20:41 -04:00
Arian
eef4080d27 android: merge_dtbs: Respect oem specific extra ids
Some OEMs add their own properties to avoid merging incompatible
overlays for different devices with the same QCOM soc.

Change-Id: Ic5b38a122173d8e9ecc1f0f399411cb37acf3150
2025-04-18 16:08:24 +08:00
Yumi Yukimura
1b1687b456 kernel: Add support for external kernel configs
For targets that uses mainline kernel, the kernel tree usually only
contains configs on top of the upstream repository.

In such case, if we put the configs in elsewhere, we can simply just
track the upstream kernel repo, without needing to import configs.

Example usage:

TARGET_KERNEL_CONFIG_EXT := \
    $(COMMON_PATH)/kconfig/platform_defconfig \
    $(COMMON_PATH)/kconfig/common-addons.config

TARGET_KERNEL_CONFIG_EXT += \
    $(DEVICE_PATH)/kconfig/device.config

Change-Id: I021ffb76d0c0612343cff7b5c81541c2b88ef7e6
2025-04-15 01:27:38 +00:00
Yumi Yukimura
f171568f8b kernel: Add support to append DTBs to kernel image
* Many Qualcomm targets that uses boot header v0 or v1
  have the DTBs appended to the end of kernel image.

* In downstream msm kernels up to msm-4.19, Appending DTBs
  is handled in the kernel tree. However, on msm-5.4 and
  newer msm kernels, and on mainline kernel, This is not
  supported.

* Normally, DTB processing depends on how the bootloader
  loads it and should not be handled in the kernel tree,
  so we handle it here.

* Instead of appending all DTBs by default, Get the list of
  DTBs that needs to be included from a variable, so that
  we don't need to modify dts Makefile to exclude unwanted
  DTBs, and we could also ensure the DTBs are appended in
  a specific order.

Change-Id: I603d1ebac5ee808bad045b85f9868d572d52cb80
2025-04-15 01:27:38 +00:00
Aaron Kling
16075eab65 kernel: Use correct recovery modules.load variable
Originally, BOARD_RECOVERY_RAMDISK_KERNEL_MODULES_LOAD was used, but
BOARD_RECOVERY_KERNEL_MODULES_LOAD is what build/make uses. Use the
proper variable by default and if it's not set, use the old variable.

Change-Id: I3522e4782ae56f67e49b234236fbb86c8ec65b92
2025-04-06 19:07:29 +00:00
Cosmin Tanislav
ae2f5b65e8 kernel: use DTBS_OUT variable
DTBS_OUT is set to $(DTB_OUT)/out, use it.

Change-Id: Id6ec8b1f32e4b54cd9c463c3af7146711a800d81
2025-04-05 19:47:13 +00:00
Michael Bestas
67492332e1 soong: move EGL display array config to select
Change-Id: Ia03dd6b49637ed3b7432df26824fcbf01d92106b
2025-04-03 20:48:03 +00:00