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

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

Merge changes Ie4313c7a,I0f40b1f2

* changes:
  snapshotctl: Not necessary to link to libdm.
  libdm: Make static std::string inline for DmTargetDefaultKey.
parents ad9d034e 478e1c19
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -243,12 +243,10 @@ std::string DmTargetCrypt::GetParameterString() const {
    return android::base::Join(argv, " ");
}

const std::string DmTargetDefaultKey::name_ = "default-key";

bool DmTargetDefaultKey::IsLegacy(bool* result) {
    DeviceMapper& dm = DeviceMapper::Instance();
    DmTargetTypeInfo info;
    if (!dm.GetTargetByName(name_, &info)) return false;
    if (!dm.GetTargetByName(kName, &info)) return false;
    // dm-default-key was modified to be like dm-crypt with version 2
    *result = !info.IsAtLeast(2, 0, 0);
    return true;
+3 −2
Original line number Diff line number Diff line
@@ -287,7 +287,7 @@ class DmTargetDefaultKey final : public DmTarget {
          blockdev_(blockdev),
          start_sector_(start_sector) {}

    std::string name() const override { return name_; }
    std::string name() const override { return kName; }
    bool Valid() const override;
    std::string GetParameterString() const override;
    static bool IsLegacy(bool* result);
@@ -296,7 +296,8 @@ class DmTargetDefaultKey final : public DmTarget {
    void SetWrappedKeyV0() { is_hw_wrapped_ = true; }

  private:
    static const std::string name_;
    inline static const std::string kName = "default-key";

    std::string cipher_;
    std::string key_;
    std::string blockdev_;
+0 −1
Original line number Diff line number Diff line
@@ -214,7 +214,6 @@ cc_binary {
        "snapshotctl.cpp",
    ],
    static_libs: [
        "libdm",
        "libfstab",
        "libsnapshot",
    ],