Commit graph

44 commits

Author SHA1 Message Date
Aaron Kling
a078a220bf Fix kernel build failure on some devices and build hosts
Change-Id: Ib6ba53994b4e04503ee4636a6aaab9c0bc3f676c
2018-01-12 18:19:27 -06:00
Tom Marshall
6b83d830df lineage: build: kernel: Rework kernel header logic
The existing kernel header logic has several issues:

 * It does not depend on the actual kernel headers, so it does not
   detect actual kernel header changes.

 * It does depend on the kernel config, which should not be used to
   generate (user space) kernel headers.

The end result is that kernel headers aren't properly regenerated when
needed, and spuriously regenerated when not needed.  Additionally, the
kernel header rebuild mucks around with the kernel config, which is
unneccesary and fraught with danger.

Rewrite the kernel header dependency and generation logic as follows:

 * Use the dependency file $(KERNEL_OUT)/.headers_install_deps to
   manage dependencies on the actual kernel header files which are
   exported to user space (and the top level kernel Makefile, which
   is used to generate version.h).  The dependency file is exactly
   the same as what GCC would output for a C/C++ dependency with the
   M/MM flags.

 * Conditionally include the dependency file to detect when headers
   should be (re)generated.

 * Introduce the phony target INSTALLED_KERNEL_HEADERS for modules to
   declare a dependency on kernel headers.

Additionally:

 * Get rid of TARGET_KERNEL_HEADER_ARCH and KERNEL_HEADER_DEFCONFIG.

 * Get rid of KERNEL_OUT_STAMP and move commands to the appropriate
   places in the rules.

 * Fail the build when $(KERNEL_OUT)/usr is mentioned in a dependency.
   Note a separate commit to build/core/binary.mk will provide a
   migration path and a suitable deprecation warning.

 * Declare the kernel*config targets phony.

Change-Id: I8b46f4ea1c622d8e73cca5157be96ec09d42ebb3
2018-01-09 03:09:57 +00:00
Christian Oder
8d5db3c24f kernel: Allow building dtbo.img
taimen uses the dtbo.img as an DTB Overlay in order to use the same defconfig for both, taimen and wahoo.
The dtbo.img is built with "make dtbo.img". Allow automatically building it when setting TARGET_NEEDS_DTBOIMAGE to true, or by manually calling make dtboimage.

Thanks to luca020400 for help with the kernel.mk logic

[raymanfx] Add AVB hash footer support

Change-Id: Iaddafaa98e3e84880462a2c35b899e3fea21e161
2018-01-08 07:04:05 +00:00
Dan Pasanen
8ee5d891b0 kernel: don't build for TARGET_NO_KERNEL targets
Change-Id: I14ad45c06922c0775e0574ddbcfcdc33353af465
2018-01-04 20:42:27 +00:00
Joe Maples
da32895b61 tasks: kernel: Add support for Clang kernel builds
Add support for compiling kernels with Clang as intoduced on android-4.4

In order to compile with clang, you must set TARGET_KERNEL_CLANG_COMPILE.
If you wish to specify a specific clang version, also set TARGET_KERNEL_CLANG_VERSION,
but if that is not set, the build system will default to the latest version of clang
available in prebuilts/clang

Change-Id: I79dc1dca9758a930f2f5ba1754b5d8de114af900
Signed-off-by: Joe Maples <joe@frap129.org>
2017-12-31 01:42:06 +00:00
Ethan Chen
bf38db2a5e kernel: Handle kernel modules correctly
Place kernel module output in the correct location.
Perform depmod steps (copied from build-image-kernel-modules function in
build/make/core/Makefile).
See: https://source.android.com/devices/architecture/kernel/modular-kernels

Change-Id: I6e70012a5c1acdb276f9bee0d57631d2805f71ea
2017-12-31 01:41:57 +00:00
Tom Marshall
f15c371403 lineage: build: kernel: Rework kernel module logic
The existing kernel module logic does not detect failed kernel module
builds.  This is because the module build logic is a long shell chain
that invokes make macros which are not intended to be used in this way.
The essense of the issue is that we get a shell chain that looks like:

	cmd && cmd && var=value; cmd && var=value; cmd;

The shell breaks this into three separate commands.  The first builds
the modules.  The other two are the macro invocations.  So the result
of the command is the result of the last macro invocation, which will
always succeed even if the modules fail to build.

