summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-10-27kleaf: extract_symbol with GKI modules objectsandroid-t-qpr2-beta-2_r0.5android-t-qpr2-beta-2_r0.4android-t-qpr2-beta-2_r0.3android-t-qpr2-beta-1_r0.6android-t-qpr2-beta-1_r0.5android-t-qpr2-beta-1_r0.4android-13.0.0_r0.76android-13.0.0_r0.60android-13.0.0_r0.59android-13.0.0_r0.58android-13.0.0_r0.55android-13.0.0_r0.54android-13.0.0_r0.53android-gs-raviole-5.10-t-qpr2-beta-1android-gs-raviole-5.10-android13-qpr1android-gs-pantah-5.10-t-qpr2-beta-1android-gs-pantah-5.10-android13-qpr1android-gs-lynx-5.10-android13-d4android-gs-bluejay-5.10-t-qpr2-beta-1android-gs-bluejay-5.10-android13-qpr1Ramji Jiyani
Due to change f67eea6aa43b30326960b39fe5f4c99c1519b86a (kleaf: Do not include GKI modules in default output of //common:kernel_aarch64.) and relevant changes, GKI modules are no longer listed as default outputs of the GKI kernel //common:kernel_aarch64, causing the `in_tree_modules` list to be empty in extracted_symbols rule. Backporting this change fixes the issue by also extracting the full modules_staging_dir, which contains all GKI modules. Bug: 246716067 Test: manual (bazel run //common:kernel_aarch64_abi_update_symbol_list, see no change) Signed-off-by: Yifan Hong <elsk@google.com> ---- Original commit message: To partition between GKI and vendor modules on the fly; we need to pass GKI modules from the base_kernel build in addition to vendor modules. Remove passing the list and pass the modules instead from the base_kernel first and then the vendor modules overwriting the modules from the base build being overridden. Bug: 245404948 Bug: 232431411 Test: TH Signed-off-by: Ramji Jiyani <ramjiyani@google.com> Change-Id: I2f40943d0d4f0a65cc7ab47a5064caff7fbf39b4
2022-10-27kleaf: refactor common constants for MODULES_STAGING_ARCHIVE.Yifan Hong
Test: TH Change-Id: I434bf0933edd3656f5ea59a0edb5c481bb4840f7 Signed-off-by: Yifan Hong <elsk@google.com>
2022-10-21kleaf: ABI add MAKE_GOALS += vmlinuxYifan Hong
Always add vmlinux to MAKE_GOALS for ABI targets. Otherwise, it is not built without the existence of base_kernel. Test: build slider_abi_dist Bug: 254328713 Change-Id: Ib720e21dcd28fa4e8703787c7938a516902779e6
2022-10-19kleaf: Always run depmod for GKI builds.Yifan Hong
Even though there are no external modules, running kernel_modules_install (depmod) is necessary because we have in-tree GKI modules. Test: TH Bug: 254127112 Change-Id: I506d583bc8715ef7433d467e8170f48db141d4de
2022-10-19kleaf: docs: Add missing KMI_SYMBOL_LIST_ADD_ONLYUlises Mendez Martinez
Bug: 248004337 Signed-off-by: Ulises Mendez Martinez <umendez@google.com> Change-Id: I99ec941b8f13766395fa370843af67d5abfd8aab (cherry picked from commit 0698da54e1ab185a197346e0a37c377838500d8b)
2022-10-19kleaf: kernel_module kernel_module_deps -> depsYifan Hong
There'll be additional deps that are not kernel_module, especially for ddk_module. So deprecate the kernel_module_deps attribute and use the standard name, deps. Test: TH Bug: 211515836 Change-Id: Idb0bacc0a0add23bad01fffc5bed65ee0a88580b (cherry picked from commit 0382f35d937ca53f2ba232552e1b18c7533633cb)
2022-10-18compare_to_symbol_list: Fix script name in UsageRamji Jiyani
Bug: 232431411 Test: TH Signed-off-by: Ramji Jiyani <ramjiyani@google.com> Change-Id: Ib1cf9aa082f01792845a38caddf1bf66af6f881a
2022-10-17kleaf: device modules takes priority over GKI modules in unstrippedYifan Hong
In the case when the device also builds the modules with the same name as the GKI modules, the device module should take priority. Test: manually inspect the final unstripped modules archive Bug: 250097199 Change-Id: Ibc92edfbbc64f7951cfa063a7fe14761083b05c0
2022-10-17kleaf: Do not use Target's in KernelUnstrippedModulesInfoYifan Hong
It is not "Bazellic" to contain Target's in infos, but better to put necessary information only. Bug: 247622808 Bug: 247624301 Test: manual (check order in srcs in kernel_unstripped_modules_archive.bzl) Change-Id: Ic1891d99ec7bd24b07d30873e4f223263c1add38
2022-10-12kleaf: unstripped modules archive allow collisions.Yifan Hong
Collisions are unavoidable with GKI modules, because both the unstripped dir from GKI modules and the dir from device modules contains the device-built GKI modules (e.g. slider builds zsmalloc). Hence, just allow collisions. Test: build slider_unstripped_modules_archive Bug: 228557644 Bug: 253309286 Change-Id: Ia90a59a110ac80860ae47fb895cce6a03c76c929
2022-09-22kleaf: Rename files from ABI Extractionandroid-t-qpr1-beta-3_r0.5android-t-qpr1-beta-3_r0.4android-t-qpr1-beta-3_r0.3android-t-qpr1-beta-3.1_r0.1android-13.0.0_r0.50android-13.0.0_r0.49android-13.0.0_r0.48main-16k-gs-raviole-5.10android-gs-raviole-5.10-android13-qpr1-beta-3android-gs-pantah-5.10-t-qpr1-beta-3android-gs-pantah-5.10-android13-qpr1-beta-3android-gs-bluejay-5.10-android13-qpr1-beta-3Ulises Mendez Martinez
Bug: 243136716 Signed-off-by: Ulises Mendez Martinez <umendez@google.com> Change-Id: I08851cd40b250b73f471bcf42a1ad5e9426f896d (cherry picked from commit aa63643d678e6e8e00a297823f3d75e63bb0abb0)
2022-09-15kleaf: Fix kernel_module.outs = None failureYifan Hong
_kernel_module_set_defaults sets the defaults in kwargs but it doesn't mutate the original local variable outs. Test: TH Change-Id: Ib5929ccc51a2fa225f779c64d24da9fba405c5c4
2022-09-15Revert "kleaf: exclude backup files in glob expression"Yifan Hong
This reverts commit 67e88a473c41adb934edc961f54fe7b9932b4578. Reason for revert: we'll use solution to not glob Change-Id: Ie0ae4bb1c053d65a4d593fe81da40579aa2cfd46
2022-09-14kleaf: exclude backup files in glob expressionYifan Hong
... where the result of the glob expression is used in conditionals in Bazel macros and rules. The most significant one is where we look for KMI symbol lists. Also exclude backup files create by some editors to avoid the ABI monitoring tools to add unexpected files (e.g. android/abi_gki_aarch64.xml~). Test: TH Bug: 246344503 Change-Id: I26a757bbd6feaf5715b765186ce7dc02846fd666
2022-09-13kleaf: Support building boot-img.tar.gz for x86_64 GKI.Yifan Hong
boot-img.tar.gz is also available for x86_64 arch, so remove the conditional. Test: builds Bug: 245302247 Change-Id: Ib5699ee822e4eb2fc2a8f13db22c679d4d4bcad5 (cherry picked from commit 3ac8be54503d8bc9d893e902d51e75b6e3f7bda3)
2022-09-12Builds boot-img.tar.gz for x86_64 GKIBowgo Tsai
Unlike arm64 GKI, currently x86_64 GKI artifacts only include a boot.img without a boot-img.tar.gz. To support x86_64 GKI certification, we also need to build a boot-img.tar.gz for the signing server to start GKI certification process. Bug: 241497048 Test: BUILD_CONFIG=common/build.config.gki.x86_64 build/build.sh Change-Id: Iee877975c6b613af1fecb6dbc310988d465ec7f5 Signed-off-by: Bowgo Tsai <bowgotsai@google.com> (cherry picked from commit 3567ad13950c2619c5e29918d257d12a548a7853)
2022-09-09build_utils: Ignore no match failure in module trimming.John Moon
Currently, if no modules are matched by grep while trimming unused modules, the build fails. This is because Bazel is running the scripts with set -o pipefail. To fix, simply ignore the grep failures in the middle of the pipeline. Bug: 245744241 Change-Id: Ie730f7ce6756b69d704e749d2ad04b94baad087b Signed-off-by: John Moon <quic_johmoo@quicinc.com>
2022-09-09kleaf: Fix bazel version.Yifan Hong
bazel version does not accept custom args like --//build/kernel/kleaf:cache_dir. Test: bazel version Bug: N/A Change-Id: I5ffcec021267ac8e3061848841b483c8e086a014 (cherry picked from commit 697977083abe458fc921c9496916c83a9a2615d8)
2022-09-09kleaf: Do not set --cache_dir for bazel query.Yifan Hong
It breaks the bazel query command. Test: manual Change-Id: Ia0478eb47d380721b2d6242a9df00675d8821931 (cherry picked from commit 515c020119a6f37bf4b3aef490741fa679e5d175)
2022-09-06kleaf: Fix link in impl.md.Yifan Hong
We no longer maintain the raviole-mainline branch on AOSP, but the raviole-5.15 branch is maintained. Test: none Change-Id: I4b376ae8378c4e9849582d3458ad96d2dcfa2315
2022-09-06Add short aliases for kernel_build.*outs.Yifan Hong
This enables the following labels for 5.15 branches //common:kernel_aarch64/zram.ko //common:kernel_aarch64/zsmalloc.ko Test: TH Bug: 244215515 Change-Id: I248ada8bc51645e567c3d73141562c3a46713f63
2022-09-06kleaf: Do not include GKI modules in default output of //common:kernel_aarch64.Yifan Hong
This change adds the `module_implicit_outs` mechanism to kernel_build that acts like `module_outs` but not added to default info (like implicit_outs). This allows us to exclude GKI modules from //common:kernel_aarch64 DefaultInfo. When a device kernel builds their own modules that conflicts with the GKI modules (zram and zsmalloc for android13-5.15), the dist target will produce a warning about conflicting source files. Hence, do not include zram and zsmalloc to the device dist targets by default when they include "//common:kernel_aarch64" only. If they wish to include zram and zsmalloc in the distribution on the android13-5.15 branch, they may add the following to the dist target: "//common:kernel_aarch64_modules", or individual modules: "//common:kernel_aarch64/drivers/block/zram/zram.ko", "//common:kernel_aarch64/mm/zsmalloc.ko", //common:kernel_aarch64_dist continues to include GKI modules defined by the branch. Bug: 244215515 Test: manual Change-Id: Id1c9fd9e603e9b2946cd59c7fde14d11ef7dd8b2
2022-08-15Kleaf: fix caching for --config=localMatthias Maennich
The --config=local mode was broken in that it would not actually cache the OUT_DIR across executions. This was due to the OUT_DIR being defined in the sandbox, relative to symlinked sources. It is not clear why the local mode worked before and what combination of changes broke it. This change restores is by adding a starlark flag --cache_dir that is used to define OUT_DIR in KernelEnv. Said flag is also understood by the bazel.py wrapper and set to a reasonable default within WORKSPACE if not defined. Yet in order to have $WORKSPACE/out/cache we need to also execute the KernelEnv rule in config=local mode. This lets --config=local and --config=fast cache OUT_DIR in $WORKSPACE/out/cached/<some_generated_name> across invocations. Further, by specifying --cache_dir=/some/fast/disk consistently across invocations, one can make use of a fast filesystem for caching; perhaps a tmpfs. In an experiment, this saves 50s when comparing --config=local and non --config=local incremental builds. Bug: 235632059 Bug: 241603176 Test: manual with the following: $ bazel build //common:kernel_dist && echo >> common/init/main.c && time bazel build //common:kernel_dist Takes 114 seconds for the second build; kernel_build() takes 97s. $ bazel build --config=local //common:kernel_dist && echo >> common/init/main.c && time bazel build --config=local //common:kernel_dist Takes 64 seconds for the second build; kernel_build() takes 40s. Signed-off-by: Matthias Maennich <maennich@google.com> Signed-off-by: Yifan Hong <elsk@google.com> Change-Id: I64fbfd928efd78fb5d3d3c3af6a5582fca22b0a5 (cherry picked from commit c2f2105abc6f729357a56a6c354ac9516a4a0907)
2022-08-11abitool.py: shorten ABI report paths by removing .stgGiuliano Procida
`diff_abi --abi-tool delegated` (which is what the build runs) produces a number of reports and compatibility links. This commit changes the reports as follows: * `abi.report{,.short}` are no longer copies of `abi.report.stg.short` * each `abi.report.stg.foo` is now `abi.report.foo` * `abi.report` is now a copy of `abi.report.short` Change-Id: I49aa71eb8e84ab5ecf2634180dcd62348c34c779 Test: manual Signed-off-by: Giuliano Procida <gprocida@google.com>
2022-08-11abitool.py: simplify Delegated diff_abi codeGiuliano Procida
Now that `abidiff` is no longer invoked, we can get rid of a bunch of complexity that is no longer needed. Bug: 228843807 Change-Id: Ic233a17e26e6e060da0ebebb865907a49f1437dd Signed-off-by: Giuliano Procida <gprocida@google.com>
2022-08-11abitool.py: diff_abi --abi-tool delegated no longer invokes abidiffGiuliano Procida
Farewell `abidiff` reporting. `abidiff` is still available as a pre-built binary and `diff_abi --abi-tool libabigail` should continue to work. We will not support such use-cases after Android 13. Bug: 228843807 Change-Id: Ief321b01a356774afc881c8fc13389bde73b454b Signed-off-by: Giuliano Procida <gprocida@google.com>
2022-08-11abitool.py: repoint compatibility links at STG short reportGiuliano Procida
Various people and systems may continue to assume the existence of `abi.report` and `abi.report.short` files. This commit links both of them to `abi.report.stg.short`. Bug: 228843807 Change-Id: Ib6d61eaf9c7575c17ef8d312dabed3cf409bf056 Signed-off-by: Giuliano Procida <gprocida@google.com>
2022-08-11abitool.py: prefer stgdiff reports over abidiff reportsGiuliano Procida
Now that `stgdiff --format short` also groups together removed and added symbols the reports are more suitable for inclusion in commit messages. Bug: 228843807 Change-Id: I8d65810c01218542603b7f01d53ed62717f3d984 Signed-off-by: Giuliano Procida <gprocida@google.com>
2022-08-11abitool.py: remove dead stgdiff post-processing codeGiuliano Procida
It is no longer used. Bug: 231304878 Change-Id: I3dc69789b9d42903ec0b18d8005aae7cae713eaa Signed-off-by: Giuliano Procida <gprocida@google.com>
2022-08-11abitool.py: replace stgdiff post-processing with own functionalityGiuliano Procida
This impacts `diff_abi --abi-tool delegated` which is what is used by AOSP kernel build tools. With this commit: * `stgdiff` is invoked with `--compare-options all` which causes * symbol type presence changes to be ignored * type definedness changes to be ignored * (these options are needed to deal with varying `abidw` output and replace specially coded post-processing) * `stgdiff` additionally produces a `short` format report * this includes all the existing report compression: * runs of CRC-only changes * runs of offset changes * and adds: * grouping together of symbol removals and additions * the `.stg.small.short` report has been removed * it was a post-processed version of `.stg.small` * but has been obsoleted by `.stg.short` * if STG finds a diff (but libabigail does not) then * the printed report is now the `.stg.short` one Bug: 231304878 Change-Id: Iffe29ea030558bbe422118cf082f24c3b14f0f72 Signed-off-by: Giuliano Procida <gprocida@google.com>
2022-08-11abitool.py: factor out function to link report filesGiuliano Procida
This change introduces `_link_file`. The second argument is the new destination link. Any existing file with that name is first removed. Change-Id: Ifbf7c020ec3c4bc2c66253cd96c3ad7d615674ae Signed-off-by: Giuliano Procida <gprocida@google.com>
2022-08-11abitool.py: drop support for --abi-tool STGGiuliano Procida
This was broken by an earlier commit and no one noticed. `stgdiff` is run with `diff_abi --abi-tool delegated` which is what we use. Change-Id: Iff94ab874e589d66306ebbb513d4a9b7ed152c7b Signed-off-by: Giuliano Procida <gprocida@google.com>
2022-08-10kleaf: enable building device system_dlkm against GKI ↵Yifan Hong
system_dlkm_staging_archive system_dlkm_image produces staging_archive and modules.load files. Also download them and put them as part of distribution when building against downloaded prebuilts. With system_dlkm_staging_archive.tar.gz from GKI piped to the device's system_dlkm rule, instead of creating the staging directory, unarchive the archive and build system_dlkm from there. As part of this change, kernel_images now also accept these arguments: - system_dlkm_modules_list - system_dlkm_modules_blocklist - system_dlkm_props ... which corresponds to the upper-case version of the build configs, respectively. Their semantics are the same as the build configs. Unlike vendor_dlkm_*: - system_dlkm_modules_list falls back to modules_list if not set - system_dlkm_modules_blocklist falls back to modules_blocklist if not set Test: build slider_images_system_dlkm_image with build_system_dlkm=True Bug: 233401974 Bug: 238786592 Change-Id: Ie9a2073d571b23eee58764ef9ced0976e5fa9622 Signed-off-by: Yifan Hong <elsk@google.com>
2022-08-10kleaf: modify where the bazel wrapper search for bazel wrapper args.Yifan Hong
A bazel invocation usually looks like: bazel [<startup options>] <command> [<command_args>] [-- <target_patterns>] Bazel wrapper args like --use_prebuilt_gki, --make_jobs, etc. are now only searched from command_args in the list. The Bazel wrapper: - Appends additional startup options - Transform command_args ... before feeding the arguments to the Bazel binary. Test: manual Test: TH Bug: 235632059 Change-Id: If93ee196ad9f1c277d8b460ecdca334fa540845e Signed-off-by: Yifan Hong <elsk@google.com>
2022-08-10kleaf: error message goes to stderr.Yifan Hong
Test: TH Change-Id: I0eaed0fd9ee58532213053f20195e6a2067911f0
2022-08-10kleaf: Update link in doc.Yifan Hong
No more slider.bzl. Test: none Bug: 241937211 Change-Id: I97d5d5098a97492e1ddb40359261a4b211671d97
2022-08-09kleaf: do not rsync -L for modules_install source/ and build/ symlink.android-t-qpr1-beta-1_r0.4android-gs-bluejay-5.10-android13-qpr1-betaYifan Hong
The staging directory of a kernel_modules_install target contains symlinks to the out directory and the source directory. If rsync --copy-links (transform symlinks into referrent file / dir), the build time is significantly longer. Hence, just copy symlinks as symlinks (use -l option) for the source/ and build/ symlinks. Test: Build and check build time Bug: 235632059 Change-Id: Ic8f2b29229a3fe1c43619207f5aaa64ad46792ad
2022-08-08kleaf: Add gki_artifacts to downloaded prebuilts.Yifan Hong
This adds gki_artifacts (boot images, boot-img.tar.gz, gki-info.txt) to the list of artifacts available to be downloaded from --use_prebuilt_gki flag. For distribution for device kernel builds that builds against prebuilts, this ensures the boot image from GKI build is included. Test: TH Change-Id: Id7215b2fdbd20723a48580fe7aa41ba815ee86d0 Signed-off-by: Yifan Hong <elsk@google.com>
2022-08-05kleaf: modules_options is a file, not a string.Yifan Hong
Unlike MODULES_OPTIONS in build.sh, modules_options in Kleaf points to a file that contains the lines. Fix comments and build rules that previously assume it contains strings. Test: bazel test //common:kernel_aarch64_tests Fixes: 241162984 Change-Id: Ie3ab2544f91cbcec55e5af390fc06eba400add14
2022-08-06build_utils: build_system_dlkm exits properly if sign-file does not exist.Yifan Hong
Use a for loop instead of find+exec so that, if there are any errors in sign-file (e.g. the script does not exist), exits properly (assuming set -e). Test: manual Change-Id: Icf04d37c3bd546a3067bb8739928246445128012 Signed-off-by: Yifan Hong <elsk@google.com>
2022-08-06kleaf: tear _additional_artifacts_downloaded apartYifan Hong
Instead of having one filegroup named additional_artifacts_downloaded, define multiple filgroups that corresponds to each item in it, then define the overarching _additional_artifacts_downloaded on top of it. Same for _additional_artifacts_download_or_build. Test: bazel build --use_prebuilt_gki=xxx \ //common:kernel_aarch64_additional_artifacts_downloaded Change-Id: I4f94fb715be32d7144e823a5f2cd02aa665d4e1e Signed-off-by: Yifan Hong <elsk@google.com>
2022-08-06kleaf: remove unused variable.Yifan Hong
The source_package_name is useless because Bazel is okay with or without the prefixing colon. Test: TH Change-Id: I147800c6effd6d2f417a54fb1a98a1820d1306e7 Signed-off-by: Yifan Hong <elsk@google.com>
2022-08-06kleaf: rename variable.Yifan Hong
Make it consistent with the type. Test: TH Change-Id: I02483692145c3609cddda42d07cdbcf80d339de3 Signed-off-by: Yifan Hong <elsk@google.com>
2022-08-05kleaf: delete unused GKI_MODULES list.Yifan Hong
It is a per-branch configuration. Hence there is no need to maintain a common list in build/kernel. Test: TH Change-Id: I7d2dacbf1a9579ba11e61f5db38361aaed686fab Signed-off-by: Yifan Hong <elsk@google.com>
2022-08-05kleaf: delete empty GKI modules_install target from dist target.Yifan Hong
Test: TH Change-Id: I9c242115f3d7c1d2a96328b1aeaaba8320d0149a Signed-off-by: Yifan Hong <elsk@google.com>
2022-08-05kleaf: fix comment for erofs system_dlkm.Yifan Hong
The filesystem format is an implementation detail. Test: none Change-Id: I241b038760b6d5bdb9104f0282cadb601a500110
2022-08-05build_abi.sh: fix symbol list updating for mixed buildsWill McVicker
When updating the ABI symbol list for a mixed build configuration, build_abi.sh disables mixed building and directly compiles the kernel using the device BUILD_CONFIG. In order to be able to successfully do this, we need to also make sure the proper kernel files are copied over to the DIST_DIR (since mixed building doesn't require the device BUILD_CONFIG to do this). Re-work this logic to (1) only modify MAKE_GOALS and FILES when mixed building is enabled and (2) append the necessary kernel artifacts to the FILES variable. Bug: 239094500 Signed-off-by: Will McVicker <willmcvicker@google.com> Change-Id: If1f1d60874ba899f4f8e50394b9eb653a1f7cef9
2022-08-05build_abi.sh: handle TRIM_NONLISTED_KMI not equal to 1Will McVicker
Currently we are just checking if TRIM_NONLISTED_KMI is set and not differentiating between =0 and =1. So update the script accordingly to make sure we don't re-compile the kernel unnecessarily. Bug: 239094500 Signed-off-by: Will McVicker <willmcvicker@google.com> Change-Id: I9ad799305d2790ca763bdea7a4bee1db7d24e0f0
2022-08-05build_abi.sh: add source build_utils.shWill McVicker
This is needed for use of rel_path in the BUILD_CONFIG when updating the ABI. Bug: 239094500 Signed-off-by: Will McVicker <willmcvicker@google.com> Change-Id: Id4880214c4d5ef7200029f770814e18c536661ea
2022-08-04kleaf: Add buildozer commands in error messages.Yifan Hong
In addition to providing the lines to add to the BUILD files, also provide a buildozer command that, when executed, attempts to fix the BUILD files automatically. Running buildozer requires the developer to install buildozer as a one-time set up. Sample output: Alternatively, install buildozer and execute: $ buildozer 'add module_outs drivers/mfd/vexpress-sysreg.ko drivers/gpu/drm/drm_cma_helper.ko drivers/gpu/drm/pl111/pl111_drm.ko drivers/virtio/virtio_mmio.ko drivers/input/mouse/psmouse.ko drivers/input/serio/ambakmi.ko drivers/clk/versatile/clk-vexpress-osc.ko drivers/bus/vexpress-config.ko drivers/mmc/host/armmmci.ko' //common-modules/virtual-device:virtual_device_aarch64 Bug: none Test: manual Change-Id: I8b7ea944721975e4406be430e544d60580d9bae0