AOSP10 TWRP Merge: fix conflicts and update libraries needed

This allows flame to boot TWRP. Still will need to work on
super partition for vendor and system access.

The plan will be to cherry-pick any updates to android-9.0
through gerrit.twrp.me to this branch as a WIP.
This commit is contained in:
bigbiff
2020-03-23 10:02:29 -04:00
parent 26d5d5f0b9
commit d58ba18272
132 changed files with 3361 additions and 3309 deletions

View File

@@ -25,6 +25,7 @@
#include <vector>
#include <android-base/file.h>
#include <android-base/properties.h>
#include <android-base/stringprintf.h>
#include <android-base/unique_fd.h>
#include <fstab/fstab.h>
@@ -39,47 +40,7 @@ void SetMiscBlockDeviceForTest(std::string_view misc_device) {
g_misc_device_for_test = misc_device;
}
#ifdef USE_OLD_BOOTLOADER_MESSAGE
#include <sys/system_properties.h>
static struct fstab* read_fstab(std::string* err) {
// The fstab path is always "/fstab.${ro.hardware}".
std::string fstab_path = "/fstab.";
char value[PROP_VALUE_MAX];
if (__system_property_get("ro.hardware", value) == 0) {
*err = "failed to get ro.hardware";
return nullptr;
}
fstab_path += value;
struct fstab* fstab = fs_mgr_read_fstab(fstab_path.c_str());
if (fstab == nullptr) {
*err = "failed to read " + fstab_path;
}
return fstab;
}
#endif
static std::string get_misc_blk_device(std::string* err) {
<<<<<<< HEAD
#ifdef USE_OLD_BOOTLOADER_MESSAGE
struct fstab* fstab = read_fstab(err);
#else
std::unique_ptr<fstab, decltype(&fs_mgr_free_fstab)> fstab(fs_mgr_read_fstab_default(),
fs_mgr_free_fstab);
#endif
if (!fstab) {
*err = "failed to read default fstab";
return "";
}
#ifdef USE_OLD_BOOTLOADER_MESSAGE
fstab_rec* record = fs_mgr_get_entry_for_mount_point(fstab, "/misc");
#else
fstab_rec* record = fs_mgr_get_entry_for_mount_point(fstab.get(), "/misc");
#endif
if (record == nullptr) {
*err = "failed to find /misc partition";
return "";
=======
if (!g_misc_device_for_test.empty()) {
return g_misc_device_for_test;
}
@@ -92,7 +53,6 @@ static std::string get_misc_blk_device(std::string* err) {
if (entry.mount_point == "/misc") {
return entry.blk_device;
}
>>>>>>> android-10.0.0_r25
}
*err = "failed to find /misc partition";