The issue is made worse by the existing build rule conflating the built
kernel modules and the installed kernel modules.

Fix this by reducing the built kernel module command to a single shell
command and creating a separate target INSTALLED_KERNEL_MODULES.  Any
kernel module build failure will show up properly.  The commands for
INSTALLED_KERNEL_MODULES do not invoke any macros and should avoid the
issue described above.

Finally, this also removes the fake target no-external-modules and
unifies the install logic for in-tree and out-of-tree modules.

Change-Id: I3d13056e217e1e937c8c3a345032682ffc394bca
2017-11-15 23:57:39 +00:00
Sam Mortimer
477d8fee68 vendor/lineage: Rebrand cleanup
*) Rebrand remaining text references

Change-Id: I70ffb30519d40237c8266e208449a5e27140d2b3
2017-11-14 05:32:14 +00:00
Dan Pasanen
edc1cebc2f kernel: clean up this madness
* WARNING: this intentionally breaks the build on devices who
  are not setting BOARD_KERNEL_IMAGE_NAME and are still setting
  TARGET_USES_UNCOMPRESSED_KERNEL or TARGET_KERNEL_APPEND_DTB

* The logic here is insanity and if all of this can be done
  by simply setting BOARD_KERNEL_IMAGE_NAME, why have all this
  extra cruft?

* Use cases:
  - Set a kernel image name without "-dtb" on the end, you get a kernel.
    Nothing more.
  - Set a kernel image name with "-dtb" on the end, you get an kernel
    with an appended dt.
  - Set a kernel image name without "-dtb" on the end, and set
    BOARD_KERNEL_SEPARATED_DT. You get a kernel and a separated dt.img.
  - Set a kernel image name with "-dtb" on the end, and set
    BOARD_KERNEL_SEPARATED_DT. You're crazy.

Change-Id: I5c3fc6eb727255684278ff562c0ee3faa7124b6b
2017-10-17 16:19:19 +00:00
Sam Mortimer
19ce2d3ad2 vendor/lineage: sdk rebrand: step 2: update file contents
Change-Id: Ib61b9b559c4b0e536979e5cb25fba50aa56c138d
2017-10-12 22:33:59 +00:00
Sam Mortimer
f13a6df311 vendor/lineage: sdk rebrand: step 1: update paths
Change-Id: If51b9122d7d7d0ee25fd77278a808442d461b8a0
2017-10-12 22:33:45 +00:00
André Pinela
f3a4230e9f tasks: enhancement to create LineageOS ota package
- modify for LineageOS
- add bacon target
- don't touch aosp otapackage target

Change-Id: Id243c3099b4914ed3b53efc42c0c7dac9d56dea8
Signed-off-by: André Pinela <sheffzor@gmail.com>
2017-08-25 07:57:31 -05:00
Luca Stefani
5c60e4fd24
lineage: Complete the rebrand
* TODO: Rebrand cmsdk when it's in a working state

Change-Id: I0d8d573f9e0032110ae3a0f54ebe11a877b83137
2017-08-23 17:33:22 +03:00
Dan Pasanen
91f7620c4d
vendor: change vendor to lineage
Change-Id: I2df13091f5d62b552ef434aef1a389f4fe1249e0
2017-08-23 03:26:28 +03:00
Luca Stefani
d6e2fbcf8e tasks: kernel: Kill unexisting wiki reference
Change-Id: Ib43012206ba7028072d39495bda32d82dd72bdc6
2017-08-17 18:54:35 +00:00
Michael Bestas
296008cc79
kernel: Add savedefconfig target
* Add a build target to simply regenerate the kernel
  minimal defconfig and copy it to the kernel source

Change-Id: I04be945eb6dae3042c236785328c7c9995d42e49
2017-07-12 20:56:35 +03:00
Michael Bestas
d67ef7821d
addonsu: Add Lineage version to zip name
* Avoid confusion

Change-Id: I823d77e037b0d0dc2a4b9f0466d594213c72e179
2017-04-28 23:55:39 +03:00
Gabriele M
5b33c6c1d5 Add target to make a flashable su addon
Run 'make addonsu' to make a flashable zip to install the addon and
'make addonsu-remove' for a flashable zip that removes it.

Change-Id: I5b2fe67f98f2474b923c074dc6025b47c6db2ae0
2017-04-20 04:06:38 +00:00
Christopher N. Hesse
1e7c3f00c6 kernel: Fix broken C_INCLUDE_PATH for Darwin
Commit 7fb9251dfc modified
the expansion in an illegal way.

