From b445a012634ce4b51677b153157dd80f32ef028e Mon Sep 17 00:00:00 2001 From: Yo Chiang Date: Fri, 6 Nov 2020 16:38:33 +0800 Subject: [PATCH] Use default dsu slot name when host is Android Q DSU slotting support is added in Android R, so android::gsi::GetActiveDsu() is guaranteed to fail if DSU guest system is S and host is Q. In that case, just assume the the DSU slot to be "dsu". Bug: 172541102 Bug: 168571434 Test: Boot GSI S on Q pixel with DSU Change-Id: I96e191907ce2fedf8c22b7887e930a7c455eb593 --- fs_mgr/fs_mgr_fstab.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fs_mgr/fs_mgr_fstab.cpp b/fs_mgr/fs_mgr_fstab.cpp index 793a725b1..4b7946657 100644 --- a/fs_mgr/fs_mgr_fstab.cpp +++ b/fs_mgr/fs_mgr_fstab.cpp @@ -694,8 +694,11 @@ bool ReadFstabFromFile(const std::string& path, Fstab* fstab) { if (!is_proc_mounts && !access(android::gsi::kGsiBootedIndicatorFile, F_OK)) { std::string dsu_slot; if (!android::gsi::GetActiveDsu(&dsu_slot)) { - PERROR << __FUNCTION__ << "(): failed to get active dsu slot"; - return false; + // This is expected to fail if host is android Q, since Q doesn't + // support DSU slotting. + // In that case, just use the default slot name "dsu". + PWARNING << __FUNCTION__ << "(): failed to get active dsu slot"; + dsu_slot = "dsu"; } std::string lp_names; ReadFileToString(gsi::kGsiLpNamesFile, &lp_names);