Add microdroid_16k kernel

Since microdroid_16k kernel uses the same initrd as regulard microdroid
kernel, I've added a small hack in payload.rs. If we want, we can add a
more generic solution in a follow-up patch.

Additionally, since 16k kernels are only supported for 16k kernel builds
(trying to build x86_64 16k kernel on android15-6.6 branch results in
"ERROR: 16k pages not supported on x86_64."), the microdroid_16k related
soong modules are only enabled for products that set
TARGET_BOOTS_16K := true. This is needed to make checkbuild on x86_64
products happy.

Test: adb shell /apex/com.android.virt/bin info
Test: atest virtualizationmanager_device_test
Change-Id: Id74da6bb73093cc5ee60c58d99a8c218a31468c9
diff --git a/build/microdroid/Android.bp b/build/microdroid/Android.bp
index abb97da..6fa15fe 100644
--- a/build/microdroid/Android.bp
+++ b/build/microdroid/Android.bp
@@ -377,6 +377,11 @@
 }
 
 prebuilt_etc {
+    name: "microdroid_16k.json",
+    src: "microdroid_16k.json",
+}
+
+prebuilt_etc {
     name: "microdroid_manifest",
     src: "microdroid_manifest.xml",
     filename: "manifest.xml",
@@ -507,6 +512,29 @@
     ],
 }
 
+avb_add_hash_footer {
+    name: "microdroid_kernel_16k_signed",
+    defaults: ["microdroid_kernel_signed_defaults"],
+    filename: "microdroid_kernel_16k",
+    arch: {
+        arm64: {
+            src: ":microdroid_kernel_16k_prebuilt-arm64",
+        },
+    },
+    include_descriptors_from_images: [
+        ":microdroid_initrd_normal_hashdesc",
+        ":microdroid_initrd_debug_hashdesc",
+    ],
+    // Currently x86_64 arch doesn't support building 16k kernels, meaning that
+    // we don't have microdroid_16k kernel prebuilts in x86_64.
+    // We need to disable this module on x86_64 products, otherwise checkbuild
+    // will complain.
+    enabled: select(soong_config_variable("ANDROID", "target_boots_16k"), {
+        true: true,
+        default: false,
+    }),
+}
+
 prebuilt_etc {
     name: "microdroid_kernel",
     src: ":empty_file",
@@ -521,6 +549,23 @@
     },
 }
 
+prebuilt_etc {
+    name: "microdroid_kernel_16k",
+    src: ":empty_file",
+    relative_install_path: "fs",
+    arch: {
+        arm64: {
+            src: ":microdroid_kernel_16k_signed",
+        },
+    },
+    // The microdroid_kernel_16k_signed is only enabled for products that set
+    // TARGET_BOOTS_16K, so we also need to conditionally enable this module.
+    enabled: select(soong_config_variable("ANDROID", "target_boots_16k"), {
+        true: true,
+        default: false,
+    }),
+}
+
 ///////////////////////////////////////
 // GKI-android15-6.6
 ///////////////////////////////////////