Fix the broken env variable.

Change-Id: Ib3029fa995d6a4b0416887a2ef2e4792c9e6bb27
(cherry picked from commit 90b437e784c19fc428c24891cc96705b89b786df)
2017-04-11 23:08:32 +00:00
Rashed Abdel-Tawab
7fb9251dfc kernel: Include openssl headers and dylibs on darwin
The easiest and best way to get openssl on darwin is using homebrew,
however homebrew refuses to link openssl (and for good reason) in
order to prevent conflicts with Apple's homegrown version. Include
the openssl headers and dylibs from the dir that homebrew installs
openssl to let 4.4 kernels compile.

Change-Id: I06b66768fbdd4855fd57b88100d646ed6e311a59
2017-04-09 00:44:05 -05:00
Zhao Wei Liew
311fd6f991 cm: build: tasks: Remove BUILD_TINY_ANDROID check
This flag has been obsolete for a while now.

Change-Id: Ib78a1b141ddd757d2546b2eff2158e6e0cc0d673
2017-03-05 19:22:52 +08:00
Dan Pasanen
efe4823542 tasks: dt: add flag to optionally compress dt with lz4
* Gotta save that space somehow. This is in the continuing
  effort to remove custom mkbootimg.mk files in device trees

Change-Id: Ie8b3cedf6e37d1d11c2383dd3590f9908ad7818c
2017-02-09 18:59:12 +00:00
Rashed Abdel-Tawab
b48c27f04f
build: Append -dtb to kernel image name if TARGET_KERNEL_APPEND_DTB is set
Currently devices that have TARGET_KERNEL_APPEND_DTB set also have to set
BOARD_KERNEL_IMAGE_NAME to Image.gz-dtb (or zImage-dtb on arm32) in order
to properly build the image with an appended DT. Automatially append -dtb
if TARGET_KERNEL_APPEND_DTB is set so BOARD_KERNEL_IMAGE_NAME does not need
to be set.

Change-Id: I5464c67092a7b9f86669902e5c0e4a47836f7cbd
2017-01-19 15:57:13 -05:00
Zhao Wei Liew
e407ec7035 cm: build: kernel: Remove obsolete checks
* BOARD_USES_UBOOT is unused.
 * Same goes for BOARD_USES_UNCOMPRESSED_BOOT. Furthermore,
   it is superseded by TARGET_USES_UNCOMPRESSED_KERNEL.

Change-Id: I9f0e2848fcd0cd212bccacf14df55ad03f821051
2017-01-14 19:48:07 +08:00
Ziyan
54648c2a3b build: kernel: build arm kernel modules with -fno-pic
With androidkernel (androideabi) toolchains, -fpic is enabled by default.
At least on my 3.4 arm kernel, this causes an issue with kernel modules:
"Unknown symbol _GLOBAL_OFFSET_TABLE_".

On traditional armeabi toolchains, -fpic is not enabled, resulting in working
kernel modules; let's follow that here.

Change-Id: I3058b5213b34bdde9bb9d744563c7d55cd42d2a5
2017-01-12 18:28:12 +00:00
Brandon McAnsh
66792510a9 http_prebuilt: Implement archive of artifacts
* checksum will be downloaded and asserted to prevent a
    redownload every clean
* Archives will exist (invisibly) at vendor/cm/prebuilt/archive

Change-Id: I637e86cacd146d665044a119885900dc4660e22b
Signed-off-by: Brandon McAnsh <brandon.mcansh@gmail.com>
2017-01-09 13:42:29 +00:00
Dan Pasanen
0344771b53 vendor: we are now LineageOS
* Change necessary bits to support our project move

Change-Id: I085470d448a243cc9d60b4ce920dee52086f64cd
2016-12-28 19:44:28 +00:00
Luca Stefani
c66825b158 build: kernel: Remove duplicated targets
We call them already in TARGET_KERNEL_BINARIES

Change-Id: I1a9cf89d59416fdb6c9c570d17fb490440d44159
2016-11-24 15:54:11 +01:00
Zhao Wei Liew
9689bb9dba build: kernel: Set prefix based on KERNEL_ARCH
KERNEL_ARCH specifies the kernel architecture, not TARGET_ARCH.

