From 63a89d9f04abc73ef536d40130702afb3227849d Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Fri, 8 Apr 2022 02:38:20 -0700 Subject: [PATCH] Fix init dmesg logs --- native/jni/init/twostage.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/native/jni/init/twostage.cpp b/native/jni/init/twostage.cpp index 39903fd5d..5350156b7 100644 --- a/native/jni/init/twostage.cpp +++ b/native/jni/init/twostage.cpp @@ -68,6 +68,9 @@ bool SecondStageInit::prepare() { umount2("/proc/self/exe", MNT_DETACH); umount2("/data", MNT_DETACH); + // Make sure init dmesg logs won't get messed up + argv[0] = (char *) INIT_PATH; + // Some weird devices like meizu, uses 2SI but still have legacy rootfs // Check if root and system are on the same filesystem struct stat root{}, system{};