Compile zram/zsmalloc as unprotected vendor_dlkm.
While at it update corresponding system_dlkm in blocklist
so that only vendor_dlkm modules are loaded.
Change-Id: I620215fa42e4b8009e3b504ac4e3db84ac178023
Signed-off-by: Wasim Nazir <quic_wasimn@quicinc.com>
Early boot kernel logs are enabled with earlycon cmdline option.
If earlycon device is passed to earlycon as a parameter with "=dev",
it is considered, otherwise kernel relies on stdout-path for the device.
Since this device can be different for different chipsets, sharing the
same compiled binary, the value passed to earlycon parameter can
be wrong for some of the chipsets, which is leading to issues like
invalid address access or garbled logs in some cases.
To fix this, add earlycon without any value so that the right
device can be picked from stdout-path. For chipsets not having
stdout-path defined, keep passing earlycon value if it is explicitly
defined in target bazel file.
Also, remove default earlycon param value for Pineapple family of
chipsets to avoid adding wrong address for Cliffs, Volcano SoCs.
Change-Id: If40d23a3916f1f148e26033d67408279dfca5493
Signed-off-by: Naini Singh <quic_nainsing@quicinc.com>
Signed-off-by: Naman Jain <quic_namajain@quicinc.com>
Currently, if dpm_overlay is enabled for a platform, it will be
added unconditionally. However, if there are no dtbo files, the
build will fail.
Check if there are no dtbo files and disable the dpm definition in
that case.
Change-Id: Ia213f1011dce29a42358c9414b5072f1a39ef7e2
Signed-off-by: John Moon <quic_johmoo@quicinc.com>
Currently, we copy system_dlkm artifacts from ACK to our dist dir.
This includes the system_dlkm.modules.blocklist file. So, when we
try to block a system_dlkm module from loading using the local
blocklist, it doesn't work.
To fix, let's manually copy the system_dlkm blocklist to the dist
dir.
Change-Id: Ic3930f171ec9711030eb937a081e8110a9ea2463
Signed-off-by: John Moon <quic_johmoo@quicinc.com>
Currently, there's no way to generate a dpm.img file from the Bazel
build. As this should be generated when a dpm overlay dtbo exists,
generate it in that case.
To make use of this macro, just set dpm_overlay = True when defining
an LA target.
Change-Id: I10222499737ffb9b43cb2bac235ada66c8cae2e5
Signed-off-by: John Moon <quic_johmoo@quicinc.com>
Currently, we use an in-tree definition of the super_image rule to
generate our super.img files. This rule depends on a private kleaf
API which is no longer visible to msm-kernel after an upstream
change.
To fix, we've upstreamed the super_image rule to kleaf which allows
usage of the private API. Accordingly, we need to make an update here
which uses the new super_image API from kleaf.
Change-Id: Ie904958a773061c83e33190cc9ad89a5467c738e
Signed-off-by: John Moon <quic_johmoo@quicinc.com>
Currently, there are a few places where we use Bazel's native genrule
rule to generate files that consist of simple strings (usually with
cat << EOF or echo "str" >> "$@" semantics). It was recently pointed
out to us that the Skylib library (already available from Kleaf) has
a "write_file" rule which is better than our genrule method for
creating files from strings.
It's better because it has a simpler interface, does not rely on any
Starlark-external tools (i.e. bash), and does not require all of the
strings to be formatted in one operation which makes the rule
slightly more readable.
Replace file-creating genrules where it makes sense to do so. This
change has no impact on actual build logic as the output files are
logically identical.
Change-Id: I2cef369e299d42b2677ddea833c43d9c80eff32c
Signed-off-by: John Moon <quic_johmoo@quicinc.com>
Kleaf test_mapping rules are no longer used upstream and were being
skipped in our builds anyway.
Remove the test_mapping rules.
Change-Id: If8689f4572b1d1dce2c8ba03075444fa3af7d86b
Signed-off-by: John Moon <quic_johmoo@quicinc.com>
A copy-paste error prevented the copying of the generated
extra_bootconfig file even when board_bootconfig_extras was specified if
additionally, board_kernel_cmdline_extras was not specified. Fix this.
In addition, also fix the error of board_bootconfig_extras and
board_kernel_cmdline_extras accumulating values over all the variants
when the intention is for them to only contain values per variant.
Fixes: 8a0b83b567 ("ANDROID: build: Pass variant-specific bootconfig params to vendor")
Change-Id: I944b806e8f65f5b90027d263101b0893586e3eff
Signed-off-by: Guru Das Srinagesh <quic_gurus@quicinc.com>
Currently, if no module list is provided, the build will error out
because our logic only creates a required output file if there is at
least one module listed.
Fix this case by touching the output file prior to filling in the
module list. This way, the requirements of the Bazel output rule
are always met.
Change-Id: Ie09f63e931ee3f9399b3bd6e724a4ee995dd5b42
Signed-off-by: John Moon <quic_johmoo@quicinc.com>
Enable the inclusion of variant-specific Android bootconfig parameters in
vendor builds through the generation of a file containing them.
Set "androidboot.console" to 0 for Vendor GKI variant by this method.
Previously, this was set via the kernel command line, which leads to a
VTS test failure that forbids "androidboot.*" parameters from being
specified via kernel command line and redirects their inclusion via the
`bootconfig` mechanism.
Change-Id: Id449bd82d655082add0a80b3be221ada97fc1933
Signed-off-by: Guru Das Srinagesh <quic_gurus@quicinc.com>
Don't enable "androidboot.console=1" for consolidate. Enabling this
results in not being able to interact with serial console except through
`adb`.
Also, generate extra_cmdline only if any board kernel commandline
options are specified, not unconditionally.
Fixes: 585aa20d96 ("ANDROID: build: Pass variant-specific kernel cmdline params to vendor")
Change-Id: I3641ab01d5ddb0f5b582f7ca40257ce06037503a
Signed-off-by: Guru Das Srinagesh <quic_gurus@quicinc.com>
Run buildifier on these two files to clean them up.
Change-Id: Iac0158023616346543a444c7d2b8e76d320567df
Signed-off-by: Guru Das Srinagesh <quic_gurus@quicinc.com>
Remove ABI comparison for mixed GKI builds. Kleaf ABI comparison for
mixed builds uses the vmlinux from the base kernel. This is the
interface we want to compare against, so the ABI test is a tautology.
For now, ABI enforcement will be done with //msm-kernel:kernel_aarch64.
Change-Id: Ie713916e666bd02a399b774d47b34e303b94ae5b
Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
Enable the inclusion of variant-specific kernel command line parameters
in vendor builds through the generation of a file containing them.
Set "androidboot.console" to 0 and 1 for Vendor GKI and consolidate
variants respectively, by this method.
Additionally, enable "nosoftlockup" for the GKI variant of both Kernel
Platform and Vendor builds by this method.
Change-Id: Id2ce57bad4556cfa96c1a0215141a1f015066e8b
Signed-off-by: Vamsi Krishna Lanka <quic_vamslank@quicinc.com>
Signed-off-by: Guru Das Srinagesh <quic_gurus@quicinc.com>
Some targets require different boot image sizes, so allow that to be
configurable instead of hard-coded.
Change-Id: Iaac716f5baf91e99e0e91e71ab7da73edbbb46b7
Signed-off-by: Guru Das Srinagesh <quic_gurus@quicinc.com>
Remove dtbo list check for build vendor_boot flag to ensure
vendor_boot img gets created in overlay disabled builds.
Change-Id: Ib44d6c17db6a102b9eea1ef1f75e3a8175e657b4
Signed-off-by: Naman Jain <quic_namajain@quicinc.com>
Convert the final boot image generated into a "chained partition" [1],
which is accomplished by calling `avbtool add_hash_footer` on it.
[1]: https://android.googlesource.com/platform/external/avb/+/master/README.md
Change-Id: Iee1b9d57165011ffbabd273a2610cf2733731359
Signed-off-by: Guru Das Srinagesh <quic_gurus@quicinc.com>
Currently, we are using a copy_to_dist_dir() call to copy our kernel
artifacts to the dist dir. Instead, for GKI-enabled builds, we should
by using kernel_abi_dist() which is a wrapper rule that includes an
ABI check.
Switch to kernel_abi_dist for GKI builds and adjust output artifact
lists accordingly.
To use the kernel_abi_dist rule properly, we must also use the GKI
build's kernel image. So, when building GKI targets, the kernel image
and boot.img in the output directory will now be coming directly from
the GKI build.
Change-Id: Ia453fcb17031f3e0b6f9d24a4a3af2a028bfdbe5
Signed-off-by: John Moon <quic_johmoo@quicinc.com>
Currently, we're referencing protected module and export lists which
are not architecture-specific. Recently, an upstream change made the
lists architecture-specific, so we have to change the file names.
Change the file names for the lists to match upstream.
Change-Id: Ie70e18021633749d77187f06853210cd7181a935
Signed-off-by: John Moon <quic_johmoo@quicinc.com>
Currently, our build uses the XML ABI definition exclusively for KMI
builds. Upstream recently switched to use STG. They also added new
lists for protected module tracking.
To stay in line with upstream, update our ABI definitions to use
these new build attributes. Remove the abi_gki_aarch64.xml file as
it is no longer used.
Change-Id: I6b4a8a7eacec16c37fd73aa42ff44a940e8d50e5
Signed-off-by: John Moon <quic_johmoo@quicinc.com>
Currently, the system_dlkm image copied to our dist directory is
built from msm-kernel. Instead, we should use the version built from
ACK.
Disable building system_dlkm from msm-kernel and switch to copying
the ACK version to the dist dir.
Change-Id: I78f732b7963c88e77fadcd7dd8c8424038f0a199
Signed-off-by: John Moon <quic_johmoo@quicinc.com>
Since, there are more options that are not common to
all targets, move them to image_opts as configurable
options.
Change-Id: I5664be920500ee6da1795812d18945d113567401
Signed-off-by: Abdul Salam <quic_asalam@quicinc.com>
This reverts commit 7d9197e99b.
Reverting to avoid removing debug information from modules.
Change-Id: I01be6f1b616ebde8578c40fc63f67a5d3170cf27
Signed-off-by: John Moon <quic_johmoo@quicinc.com>
Currently, a kernel_compile_commands rule can be defined if the user
passes define_compile_commands = True to the definition macros. This
was to avoid enabling the interceptor on the kernel_build when it was
not necessary.
With a recent change upstream, the interceptor is no longer needed to
use compile_commands. Therefore, let's remove the argument and always
define the rule. That way, users can always generate the
compile_commands.json file if they wish.
Change-Id: I723756b31a2ec4582fee804386406194f5ce77d8
Signed-off-by: John Moon <quic_johmoo@quicinc.com>
Currently, our build uses an in-house definition of a header-only
cc_library for use with userspace apps using UAPI headers.
Since we've upstreamed this feature, we should remove our internal
definition and use the one in Kleaf instead.
Change-Id: I22fd497a82a2b6148141b80c7f838d221c812a0e
Signed-off-by: John Moon <quic_johmoo@quicinc.com>
Currently, we use the "abi_definition" attribute in Kleaf to define
our ABI definition file. Upstream recently modified this API to use
"abi_definition_xml" instead.
Update the attribute accordingly.
Change-Id: If8cd72fb584015f56e5fe63ddce48d96f0aafe91
Signed-off-by: John Moon <quic_johmoo@quicinc.com>
Currently, DO_NOT_STRIP_MODULES is used to signal when and when not
to strip kernel modules. A recent upstream change removes this config
option by unsetting it during the Bazel build in Kleaf.
Instead of using the deprecated build.config method, use the
kernel_build attribute "strip_modules". Set to True in our builds.
Change-Id: I918758ce8758234bcc13a683c2b39fc639678229
Signed-off-by: John Moon <quic_johmoo@quicinc.com>
The Kleaf ABI commands require collect_unstripped_modules to be set
to true in the kernel_build.
Since we need to use those commands, add the option when we're
defining other ABI targets.
Change-Id: I20f7d80c9b7938138d875a079c829997fa02913a
Signed-off-by: John Moon <quic_johmoo@quicinc.com>
Currently, the initramfs image output is only enabled if vendor
ramdisk binaries are provided. However, Kleaf bundles the creation
of the "modules.load" file alongside the initramfs build. So, in
cases where vendor ramdisk binaries are not provided, this file is
absent.
Since "modules.load" is always necessary, always enable initramfs
image outputs.
Change-Id: I75a37c7e323f67ba91ab5f2649d97f1d20a42a67
Signed-off-by: John Moon <quic_johmoo@quicinc.com>
Currently, the bare target platform is passed into the vendor
ramdisk hook.
Some hooks may need the target and variant combo, so pass that
instead.
Change-Id: I09bb8011b23c47472a18d83bffba02f15368b2b6
Signed-off-by: John Moon <quic_johmoo@quicinc.com>
Currently, the Bazel build does not have any hooks to supply a
ramdisk to the init_boot.img build.
Add the hook and feed the output to the kernel_images rule to
generate init_boot.img.
Change-Id: I2fbfda609fde6842aede3e9d16c02923a2368eb0
Signed-off-by: John Moon <quic_johmoo@quicinc.com>
Currently, the Bazel build output directory format differs from
legacy build.sh in that it replaces underscores directory name to
hyphens.
This behavior is undesirable, so refactor the output directory name
logic to be consistent with legacy build.sh:
out/msm-kernel-<target>-<variant> where words in the target and
variant are underscore-delimited.
Change-Id: Ia60076dd613fc034888703f10d5dc836b34c317b
Signed-off-by: John Moon <quic_johmoo@quicinc.com>
Update the qcom symbol list using provided Kleaf rule:
bazel run //msm-kernel:pineapple_gki_abi_update
Change-Id: I050de4440d01dc4c92c8a1a7cec10bf74fe1ca60
Signed-off-by: John Moon <quic_johmoo@quicinc.com>
Currently, the list of implicit module outputs for all kernel builds
is hard-coded.
Instead, use the common GKI module list provided by upstream.
Change-Id: I3400def7c1bd6b637620b13040cb19e195697d18
Signed-off-by: John Moon <quic_johmoo@quicinc.com>
Currently, the Bazel build uses the kernel_build_abi and
kernel_build_abi_dist rules from Kleaf. Those APIs are now
deprecated.
Replace the deprecated APIs with the new APIs: kernel_build,
kernel_abi, and kernel_abi_dist.
Change-Id: I46d793ee2522bb71da0f80c60302b241d4097ce6
Signed-off-by: John Moon <quic_johmoo@quicinc.com>
Currently, the vendor_dlkm image is including system_dlkm modules
when building with Bazel. With the legacy build system, system_dlkm
modules are filtered out.
Since we have a list of vendor_dlkm modules handy in our in-tree
module list, just use that to generate a list file and pass in to
kernel_images.
Change-Id: I95cfc6d6e90eb0d778d0c4dab2cb3e30189c532d
Signed-off-by: John Moon <quic_johmoo@quicinc.com>
Currently, the Bazel build is creating an empty system_dlkm image
because the module list is not being passed.
Pass in the GKI module list like we do in build.sh.
Change-Id: I88c7cf0858d7607fa115f366f40663ca0ce6e315
Signed-off-by: John Moon <quic_johmoo@quicinc.com>
The canonical location of msm_kernel_extensions.bzl is changing.
Update the load() calls to the new location.
Change-Id: I27df6131de155cd0592cad5d57202ca01c4affb5
Signed-off-by: John Moon <quic_johmoo@quicinc.com>