Merge "Skip StartConsole test on user builds."
diff --git a/fs_mgr/libdm/dm.cpp b/fs_mgr/libdm/dm.cpp
index 0624fe0..deffae1 100644
--- a/fs_mgr/libdm/dm.cpp
+++ b/fs_mgr/libdm/dm.cpp
@@ -20,6 +20,7 @@
#include <sys/ioctl.h>
#include <sys/sysmacros.h>
#include <sys/types.h>
+#include <sys/utsname.h>
#include <chrono>
#include <functional>
@@ -711,5 +712,28 @@
return dm_block_devices;
}
+bool DeviceMapper::CreatePlaceholderDevice(const std::string& name) {
+ if (!CreateEmptyDevice(name)) {
+ return false;
+ }
+
+ struct utsname uts;
+ unsigned int major, minor;
+ if (uname(&uts) != 0 || sscanf(uts.release, "%u.%u", &major, &minor) != 2) {
+ LOG(ERROR) << "Could not parse the kernel version from uname";
+ return true;
+ }
+
+ // On Linux 5.15+, there is no uevent until DM_TABLE_LOAD.
+ if (major > 5 || (major == 5 && minor >= 15)) {
+ DmTable table;
+ table.Emplace<DmTargetError>(0, 1);
+ if (!LoadTable(name, table)) {
+ return false;
+ }
+ }
+ return true;
+}
+
} // namespace dm
} // namespace android
diff --git a/fs_mgr/libdm/include/libdm/dm.h b/fs_mgr/libdm/include/libdm/dm.h
index f17ae13..dbef8f9 100644
--- a/fs_mgr/libdm/include/libdm/dm.h
+++ b/fs_mgr/libdm/include/libdm/dm.h
@@ -292,6 +292,12 @@
// Returns mapping <partition-name, /dev/block/dm-x>
std::map<std::string, std::string> FindDmPartitions();
+ // Create a placeholder device. This is useful for ensuring that a uevent is in the pipeline,
+ // to reduce the amount of time a future WaitForDevice will block. On kernels < 5.15, this
+ // simply calls CreateEmptyDevice. On 5.15 and higher, it also loads (but does not activate)
+ // a placeholder table containing dm-error.
+ bool CreatePlaceholderDevice(const std::string& name);
+
private:
// Maximum possible device mapper targets registered in the kernel.
// This is only used to read the list of targets from kernel so we allocate
diff --git a/fs_mgr/tests/vts_fs_test.cpp b/fs_mgr/tests/vts_fs_test.cpp
index b8b34e2..bb2ceb9 100644
--- a/fs_mgr/tests/vts_fs_test.cpp
+++ b/fs_mgr/tests/vts_fs_test.cpp
@@ -66,6 +66,14 @@
int vsr_level = GetVsrLevel();
+ std::vector<std::string> must_be_f2fs;
+ if (vsr_level >= __ANDROID_API_T__) {
+ must_be_f2fs.emplace_back("/data");
+ }
+ if (vsr_level >= __ANDROID_API_U__) {
+ must_be_f2fs.emplace_back("/metadata");
+ }
+
for (const auto& entry : fstab) {
std::string parent_bdev = entry.blk_device;
while (true) {
@@ -99,15 +107,15 @@
}
if (entry.flags & MS_RDONLY) {
- std::vector<std::string> allowed = {"erofs", "ext4"};
- if (vsr_level == __ANDROID_API_T__) {
- allowed.emplace_back("f2fs");
- }
+ std::vector<std::string> allowed = {"erofs", "ext4", "f2fs"};
EXPECT_NE(std::find(allowed.begin(), allowed.end(), entry.fs_type), allowed.end())
<< entry.mount_point;
} else {
- EXPECT_NE(entry.fs_type, "ext4") << entry.mount_point;
+ if (std::find(must_be_f2fs.begin(), must_be_f2fs.end(), entry.mount_point) !=
+ must_be_f2fs.end()) {
+ EXPECT_EQ(entry.fs_type, "f2fs") << entry.mount_point;
+ }
}
}
}
diff --git a/init/README.md b/init/README.md
index f48fa6b..957eb9e 100644
--- a/init/README.md
+++ b/init/README.md
@@ -195,8 +195,10 @@
capability without the "CAP\_" prefix, like "NET\_ADMIN" or "SETPCAP". See
http://man7.org/linux/man-pages/man7/capabilities.7.html for a list of Linux
capabilities.
- If no capabilities are provided, then all capabilities are removed from this service, even if it
- runs as root.
+ If no capabilities are provided, then behaviour depends on the user the service runs under:
+ * if it's root, then the service will run with all the capabitilies (note: whether the
+ service can actually use them is controlled by selinux);
+ * otherwise all capabilities will be dropped.
`class <name> [ <name>\* ]`
> Specify class names for the service. All services in a
@@ -410,7 +412,7 @@
using this new mechanism, processes can use the user option to
select their desired uid without ever running as root.
As of Android O, processes can also request capabilities directly in their .rc
- files. See the "capabilities" option below.
+ files. See the "capabilities" option above.
`writepid <file> [ <file>\* ]`
> Write the child's pid to the given files when it forks. Meant for
diff --git a/libprocessgroup/OWNERS b/libprocessgroup/OWNERS
index 8ebb8cc..d5aa721 100644
--- a/libprocessgroup/OWNERS
+++ b/libprocessgroup/OWNERS
@@ -1,2 +1,4 @@
-ccross@google.com
+# Bug component: 1293033
surenb@google.com
+tjmercier@google.com
+carlosgalo@google.com