Split up linux_kernel build folder to separate repo changes
This separates the kernel build steps (that happen in our main repo)
and the things we inject into @linux_kernel.
Test Plan: Covered by CI
X-Origin-Diff: phab/D249
GitOrigin-RevId: 98982d005ba582f9f08783915ee0603ff8634f55
diff --git a/WORKSPACE b/WORKSPACE
index 7abd0c6..9401162 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -94,22 +94,16 @@
linux_kernel_version = "4.19.72"
-# If we don't do this we're double-building Linux, once for the toolchain and once for the target
-make_gen_init_cpio_available = """
-load("@rules_cc//cc:defs.bzl", "cc_binary")
-cc_binary(name = "gen_init_cpio", srcs = ["usr/gen_init_cpio.c"], visibility = ["//visibility:public"])
-"""
-
http_archive(
name = "linux_kernel",
- build_file_content = all_content + "\n" + make_gen_init_cpio_available,
+ build_file = "@//core/build/linux_kernel_repo:BUILD",
patch_args = ["-p1"],
patches = [
# Fix is in mainline, but upstream hasn't backported it to 4.19.
# Will go away when we switch to 5.4 LTS
- "@//core/build/linux_kernel:kbuild-add--fcf-protection-none-to-retpoline-flags.patch",
+ "@//core/build/linux_kernel_repo:0002-kbuild-add--fcf-protection-none-to-retpoline-flags.patch",
# Enable built-in cmdline for efistub
- "@//core/build/linux_kernel:0001-x86-Allow-built-in-command-line-to-work-in-early-ker.patch",
+ "@//core/build/linux_kernel_repo:0001-x86-Allow-built-in-command-line-to-work-in-early-ker.patch",
],
sha256 = "f9fcb6b3bd29115ac55fc154e300c3dce2044502732f6842ad6c25e6f9f51f6d",
strip_prefix = "linux-" + linux_kernel_version,