diff options
author | Mark Salyzyn <salyzyn@google.com> | 2019-04-11 12:58:19 -0700 |
---|---|---|
committer | Mark Salyzyn <salyzyn@google.com> | 2019-05-02 19:41:53 +0000 |
commit | 3379be2a77055e84f4aed7cbb6085dbf776d4a24 (patch) | |
tree | 75dff465c7dce99fc8d56682d6556b9d5a034100 /fs_mgr | |
parent | ff9ac9e2869b105de3a972d5cff1becc9443fcde (diff) | |
download | system_core-3379be2a77055e84f4aed7cbb6085dbf776d4a24.tar.gz system_core-3379be2a77055e84f4aed7cbb6085dbf776d4a24.tar.bz2 system_core-3379be2a77055e84f4aed7cbb6085dbf776d4a24.zip |
fs_mgr: overlay check shared blocks for / if /system is not
For bringup devices that do not have right-sized partition, and if
/system is now root, check / to be sure.
Consider unshare blocks for ext4 as dead code, provide a strong
message to caller to provide all the dependencies to overlayfs.
Test: adb-remount-test.sh
Bug: 130327601
Change-Id: Iffa7c5f24d8f409e71f89fe9ece274d8c476f6fc
Merged-In: Iffa7c5f24d8f409e71f89fe9ece274d8c476f6fc
Diffstat (limited to 'fs_mgr')
-rw-r--r-- | fs_mgr/fs_mgr_overlayfs.cpp | 3 | ||||
-rw-r--r-- | fs_mgr/fs_mgr_remount.cpp | 14 |
2 files changed, 8 insertions, 9 deletions
diff --git a/fs_mgr/fs_mgr_overlayfs.cpp b/fs_mgr/fs_mgr_overlayfs.cpp index 730d3db68..012abd4dc 100644 --- a/fs_mgr/fs_mgr_overlayfs.cpp +++ b/fs_mgr/fs_mgr_overlayfs.cpp @@ -159,6 +159,9 @@ bool fs_mgr_overlayfs_enabled(FstabEntry* entry) { auto save_errno = errno; errno = 0; auto has_shared_blocks = fs_mgr_has_shared_blocks(entry->mount_point, entry->blk_device); + if (!has_shared_blocks && (entry->mount_point == "/system")) { + has_shared_blocks = fs_mgr_has_shared_blocks("/", entry->blk_device); + } // special case for first stage init for system as root (taimen) if (!has_shared_blocks && (errno == ENOENT) && (entry->blk_device == "/dev/root")) { has_shared_blocks = true; diff --git a/fs_mgr/fs_mgr_remount.cpp b/fs_mgr/fs_mgr_remount.cpp index 093d44d41..cbe2008a0 100644 --- a/fs_mgr/fs_mgr_remount.cpp +++ b/fs_mgr/fs_mgr_remount.cpp @@ -371,17 +371,13 @@ int main(int argc, char* argv[]) { continue; } } - PLOG(WARNING) << "failed to remount partition dev:" << blk_device << " mnt:" << mount_point; - // If errno = EROFS at this point, we are dealing with r/o + PLOG(ERROR) << "failed to remount partition dev:" << blk_device << " mnt:" << mount_point; + // If errno is EROFS at this point, we are dealing with r/o // filesystem types like squashfs, erofs or ext4 dedupe. We will // consider such a device that does not have CONFIG_OVERLAY_FS - // in the kernel as a misconfigured; except for ext4 dedupe. - if ((errno == EROFS) && can_reboot) { - const std::vector<std::string> msg = {"--fsck_unshare_blocks"}; - std::string err; - if (write_bootloader_message(msg, &err)) reboot(true); - LOG(ERROR) << "Failed to set bootloader message: " << err; - errno = EROFS; + // in the kernel as a misconfigured. + if (errno == EROFS) { + LOG(ERROR) << "Consider providing all the dependencies to enable overlayfs"; } retval = REMOUNT_FAILED; } |