fs_mgr: Fix __ANDROID_RECOVERY__ usage in libfiemap.
Certain code in libfiemap should be unreachable in recovery/ramdisk builds, but whether intentionally or not, __ANDROID_RECOVERY__ is not working in vendor_boot. To make sure this is doing exactly what we want, use __ANDROID_RAMDISK__ instead. Bug: 205987817 Test: build boot, vendor_boot, recovery Change-Id: Id419f7d9068e791427a896c22569ae4543548df7
This commit is contained in:
parent
15a20e3906
commit
fb921468ab
|
@ -79,7 +79,7 @@ ImageManager::ImageManager(const std::string& metadata_dir, const std::string& d
|
||||||
partition_opener_ = std::make_unique<android::fs_mgr::PartitionOpener>();
|
partition_opener_ = std::make_unique<android::fs_mgr::PartitionOpener>();
|
||||||
|
|
||||||
// Allow overriding whether ImageManager thinks it's in recovery, for testing.
|
// Allow overriding whether ImageManager thinks it's in recovery, for testing.
|
||||||
#ifdef __ANDROID_RECOVERY__
|
#ifdef __ANDROID_RAMDISK__
|
||||||
device_info_.is_recovery = {true};
|
device_info_.is_recovery = {true};
|
||||||
#else
|
#else
|
||||||
if (!device_info_.is_recovery.has_value()) {
|
if (!device_info_.is_recovery.has_value()) {
|
||||||
|
@ -523,7 +523,7 @@ bool ImageManager::MapImageDevice(const std::string& name,
|
||||||
|
|
||||||
auto image_header = GetImageHeaderPath(name);
|
auto image_header = GetImageHeaderPath(name);
|
||||||
|
|
||||||
#if !defined __ANDROID_RECOVERY__
|
#ifndef __ANDROID_RAMDISK__
|
||||||
// If there is a device-mapper node wrapping the block device, then we're
|
// If there is a device-mapper node wrapping the block device, then we're
|
||||||
// able to create another node around it; the dm layer does not carry the
|
// able to create another node around it; the dm layer does not carry the
|
||||||
// exclusion lock down the stack when a mount occurs.
|
// exclusion lock down the stack when a mount occurs.
|
||||||
|
|
Loading…
Reference in New Issue