From 915f32d892be387e1419883b7ea080340b83595a Mon Sep 17 00:00:00 2001 From: Kelvin Zhang Date: Thu, 30 May 2024 19:11:07 +0000 Subject: [PATCH] Revert^2 "Set ro.fstype.data when /data is mounted" 062eb59a83fe62fd5701958e7fe433b8768d66d6 Change-Id: I20c4d4c17e4a314eb8754ed9c03db3dd8e3a5d0f --- fs_mgr/fs_mgr.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/fs_mgr/fs_mgr.cpp b/fs_mgr/fs_mgr.cpp index 835a3e7f6..7f41cea83 100644 --- a/fs_mgr/fs_mgr.cpp +++ b/fs_mgr/fs_mgr.cpp @@ -1656,6 +1656,19 @@ MountAllResult fs_mgr_mount_all(Fstab* fstab, int mount_mode) { continue; } } + if (userdata_mounted) { + Fstab mounted_fstab; + if (!ReadFstabFromFile("/proc/mounts", &mounted_fstab)) { + LOG(ERROR) << "Could't load fstab from /proc/mounts , unable to set ro.fstype.data . " + "init.rc actions depending on this prop would not run, boot might fail."; + } else { + for (const auto& entry : mounted_fstab) { + if (entry.mount_point == "/data") { + android::base::SetProperty("ro.fstype.data", entry.fs_type); + } + } + } + } set_type_property(encryptable);