From 0fbc1d7e3164ddf06899cf01a4538176bb4a9d90 Mon Sep 17 00:00:00 2001 From: Inseob Kim Date: Wed, 9 Nov 2022 12:50:14 +0900 Subject: [PATCH] Don't unmount APEXes in microdroid In microdroid, APEXes are passed as block devices from host, and then mounted directly, without using /data. Unmounting APEXes on reboot is for clean unmount of /data, so it's not needed in microdroid. This skips unmounting in microdroid to remove unnecessary SELinux denials. Bug: 256793087 Test: run microdroid and reboot, see no denials happen Change-Id: Iaf737876f5ab5de5e8f76ed8bb0963cc25d73a80 --- init/reboot.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/init/reboot.cpp b/init/reboot.cpp index 4c27a5608..1f4186dab 100644 --- a/init/reboot.cpp +++ b/init/reboot.cpp @@ -567,6 +567,11 @@ int StopServicesAndLogViolations(const std::set& services, } static Result UnmountAllApexes() { + // don't need to unmount because apexd doesn't use /data in Microdroid + if (IsMicrodroid()) { + return {}; + } + const char* args[] = {"/system/bin/apexd", "--unmount-all"}; int status; if (logwrap_fork_execvp(arraysize(args), args, &status, false, LOG_KLOG, true, nullptr) != 0) {