third_party/efistub: init

Adds the EFI stub from systemd-boot, built using our new EFI toolchain.
This allows us to bundle kernels, command lines and other data into
single EFI payloads and also sign them later.

A rules to build these unified EFI payloads is coming later.

Change-Id: I789e893ff88541f3dc9e7400ccd2565ae414e554
Reviewed-on: https://review.monogon.dev/c/monogon/+/335
Reviewed-by: Sergiusz Bazanski <serge@monogon.tech>
diff --git a/third_party/efistub/efistub.bzl b/third_party/efistub/efistub.bzl
new file mode 100644
index 0000000..4eec74d
--- /dev/null
+++ b/third_party/efistub/efistub.bzl
@@ -0,0 +1,20 @@
+cc_binary(
+    name = "efistub",
+    srcs = [("src/boot/efi/%s" % v) for v in [
+        "assert.c",
+        "cpio.c",
+        "disk.c",
+        "graphics.c",
+        "linux.c",
+        "measure.c",
+        "pe.c",
+        "secure-boot.c",
+        "splash.c",
+        "stub.c",
+        "util.c",
+    ]] + glob(["src/boot/efi/*.h", "src/fundamental/*.c", "src/fundamental/*.h"]),
+    includes = ["src/fundamental"],
+    copts = ["-std=gnu99", "-DSD_BOOT", "-DGIT_VERSION=\\\"0.0.0-mngn\\\""],
+    deps = ["@gnuefi//:gnuefi"],
+    visibility = ["//visibility:public"],
+)