Implement crashdump
crashdump is a small binary which copies the ramdump from /proc/vmcore
to /dev/hvc3 which will be backed by a file outside of the VM.
crashdump is included in a init ramdisk image, and will be executed as
the init process when a kernel panic occurs.
Bug: 237381237
Test: N/A (follow-up CL needed)
Change-Id: Iecac0b437a2f512348ee28abe8b2bf6b23640029
diff --git a/microdroid/kdump/Android.bp b/microdroid/kdump/Android.bp
index 1a8c9cc..ffbfcce 100644
--- a/microdroid/kdump/Android.bp
+++ b/microdroid/kdump/Android.bp
@@ -8,3 +8,21 @@
srcs: ["kexec.c"],
installable: false,
}
+
+cc_binary {
+ name: "microdroid_crashdump",
+ stem: "crashdump",
+ srcs: ["crashdump.c"],
+ static_executable: true,
+ installable: false,
+}
+
+android_filesystem {
+ name: "microdroid_crashdump_initrd",
+ deps: ["microdroid_crashdump"],
+ dirs: [
+ "dev",
+ "proc",
+ ],
+ type: "cpio",
+}