Implement kexec
To support ramdump of VMs, implement a kexec binary and add it to
Microdroid. The binary will be used to preload the kernel and the init
ramdisk that the system will boot into when a kernel panic occurs.
The binary is very minimal. It has much less functionalities than the
upstream kexec-tools. It has a different cmdline interface, and is just
a thin wrapper around the kexec_file_load syscall. It supports loading
the kernel and the ramdisk only for the exec-on-crash use case.
Bug: 237380224
Test: run kexec on Microdroid
Change-Id: I75610d4f55c97a79a7200ecf9e8aa7fc7b12c010
diff --git a/microdroid/Android.bp b/microdroid/Android.bp
index ba3da08..8bac103 100644
--- a/microdroid/Android.bp
+++ b/microdroid/Android.bp
@@ -90,6 +90,8 @@
"microdroid_property_contexts",
"microdroid_service_contexts",
+ "microdroid_kexec",
+
// TODO(b/195425111) these should be added automatically
"libcrypto", // used by many (init_second_stage, microdroid_manager, toybox, etc)
"liblzma", // used by init_second_stage