Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7e3d1570 authored by David Anderson's avatar David Anderson Committed by Gerrit Code Review
Browse files

Merge changes I0cdef3d5,Ib4a281a3,I1569f927

* changes:
  init: Always create and restorecon /dev/dm-user.
  libsnapshot: Get DaemonTransition test passing again.
  libsnapshot: Move first-stage pid var constant into IDeviceInfo.
parents 5f5f6a11 1ff7581f
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -288,20 +288,20 @@ void SnapuserdTest::CreateProductDmUser(std::unique_ptr<TemporaryFile>& cow) {
}

void SnapuserdTest::InitCowDevices() {
    system_blksize_ = client_->InitDmUserCow(cow_system_->path);
    system_blksize_ = client_->InitDmUserCow(system_device_ctrl_name_, cow_system_->path,
                                             system_a_loop_->device());
    ASSERT_NE(system_blksize_, 0);

    product_blksize_ = client_->InitDmUserCow(cow_product_->path);
    product_blksize_ = client_->InitDmUserCow(product_device_ctrl_name_, cow_product_->path,
                                              product_a_loop_->device());
    ASSERT_NE(product_blksize_, 0);
}

void SnapuserdTest::InitDaemon() {
    bool ok = client_->InitializeSnapuserd(cow_system_->path, system_a_loop_->device(),
                                           GetSystemControlPath());
    bool ok = client_->AttachDmUser(system_device_ctrl_name_);
    ASSERT_TRUE(ok);

    ok = client_->InitializeSnapuserd(cow_product_->path, product_a_loop_->device(),
                                      GetProductControlPath());
    ok = client_->AttachDmUser(product_device_ctrl_name_);
    ASSERT_TRUE(ok);
}

+4 −0
Original line number Diff line number Diff line
@@ -120,5 +120,9 @@ bool DeviceInfo::SetSlotAsUnbootable([[maybe_unused]] unsigned int slot) {
#endif
}

std::string DeviceInfo::GetSnapuserdFirstStagePidVar() const {
    return kSnapuserdFirstStagePidVar;
}

}  // namespace snapshot
}  // namespace android
+1 −0
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@ class DeviceInfo final : public SnapshotManager::IDeviceInfo {
    bool SetBootControlMergeStatus(MergeStatus status) override;
    bool SetSlotAsUnbootable(unsigned int slot) override;
    bool IsRecovery() const override;
    std::string GetSnapuserdFirstStagePidVar() const override;

  private:
    bool EnsureBootHal();
+1 −0
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ class MockDeviceInfo : public SnapshotManager::IDeviceInfo {
    MOCK_METHOD(bool, SetBootControlMergeStatus, (MergeStatus status), (override));
    MOCK_METHOD(bool, SetSlotAsUnbootable, (unsigned int slot), (override));
    MOCK_METHOD(bool, IsRecovery, (), (const, override));
    MOCK_METHOD(std::string, GetSnapuserdFirstStagePidVar, (), (const, override));
};

}  // namespace android::snapshot
+1 −0
Original line number Diff line number Diff line
@@ -107,6 +107,7 @@ class ISnapshotManager {
        virtual bool SetSlotAsUnbootable(unsigned int slot) = 0;
        virtual bool IsRecovery() const = 0;
        virtual bool IsTestDevice() const { return false; }
        virtual std::string GetSnapuserdFirstStagePidVar() const = 0;
    };
    virtual ~ISnapshotManager() = default;

Loading