summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 34168f3)
raw | patch | inline | side by side (parent: 34168f3)
author | Mark Salyzyn <salyzyn@google.com> | |
Wed, 10 Oct 2018 21:15:38 +0000 (14:15 -0700) | ||
committer | Mark Salyzyn <salyzyn@google.com> | |
Wed, 10 Oct 2018 22:40:08 +0000 (15:40 -0700) |
If default_fstab does not have "/", then it should have "/system",
there is no need to check the ro.build.system_root_image property.
Test: compile
Bug: 109821005
Change-Id: If6419b08f79b30800d13fbb9b320e48f435243f3
there is no need to check the ro.build.system_root_image property.
Test: compile
Bug: 109821005
Change-Id: If6419b08f79b30800d13fbb9b320e48f435243f3
VintfObjectRecovery.cpp | patch | blob | history |
index a7bc17494dda1a44dcd122943bce269b77a0001a..33039800a2351218d97ea3001655b4baca304b78 100644 (file)
--- a/VintfObjectRecovery.cpp
+++ b/VintfObjectRecovery.cpp
class RecoveryPartitionMounter : public PartitionMounter {
public:
- RecoveryPartitionMounter(bool systemRootImage) : mSystemRootImage(systemRootImage) {}
+ RecoveryPartitionMounter() : fstab_(defaultFstabMgr()) {}
status_t mountSystem() const override {
- if (mSystemRootImage) {
+ if (!fstab_) return UNKNOWN_ERROR;
+ if (fs_mgr_get_entry_for_mount_point(fstab_.get(), "/system") == nullptr) {
return mount("/", kSystemImageRootDir);
} else {
return mount("/system", kSystemImageRootDir);
status_t umountVendor() const override { return umount(kVendorImageRootDir); }
private:
- const bool mSystemRootImage = false;
+ FstabMgr fstab_;
status_t mount(const char* path, const char* mountPoint) const {
- FstabMgr fstab = defaultFstabMgr();
- if (fstab == NULL) {
- return UNKNOWN_ERROR;
- }
- return mountAt(fstab, path, mountPoint);
+ if (!fstab_) return UNKNOWN_ERROR;
+ return mountAt(fstab_, path, mountPoint);
}
};
int32_t VintfObjectRecovery::CheckCompatibility(
const std::vector<std::string> &xmls, std::string *error) {
auto propertyFetcher = std::make_unique<details::PropertyFetcherImpl>();
- bool systemRootImage = propertyFetcher->getBoolProperty("ro.build.system_root_image", false);
- auto mounter = std::make_unique<details::RecoveryPartitionMounter>(systemRootImage);
+ auto mounter = std::make_unique<details::RecoveryPartitionMounter>();
auto fileSystem = std::make_unique<details::RecoveryFileSystem>();
auto vintfObject = std::make_unique<VintfObject>(std::move(fileSystem), std::move(mounter),
nullptr /* runtime info factory */,