summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunichi Uekawa <uekawa@google.com>2020-09-16 18:12:35 +0900
committeralk3pInjection <webmaster@raspii.tech>2021-09-27 21:17:05 +0800
commit8118fddc10eef88813b20f39a6a4826f324af1c5 (patch)
tree243022db3e269a83bdcbca860c97d48c269a606d
parentf60c1c33d6a91f2fa7bb6e52a4293eab8aeddc72 (diff)
apexd: Allow mounting on squashfs
O_DIRECT does not work on squashfs file systems, and will return EINVAL. Try without O_DIRECT. On boards with `BOARD_SYSTEMIMAGE_FILE_SYSTEM_TYPE := squashfs` apexd will fail to loop mount. Unfortunately O_DIRECT is not possible because image is compressed on disk and we do need the buffering. Bug: 167309455 Bug: 168746790 Test: tast run kukui-arc-r arc.Boot.vm Change-Id: I9da1af535cb18cebed751ecab0e250780e2df377
-rw-r--r--apexd/apexd_loop.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/apexd/apexd_loop.cpp b/apexd/apexd_loop.cpp
index bfff51b..62e3d56 100644
--- a/apexd/apexd_loop.cpp
+++ b/apexd/apexd_loop.cpp
@@ -173,10 +173,11 @@ Result<void> configureLoopDevice(const int device_fd, const std::string& target,
if (target_fd.get() == -1) {
struct statfs stbuf;
int saved_errno = errno;
- // let's give another try with buffered I/O for EROFS
+ // let's give another try with buffered I/O for EROFS and squashfs
if (statfs(target.c_str(), &stbuf) != 0 ||
- stbuf.f_type != EROFS_SUPER_MAGIC_V1) {
- return Error(saved_errno) << "Failed to open " << target;
+ (stbuf.f_type != EROFS_SUPER_MAGIC_V1 &&
+ stbuf.f_type != SQUASHFS_MAGIC)) {
+ return Error(saved_errno) << "Failed to open " << target;
}
LOG(WARNING) << "Fallback to buffered I/O for " << target;
use_buffered_IO = true;