Change-Id: I97407caa15cacf53489e8ebb31f5c059991a9493
2016-11-10 15:55:42 -08:00
Sam Mortimer
b0cecb7335 Always create a kernel defconfig build artifact
It's just easier having it always built for you
(and it really takes no time).

Change-Id: If183cef50b1de0bf228e27bab77607df71350345
2016-11-05 08:25:45 -07:00
Michael Bestas
1d55ece94a
kernel: Default to androidkernel toochains
* androidkernel is a set of toolchain symlinks for kernel builds that
point to the regular toolchain binaries, except with ld pointing to bfd
instead of gold.

Change-Id: Id1e2d3b1c50db581bff13cfa00b5b35d5badb8ed
2016-09-28 20:16:25 +03:00
Steve Kondik
6a3782824f cm: Add missing bits from system-ccache commit
Change-Id: I5936a9a3f3ded09aa7d3ec4f1061cbccf324c759
2016-09-25 22:37:01 -07:00
Michael Bestas
3952f6cb0d Import CM build additions
Change-Id: Id1eb902129754e61dfcc2b5d95c3a75172ff0c5e
2016-09-25 22:32:37 -07:00
Steve Kondik
a3765ca9ef hax: Disable system-api generation
* Do we even need this? CMSDK doesn't annotate anything as SystemApi,
   and it fails on N.

Change-Id: I73e1021079e05ab56f96008446f12b086d8b41c6
2016-09-04 04:40:57 -07:00
Luca Stefani
9b58af504a build: Kill colors
* Also exclude apickeck if cm sdk is disabled

Change-Id: I48fbb3b2c3130d2a5d49ca726883babea4e5a455
2016-08-26 23:49:44 -07:00
Adnan Begovic
a194731dd4 cm: "Released" means current.
Since mainline devices will always identify as a latest
  release api level (due to userbase volume), make sure
  we check against the current api vs api -1.

Change-Id: I9e9b41a1af5d3a93f58b2e0e0545b979d1cef978
2016-08-17 14:15:14 -07:00
Luis Vidal
1117dae753 cmsdk-api-coverage: Don't prepend ANDROID_BUILD_TOP to file path
$@ already contains the full path of the output, so no need
to prepend ANDROID_BUILD_TOP to the path

Change-Id: Ieeeb9fa16352e80b878cddb89b1e7c04b82ab43c
2016-06-13 17:29:48 -07:00
Adnan Begovic
c385e3691b cm: Use cmsdk-api-coverage executable for coverage.
Change-Id: I8610f402d7c9a55213a520f317d7c94074c96df9
2016-06-13 14:51:01 -07:00
Adnan Begovic
3ab3d0e81c cm: Include CMSettingsProvider in test coverage report.
TICKET: CYNGNOS-3016
Change-Id: Ia02464614b02b98a535f963aae5a1b13281abaa7
2016-06-07 10:49:16 -07:00
Adnan Begovic
64cb3b6fe3 cm: Change output html name for cmsdk test coverage.
Change-Id: Idbea6064b89051b5db99aaadeec71502b65724bf
2016-06-07 10:48:45 -07:00
Adnan Begovic
de0b2d324f cm: Actually have checkapi-cm match against prior release.
Change-Id: I10b88f962d9410687640a40ce7f564e0bd04c2c6
TICKET: CYNGNOS-2303
2016-04-01 16:40:20 -07:00
Adnan Begovic
6a04a23a52 cm: Always verify against current CMSDK version.
Since cmsdk prebuilts lives in a single master branch,
  previous branches that apicheck will fail since they'll
  verify against an api that exists in future releases.

Change-Id: I56594d075b89cb1a3d7a606cc9c1699dfffd94cb
TICKET: CYNGNOS-2220
2016-03-10 12:25:26 -08:00
Adnan Begovic
651dd50e59 cm: Create cmsdk coverage task.
Add ability to `make cmsdk-test-coverage`
  to generate an html page which denotes how
  much the testing package from vendor/cmsdk
  covers public interfaces.

Change-Id: I76556df1822934a6b7e86ebf2ff42e302acff46d
TICKET: CYNGNOS-2189
2016-03-04 15:24:11 -08:00
Adnan Begovic
97ac30ec9c cm: Set explicit dependencies on stubs for checkapi-cm.
Change-Id: I2c8b8425262a6812f1061326c55ffc7418967444
TICKET: CYNGNOS-1950
2016-02-10 15:22:17 -08:00