Disable kmsg when microdroid isn't fully debuggable
The default behaviour is to rate limit logs from user space to kmsg so
override that to disable the logging instead. This prevents logs from
the microdroid system components from showing in the kernel logs while
the kernel log is still output on the uart.
Make it so microdroid_managed doesn't crash if it can't use /dev/kmsg.
Bug: 219743539
Test: MicrodroidTests
Change-Id: I68c8335176b088f2a65b6effa77d1cfb9adf1939
diff --git a/microdroid/bootconfig.app_debuggable b/microdroid/bootconfig.app_debuggable
index 98d326a..5257b6e 100644
--- a/microdroid/bootconfig.app_debuggable
+++ b/microdroid/bootconfig.app_debuggable
@@ -4,7 +4,9 @@
androidboot.microdroid.debuggable=0
# Console output is not redirect to the host-side.
-kernel.console = null
+# TODO(b/219743539) This doesn't successfully disable the console
+kernel.printk.devkmsg=off
+kernel.console=null
# ADB is supported but rooting is prohibited.
androidboot.adb.enabled=1
diff --git a/microdroid/bootconfig.normal b/microdroid/bootconfig.normal
index 9cfb55a..4378dbc 100644
--- a/microdroid/bootconfig.normal
+++ b/microdroid/bootconfig.normal
@@ -2,7 +2,9 @@
androidboot.microdroid.debuggable=0
# Console output is not redirect to the host-side.
-kernel.console = null
+# TODO(b/219743539) This doesn't successfully disable the console
+kernel.printk.devkmsg=off
+kernel.console=null
# ADB is not enabled.
androidboot.adb.enabled=0
diff --git a/microdroid_manager/src/main.rs b/microdroid_manager/src/main.rs
index 005baf6..1b3aa7f 100644
--- a/microdroid_manager/src/main.rs
+++ b/microdroid_manager/src/main.rs
@@ -121,7 +121,7 @@
}
fn try_main() -> Result<()> {
- kernlog::init()?;
+ let _ = kernlog::init();
info!("started.");
let service = get_vms_rpc_binder().context("cannot connect to VirtualMachineService")?;