Snap for 11914274 from 19ce29359630d351cd43a2f3dc7ef73ed34353b8 to 24Q3-release
Change-Id: I927a0051b939b1ed59fcdf6d464fbd69c1a2b949
diff --git a/fs_mgr/fs_mgr.cpp b/fs_mgr/fs_mgr.cpp
index 835a3e7..7f41cea 100644
--- a/fs_mgr/fs_mgr.cpp
+++ b/fs_mgr/fs_mgr.cpp
@@ -1656,6 +1656,19 @@
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);
diff --git a/init/Android.bp b/init/Android.bp
index 6160a71..dd1f9aa 100644
--- a/init/Android.bp
+++ b/init/Android.bp
@@ -96,6 +96,7 @@
config_namespace: "ANDROID",
bool_variables: [
"PRODUCT_INSTALL_DEBUG_POLICY_TO_SYSTEM_EXT",
+ "release_write_appcompat_override_system_properties",
],
properties: [
"cflags",
@@ -159,6 +160,9 @@
"-DINSTALL_DEBUG_POLICY_TO_SYSTEM_EXT=1",
],
},
+ release_write_appcompat_override_system_properties: {
+ cflags: ["-DWRITE_APPCOMPAT_OVERRIDE_SYSTEM_PROPERTIES"],
+ }
},
static_libs: [
"libavb",
diff --git a/init/property_service.cpp b/init/property_service.cpp
index cd5933d..0d6eb15 100644
--- a/init/property_service.cpp
+++ b/init/property_service.cpp
@@ -1323,12 +1323,14 @@
}
selinux_android_restorecon(PROP_TREE_FILE, 0);
+#ifdef WRITE_APPCOMPAT_OVERRIDE_SYSTEM_PROPERTIES
mkdir(APPCOMPAT_OVERRIDE_PROP_FOLDERNAME, S_IRWXU | S_IXGRP | S_IXOTH);
if (!WriteStringToFile(serialized_contexts, APPCOMPAT_OVERRIDE_PROP_TREE_FILE, 0444, 0, 0,
false)) {
PLOG(ERROR) << "Unable to write appcompat override property infos to file";
}
selinux_android_restorecon(APPCOMPAT_OVERRIDE_PROP_TREE_FILE, 0);
+#endif
}
static void ExportKernelBootProps() {