Create host-side tool to attach bootconfig to initrd image
We are removing ABL from VM bootflow & using kernel's initrd
functionality. Since the boot configuration file is loaded with initrd
by default, it will be added to the end of the initrd, in the following
way:
[initrd][bootconfig][padding][size(le32)][checksum(le32)][#BOOTCONFIG\n]
The tool is written in Rust so that we can (in future) have the option
to dynamically attach the correct bootconfig.
Test: builds
Bug: 240235424
Change-Id: Idfca6528a16bc92001f5791b4683a0be2714cce8
diff --git a/microdroid/initrd/Android.bp b/microdroid/initrd/Android.bp
new file mode 100644
index 0000000..147c963
--- /dev/null
+++ b/microdroid/initrd/Android.bp
@@ -0,0 +1,13 @@
+package {
+ default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
+rust_binary_host {
+ name: "initrd_bootconfig",
+ srcs: ["src/main.rs"],
+ rustlibs: [
+ "libanyhow",
+ "libstructopt",
+ ],
+ prefer_rlib: true,
+}