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

Commit eef2a703 authored by Tom Cherry's avatar Tom Cherry
Browse files

init: always initialize device-mapper

Device-mapper is required already, so drop the conditionals for trying to
load it.  GetRootEntry() was depending on its existance, so this adds the
required dependency.

Bug: 131747478
Test: boot without any verity/avb/dm-linear devices.
Change-Id: Ifc89d3b338e2c2b8faaf1c24e2792c1eeb5bbbde
parent a6e6c7d9
Loading
Loading
Loading
Loading
+4 −12
Original line number Original line Diff line number Diff line
@@ -276,14 +276,12 @@ bool FirstStageMount::GetDmLinearMetadataDevice() {
// required_devices_partition_names_. Found partitions will then be removed from it
// required_devices_partition_names_. Found partitions will then be removed from it
// for the subsequent member function to check which devices are NOT created.
// for the subsequent member function to check which devices are NOT created.
bool FirstStageMount::InitRequiredDevices() {
bool FirstStageMount::InitRequiredDevices() {
    if (required_devices_partition_names_.empty()) {
        return true;
    }

    if (IsDmLinearEnabled() || need_dm_verity_) {
    if (!InitDeviceMapper()) {
    if (!InitDeviceMapper()) {
        return false;
        return false;
    }
    }

    if (required_devices_partition_names_.empty()) {
        return true;
    }
    }


    auto uevent_callback = [this](const Uevent& uevent) { return UeventCallback(uevent); };
    auto uevent_callback = [this](const Uevent& uevent) { return UeventCallback(uevent); };
@@ -604,12 +602,6 @@ void FirstStageMount::UseGsiIfPresent() {
        return;
        return;
    }
    }


    // Device-mapper might not be ready if the device doesn't use DAP or verity
    // (for example, hikey).
    if (access("/dev/device-mapper", F_OK) && !InitDeviceMapper()) {
        return;
    }

    // Find the name of the super partition for the GSI. It will either be
    // Find the name of the super partition for the GSI. It will either be
    // "userdata", or a block device such as an sdcard. There are no by-name
    // "userdata", or a block device such as an sdcard. There are no by-name
    // partitions other than userdata that we support installing GSIs to.
    // partitions other than userdata that we support installing GSIs to.